Intercept Open and Save Functionality in Source code

I would like to know which function and file in the source code is called when user opens and/or saves/autosave a document? I need to add some piece of code to perform a task just before user opens or saves a document. Please note that adding a listener is not preferred in my case.
Also, if there is any faster way to compile and include only touched file during make? For some reason, the default make always performs “make all”.

@Jim- I wasn’t sure if I had to add this to my earlier questions, trying a different approach here.

Thank you in Advance

Development-related questions are better asked at #libreoffice-dev IRC channel at FreeNode.

And the “default make” does not rebuild everything; but it runs unit tests, which take much time; so you might want to use make build-nocheck in the process, and only use make from time to time to make sure you don’t break the tests.