00001 #ifndef __MYSYMBOL_H__ 00002 #define __MYSYMBOL_H__ 00003 struct mysymbol{ 00004 char *name; 00005 void *func; 00006 struct mysymbol *next; 00007 }; 00008 00009 #define mysymbol_export(func) \ 00010 struct mysymbol __mysymbol_##func __attribute__ ((unused,__section__ (".mysymbol"))) = {#func,func,0}; 00011 00012 static inline void *find_mysymbol(struct mysymbol *head,char *name) 00013 { 00014 struct mysymbol *p; 00015 for(p=head;p;p=p->next) 00016 if(!strcmp(name,p->name)) break; 00017 return p?p->func:0; 00018 } 00019 00020 00021 00022 extern struct mysymbol *mysymbol_head; 00023 extern struct mysymbol *mysymbol_tail; 00024 #endif
1.5.6