Search code examples
cmobileopen-sourceembedded

Finding out where a function is defined


I'm programming in Mobile C (a mobile agent platform over C) which is open source. I'm debugging using prints since I can't use gdb because I use a C interpreter (Embedded Ch).

The problem is there are functions I can't find out where they are defined. For example, there is the function agent_queue_RemoveIndex which is used in multiple places along the source code but I can't find out where is defined (I've looked in all define files, I've done a grep -R of the entire source code, Googled it...). When I do the grep -R I can only find calls to the function but not the definition. It seems like there is no agent_queue_RemoveIndex definition but it must because Mobile C is open-source code and the function works.

Any ideas of what is happening?


Solution

  • It is defined in this file.

    See line 64:

    int name##_RemoveIndex(name##_p name, int index); 
    

    For the definition of name## you need to dig the linked file and the documentation.