CMDLIST.C
上传用户:xiaogehua
上传日期:2007-01-08
资源大小:1183k
文件大小:8k
源码类别:

操作系统开发

开发平台:

Asm

  1. /*
  2. ;    File              : $Workfile: CMDLIST.C$
  3. ;
  4. ;    Description       :
  5. ;
  6. ;    Original Author   : DIGITAL RESEARCH
  7. ;
  8. ;    Last Edited By    : $CALDERA$
  9. ;
  10. ;-----------------------------------------------------------------------;
  11. ;    Copyright Work of Caldera, Inc. All Rights Reserved.
  12. ;      
  13. ;    THIS WORK IS A COPYRIGHT WORK AND CONTAINS CONFIDENTIAL,
  14. ;    PROPRIETARY AND TRADE SECRET INFORMATION OF CALDERA, INC.
  15. ;    ACCESS TO THIS WORK IS RESTRICTED TO (I) CALDERA, INC. EMPLOYEES
  16. ;    WHO HAVE A NEED TO KNOW TO PERFORM TASKS WITHIN THE SCOPE OF
  17. ;    THEIR ASSIGNMENTS AND (II) ENTITIES OTHER THAN CALDERA, INC. WHO
  18. ;    HAVE ACCEPTED THE CALDERA OPENDOS SOURCE LICENSE OR OTHER CALDERA LICENSE
  19. ;    AGREEMENTS. EXCEPT UNDER THE EXPRESS TERMS OF THE CALDERA LICENSE
  20. ;    AGREEMENT NO PART OF THIS WORK MAY BE USED, PRACTICED, PERFORMED,
  21. ;    COPIED, DISTRIBUTED, REVISED, MODIFIED, TRANSLATED, ABRIDGED,
  22. ;    CONDENSED, EXPANDED, COLLECTED, COMPILED, LINKED, RECAST,
  23. ;    TRANSFORMED OR ADAPTED WITHOUT THE PRIOR WRITTEN CONSENT OF
  24. ;    CALDERA, INC. ANY USE OR EXPLOITATION OF THIS WORK WITHOUT
  25. ;    AUTHORIZATION COULD SUBJECT THE PERPETRATOR TO CRIMINAL AND
  26. ;    CIVIL LIABILITY.
  27. ;-----------------------------------------------------------------------;
  28. ;
  29. ;    *** Current Edit History ***
  30. ;    *** End of Current Edit History ***
  31. ;
  32. ;    $Log$
  33. ;    CMDLIST.C 1.18 94/08/09 15:47:05 
  34. ;    Fixed TRUENAME help.
  35. ;    CMDLIST.C 1.16 94/06/28 15:42:23
  36. ;    Add TRUENAME support
  37. ;    CMDLIST.C 1.15 93/12/01 00:17:11
  38. ;    Tidy up, commands alphabetical for benefit of help screen
  39. ;    CMDLIST.C 1.14 93/10/28 17:08:05
  40. ;    ifdef'd out 'more' , since it now external
  41. ;    see cmd_list[].
  42. ;    CMDLIST.C 1.12 93/04/22 14:50:45 
  43. ;    GOSUB, RETURN and SWITCH now have help.  
  44. ;    CMDLIST.C 1.11 93/01/21 16:15:03
  45. ;    CMDLIST.C 1.7 92/08/06 09:52:44 
  46. ;    Added novell_ext_list which is used to expand novell system information
  47. ;    statements. See BATCH.C for more info.
  48. ;   ENDLOG
  49. */
  50. /*
  51. *  3 Oct 90  remove 8087 command
  52. *  5 Oct 90  remove logout and lock command
  53. * 23 Oct 90  support AND, OR, INPUT, INPUTC, +BATCH
  54. * 23 Nov 90  add ECHOERR command
  55. */
  56. #include "defines.h"
  57. #include <portab.h>
  58. #include "command.h" /* Command Definitions */
  59. #include "txhelp.h"
  60. /*.pa
  61.  * CMD_LIST maps command names to routines as well as specifying
  62.  * the top level of syntax checking. If a command requires parameters
  63.  *      then the message field must point to the error message to be
  64.  *      displayed if no parmeters are given.
  65.  */
  66. EXTERN VOID CDECL cmd_break(BYTE *, BYTE *);
  67. EXTERN VOID CDECL cmd_call(BYTE *, BYTE *); 
  68. EXTERN VOID CDECL cmd_cd(BYTE *, BYTE *);     
  69. EXTERN VOID CDECL cmd_copy(BYTE *, BYTE *); 
  70. EXTERN VOID CDECL cmd_ctty(BYTE *, BYTE *); 
  71. EXTERN VOID CDECL cmd_chcp(BYTE *, BYTE *); 
  72. EXTERN VOID CDECL cmd_idle(BYTE *, BYTE *); /*#NOIDLE#*/
  73. EXTERN VOID CDECL cmd_hiload(BYTE *, BYTE *);
  74. EXTERN VOID CDECL cmd_date(BYTE *, BYTE *);   
  75. EXTERN VOID CDECL cmd_del(BYTE *, BYTE *);    
  76. EXTERN VOID CDECL cmd_dir(BYTE *, BYTE *);    
  77. EXTERN VOID CDECL cmd_delq(BYTE *, BYTE *);   
  78. EXTERN VOID CDECL cmd_md(BYTE *, BYTE *);     
  79. EXTERN VOID CDECL cmd_more(BYTE *, BYTE *);   
  80. EXTERN VOID CDECL cmd_path(BYTE *, BYTE *);   
  81. EXTERN VOID CDECL cmd_prompt(BYTE *, BYTE *); 
  82. EXTERN VOID CDECL cmd_ren(BYTE *, BYTE *);    
  83. EXTERN VOID CDECL cmd_rd(BYTE *, BYTE *);     
  84. EXTERN VOID CDECL cmd_time(BYTE *, BYTE *);   
  85. EXTERN VOID CDECL cmd_truename(BYTE *, BYTE *);   
  86. EXTERN VOID CDECL cmd_type(BYTE *, BYTE *);   
  87. EXTERN VOID CDECL cmd_ver(BYTE *, BYTE *);    
  88. EXTERN VOID CDECL cmd_verify(BYTE *, BYTE *);
  89. EXTERN VOID CDECL cmd_vol(BYTE *, BYTE *);    
  90. EXTERN VOID CDECL cmd_cls(BYTE *, BYTE *);  
  91. EXTERN VOID CDECL cmd_echo(BYTE *, BYTE *);
  92. EXTERN VOID CDECL cmd_echoerr(BYTE *, BYTE *); 
  93. EXTERN VOID CDECL cmd_exit(BYTE *, BYTE *); 
  94. EXTERN VOID CDECL cmd_for(BYTE *, BYTE *);  
  95. EXTERN VOID CDECL cmd_goto(BYTE *, BYTE *); 
  96. EXTERN VOID CDECL cmd_gosub(BYTE *, BYTE *);
  97. EXTERN VOID CDECL cmd_return(BYTE *, BYTE *);
  98. EXTERN VOID CDECL cmd_switch(BYTE *, BYTE *);
  99. EXTERN VOID CDECL cmd_if(BYTE *, BYTE *);   
  100. EXTERN VOID CDECL cmd_pause(BYTE *, BYTE *);
  101. EXTERN VOID CDECL cmd_pauseerr(BYTE *, BYTE *);
  102. EXTERN VOID CDECL cmd_rem(BYTE *, BYTE *);  
  103. EXTERN VOID CDECL cmd_set(BYTE *, BYTE *);  
  104. EXTERN VOID CDECL cmd_shift(BYTE *, BYTE *);
  105. EXTERN VOID CDECL cmd_or(BYTE *, BYTE *); 
  106. GLOBAL S_CMD cmd_list[] =
  107. {
  108. /*
  109. TO DO: MAKE DUAL LANG AWARE
  110. */
  111. #if !defined(NOXBATCH)
  112.         { "and", cmd_if,      PARAM_IFCONTEXT,DLS_help_and },
  113. #endif /*NOXBATCH*/
  114. { "break", cmd_break, PARAM_NONE, DLS_help_break },
  115. { "call", cmd_call, PARAM_NEEDFILE, DLS_help_call },
  116. { "cd",  cmd_cd,  PARAM_NONE, DLS_help_chdir },
  117. { "chcp", cmd_chcp, PARAM_NONE, DLS_help_chcp },
  118. { "chdir", cmd_cd,  PARAM_NONE, DLS_help_chdir },
  119. { "cls", cmd_cls, PARAM_NONE, DLS_help_cls },
  120. { "copy", cmd_copy, PARAM_NEEDFILE, DLS_help_copy },
  121. { "ctty", cmd_ctty, PARAM_NEEDDEV, DLS_help_ctty },
  122. { "date", cmd_date, PARAM_NONE, DLS_help_date },
  123. { "del", cmd_del, PARAM_NEEDFILE, DLS_help_del },
  124. { "delq", cmd_delq, PARAM_NEEDFILE, DLS_help_delq },
  125. { "dir", cmd_dir, PARAM_NONE, DLS_help_dir },
  126. { "echo", cmd_echo, PARAM_NONE, DLS_help_echo },
  127. { "era", cmd_del, PARAM_NEEDFILE, DLS_help_erase },
  128. { "eraq", cmd_delq, PARAM_NEEDFILE, DLS_help_eraq },
  129. { "erase", cmd_del, PARAM_NEEDFILE, DLS_help_erase },
  130. { "exit", cmd_exit, PARAM_NONE, DLS_help_exit },
  131. { "for", cmd_for, PARAM_SYNTAX, DLS_help_for },
  132. { "gosub", cmd_gosub, PARAM_SYNTAX, DLS_help_gosubreturn},
  133. { "goto", cmd_goto, PARAM_SYNTAX, DLS_help_goto },
  134. { "hiload", cmd_hiload, PARAM_NONE, DLS_help_hiload },
  135. { "idle", cmd_idle, PARAM_NONE, DLS_help_idle },
  136. { "if",  cmd_if,  PARAM_SYNTAX, DLS_help_if },
  137. { "lh", cmd_hiload, PARAM_NONE, DLS_help_hiload },
  138. { "loadhigh", cmd_hiload, PARAM_NONE, DLS_help_hiload },
  139. { "md",  cmd_md,  PARAM_NEEDPATH, DLS_help_mkdir },
  140. { "mkdir", cmd_md,  PARAM_NEEDPATH, DLS_help_mkdir },
  141. #if !defined(NOXBATCH)
  142. { "or",      cmd_or,      PARAM_IFCONTEXT,DLS_help_or },
  143. #endif /*NOXBATCH*/
  144. { "path", cmd_path, PARAM_NONE, DLS_help_path },
  145. { "pause", cmd_pause, PARAM_NONE, DLS_help_pause },
  146. { "prompt", cmd_prompt, PARAM_NONE, DLS_help_prompt },
  147. { "rd",  cmd_rd,  PARAM_NEEDPATH, DLS_help_rmdir },
  148. { "rem", cmd_rem, PARAM_NONE, DLS_help_rem },
  149. { "ren", cmd_ren, PARAM_NEEDFILE, DLS_help_rename },
  150. { "rename", cmd_ren, PARAM_NEEDFILE, DLS_help_rename },
  151. { "return", cmd_return, PARAM_NONE, DLS_help_gosubreturn},
  152. { "rmdir", cmd_rd,  PARAM_NEEDPATH, DLS_help_rmdir },
  153. { "set", cmd_set, PARAM_NONE, DLS_help_set },
  154. { "shift", cmd_shift, PARAM_NONE, DLS_help_shift },
  155. #if SWITCH_ENABLED
  156. { "switch", cmd_switch, PARAM_SYNTAX, DLS_help_switch },
  157. #endif
  158. { "time", cmd_time, PARAM_NONE, DLS_help_time },
  159. { "truename", cmd_truename,  PARAM_NONE, DLS_help_truename},
  160. { "type", cmd_type, PARAM_NEEDFILE, DLS_help_type },
  161. { "ver", cmd_ver, PARAM_NONE, DLS_help_ver },
  162. { "verify", cmd_verify, PARAM_NONE, DLS_help_verify },
  163. { "vol", cmd_vol, PARAM_NONE, DLS_help_vol },
  164. { NULL,  NULL, PARAM_NONE }
  165. };
  166. EXTERN VOID CDECL get_login_name(BYTE *);
  167. EXTERN VOID CDECL get_pstation(BYTE *);
  168. EXTERN VOID CDECL get_full_name(BYTE *);
  169. EXTERN VOID CDECL get_hour(BYTE *);
  170. EXTERN VOID CDECL get_hour24(BYTE *);
  171. EXTERN VOID CDECL get_minute(BYTE *);
  172. EXTERN VOID CDECL get_second(BYTE *);
  173. EXTERN VOID CDECL get_am_pm(BYTE *);
  174. EXTERN VOID CDECL get_greeting(BYTE *);
  175. EXTERN VOID CDECL get_year(BYTE *);
  176. EXTERN VOID CDECL get_short_year(BYTE *);
  177. EXTERN VOID CDECL get_month(BYTE *);
  178. EXTERN VOID CDECL get_month_name(BYTE *);
  179. EXTERN VOID CDECL get_day(BYTE *);
  180. EXTERN VOID CDECL get_day_of_week(BYTE *);
  181. EXTERN VOID CDECL get_nday_of_week(BYTE *);
  182. EXTERN VOID CDECL get_os_version(BYTE *);
  183. EXTERN VOID CDECL get_connection(BYTE *);
  184. GLOBAL N_CMD novell_ext_list[] = {
  185. { "LOGIN_NAME", get_login_name },
  186. { "P_STATION",  get_pstation    },
  187. { "FULL_NAME",  get_full_name   },
  188. { "HOUR", get_hour },
  189. { "HOUR24", get_hour24 },
  190. { "MINUTE", get_minute },
  191. { "SECOND", get_second },
  192. { "AM_PM", get_am_pm },
  193. { "GREETING_TIME", get_greeting },
  194. { "YEAR", get_year },
  195. { "SHORT_YEAR", get_short_year  },
  196. { "MONTH", get_month },
  197. { "MONTH_NAME", get_month_name  },
  198. { "DAY", get_day },
  199. { "DAY_OF_WEEK",get_day_of_week },
  200. { "NDAY_OF_WEEK",get_nday_of_week},
  201. { "OS_VERSION", get_os_version  },
  202. { "STATION",    get_connection  },
  203. { NULL, NULL }
  204. };