Go to the documentation of this file.00001
00035 #ifndef __REGISTER_FUNCTIONS__
00036 #define __REGISTER_FUNCTIONS__
00037
00038
00042 typedef struct
00043 {
00044 char *name;
00046 int (*trigger_cb) (int argc, char **argv, int x, int y);
00051 const char *description;
00054 const char *syntax;
00056 } fpw_function_t;
00057
00058
00062 typedef struct fpw_function_node_t
00063 {
00064 struct fpw_function_node_t *next;
00066 fpw_function_t *functions;
00068 int n;
00070 } fpw_function_node_t;
00071
00072
00073 fpw_function_node_t *fpw_function_nodes = 0;
00074
00075
00076 static int n_functions = 0;
00077
00078
00079 static fpw_function_t *all_functions = 0;
00080
00081
00082 static int fpw_function_sort (const void *va, const void *vb);
00083 fpw_function_t * fpw_find_function (const char *name);
00084 int fpw_functionv (const char *name, int argc, char **argv);
00085 int fpw_function (const char *name);
00086
00087 #define FPW_CONCAT(a,b) a##b
00088
00089 void fpw_register_functions (fpw_function_t * a, int n);
00090
00091 #define REGISTER_FUNCTIONS(a) FPW_CONCAT(void register_,a) ()\
00092 { fpw_register_functions(a, sizeof(a)/sizeof(a[0])); }
00093
00094
00095 #endif
00096
00097
00098