Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 212
user1031431 Avatar asked Nov 15 '25 03:11

user1031431


1 Answers

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 into the linked file and the documentation.

like image 139
meyumer Avatar answered Nov 17 '25 18:11

meyumer