/home/dko/projects/mobilec/trunk/src/include/commands.h

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

Generated on Fri May 16 14:49:54 2008 for Mobile-C by  doxygen 1.5.4