00001 /* SVN FILE INFO 00002 * $Revision: 174 $ : Last Committed Revision 00003 * $Date: 2008-06-24 10:50:29 -0700 (Tue, 24 Jun 2008) $ : Last Committed Date */ 00004 /*[ 00005 * Copyright (c) 2007 Integration Engineering Laboratory 00006 University of California, Davis 00007 * 00008 * Permission to use, copy, and distribute this software and its 00009 * documentation for any purpose with or without fee is hereby granted, 00010 * provided that the above copyright notice appear in all copies and 00011 * that both that copyright notice and this permission notice appear 00012 * in supporting documentation. 00013 * 00014 * Permission to modify the software is granted, but not the right to 00015 * distribute the complete modified source code. Modifications are to 00016 * be distributed as patches to the released version. Permission to 00017 * distribute binaries produced by compiling modified sources is granted, 00018 * provided you 00019 * 1. distribute the corresponding source modifications from the 00020 * released version in the form of a patch file along with the binaries, 00021 * 2. add special version identification to distinguish your version 00022 * in addition to the base release version number, 00023 * 3. provide your name and address as the primary contact for the 00024 * support of your modified version, and 00025 * 4. retain our contact information in regard to use of the base 00026 * software. 00027 * Permission to distribute the released version of the source code along 00028 * with corresponding source modifications in the form of a patch file is 00029 * granted with same provisions 2 through 4 for binary distributions. 00030 * 00031 * This software is provided "as is" without express or implied warranty 00032 * to the extent permitted by applicable law. 00033 ]*/ 00034 00035 #ifndef _COMMANDS_H_ 00036 #define _COMMANDS_H_ 00037 #include "macros.h" 00038 #include "mc_platform.h" 00039 00040 /*Func Prototypes*/ 00041 #define COMMAND(name, cmd, desc) int handler_##name (void *arg, mc_platform_p global); 00042 #include "commands.x.h" 00043 #undef COMMAND 00044 00045 typedef int (*cmd_handler_t) (void *, mc_platform_p global); 00046 00047 enum command_indices_e{ 00048 #define COMMAND(name, cmd, description) COMMAND_##name , 00049 #include "commands.x.h" 00050 #undef COMMAND 00051 COMMAND_COUNT 00052 }; 00053 00054 cmd_handler_t cmd_handlers[] = { 00055 #define COMMAND(name, cmd, description) &handler_##name , 00056 #include"commands.x.h" 00057 #undef COMMAND 00058 NULL 00059 }; 00060 00061 char *command_descriptions[] = { 00062 #define COMMAND(name, cmd, description) description , 00063 #include"commands.x.h" 00064 #undef COMMAND 00065 NULL 00066 }; 00067 00068 char *command_cmds[] = { 00069 #define COMMAND(name, cmd, description) cmd , 00070 #include"commands.x.h" 00071 #undef COMMAND 00072 NULL 00073 }; 00074 00075 00076 #endif