cmdparser.h
Go to the documentation of this file.00001 #ifndef __CMDPARSER_H
00002 #define __CMDPARSER_H
00003 struct mycmd{
00004 char *name;
00005 int (*func)(int argc,char **argv);
00006 char *usage;
00007 char *note;
00008 char *(*complete)(int argc,char **av,char *text,int start,int end);
00009 struct mycmd *next;
00010 };
00011
00012 struct myinit{
00013 int (*func)(void);
00014 };
00015 #define mycmd_init(name,func,usage,note) \
00016 struct mycmd __mycmd_##name __attribute__ ((unused,__section__ (".mycmd"))) = {#name,func,usage,note,0,0};
00017 #define mycmd_init1(name,func,usage,note,complete) \
00018 struct mycmd __mycmd_##name __attribute__ ((unused,__section__ (".mycmd"))) = {#name,func,usage,note,complete,0};
00019
00020
00021 #endif