ADS环境下的类似linux内核的操作系统

源代码在线查看: cmd.h

软件大小: 6233 K
上传用户: snowpilce
关键词: linux ADS 环境 内核
下载地址: 免注册下载 普通下载 VIP

相关代码

				#ifndef CMD_H
				#define CMD_H
				
				#define NULL			 0
				#define TOKEN            1
				#define TOKEN_LEAF       2 
				#define VALUE            3 
				#define VALUE_LEAF       4
				
				
				struct cmd
				{
				   int type;
				   char *name;
				   char *tip;
				   void (*func)();
				   struct cmd *next;
				};
				
				
				#define DECLEAR_CMD(CMD) \
				extern struct cmd CMD[];
				
				#define BEGIN_CMD_DEFINE(CMD) \
				struct cmd CMD[]={
				
				#define END_CMD_DEFINE  \
				{0,NULL,NULL,NULL,NULL} \
				};
					
				#define IMPLEMENT_CMD_TOKEN(NAME,TIP,NEXT) \
				{TOKEN,NAME,TIP,NULL,NEXT},
				
				#define IMPLEMENT_CMD_TOKEN_LEAF(NAME,TIP,FUNC) \
				{TOKEN_LEAF,NAME,TIP,FUNC,NULL},
				
				#define IMPLEMENT_CMD_VALUE(NAME,TIP,NEXT) \
				{VALUE,NAME,TIP,NULL,NEXT},
				
				#define IMPLEMENT_CMD_VALUE_LEAF(NAME,TIP,FUNC) \
				{VALUE_LEAF,NAME,TIP,FUNC,NULL},	
				
				
				void cmd_root_set(struct cmd *root);
				int cmd_process(int argc,char *argv[]);
				
				
				#endif /* CMD_H */			

相关资源