SUPPORT.C
资源名称:drdossrc.zip [点击查看]
上传用户:xiaogehua
上传日期:2007-01-08
资源大小:1183k
文件大小:34k
源码类别:
操作系统开发
开发平台:
Asm
- /*
- ; File : $Workfile: SUPPORT.C$
- ;
- ; Description :
- ;
- ; Original Author : DIGITAL RESEARCH
- ;
- ; Last Edited By : $CALDERA$
- ;
- ;-----------------------------------------------------------------------;
- ; Copyright Work of Caldera, Inc. All Rights Reserved.
- ;
- ; THIS WORK IS A COPYRIGHT WORK AND CONTAINS CONFIDENTIAL,
- ; PROPRIETARY AND TRADE SECRET INFORMATION OF CALDERA, INC.
- ; ACCESS TO THIS WORK IS RESTRICTED TO (I) CALDERA, INC. EMPLOYEES
- ; WHO HAVE A NEED TO KNOW TO PERFORM TASKS WITHIN THE SCOPE OF
- ; THEIR ASSIGNMENTS AND (II) ENTITIES OTHER THAN CALDERA, INC. WHO
- ; HAVE ACCEPTED THE CALDERA OPENDOS SOURCE LICENSE OR OTHER CALDERA LICENSE
- ; AGREEMENTS. EXCEPT UNDER THE EXPRESS TERMS OF THE CALDERA LICENSE
- ; AGREEMENT NO PART OF THIS WORK MAY BE USED, PRACTICED, PERFORMED,
- ; COPIED, DISTRIBUTED, REVISED, MODIFIED, TRANSLATED, ABRIDGED,
- ; CONDENSED, EXPANDED, COLLECTED, COMPILED, LINKED, RECAST,
- ; TRANSFORMED OR ADAPTED WITHOUT THE PRIOR WRITTEN CONSENT OF
- ; CALDERA, INC. ANY USE OR EXPLOITATION OF THIS WORK WITHOUT
- ; AUTHORIZATION COULD SUBJECT THE PERPETRATOR TO CRIMINAL AND
- ; CIVIL LIABILITY.
- ;-----------------------------------------------------------------------;
- ;
- ; *** Current Edit History ***
- ; *** End of Current Edit History ***
- ;
- ; $Log$
- ;
- ; ENDLOG
- */
- /*
- File SUPPORT.C
- Title SUPPORT routines for command.com
- Revision History:-
- ==================
- Date Description
- -----------------------------------------------------------------------------
- 10 Apr 86 EQU function now makes a case independant match.
- 29 Apr 86 Single $ preceeds the screen control variables
- Fix bug where if the last character of a screen control
- variable was an octal character it was not printed
- 6 May 86 yes() now requires a default to be specified previously
- it assumed the default was NO.
- 21 May 86 Fixed bug with yes() function when default is NO.
- 22 May 86 Allow the screen control codes to be patched to longer strings
- Upd`te ZAP_SPACES to delete all white space
- Version 1.2
- ===========
- 31 Jul 86 Conditionally remove functions that cannot be fully supported
- in a CDOS version of COMMAND.COM
- 4 Aug 86 ANSI C compatibility MSC /W1
- 30 Oct 86 FREE_DRIVE now forces the drive to point to the root
- directory of the current drive.
- 17 Feb 87 Rewrote repwild() function to fix minor problems
- Aug 87 Make all routines PASCAL calling convention (for Concurrent 6)
- 26 Oct 87 Update the F_CHECK routine to support multiple switches ie
- "/wc" as well as "/w /c".
- 27 Oct 87 Stop F_CHECK from forcing the input line to lower case.
- 10 Nov 87 Modify F_CHECK flag zapping
- 18 Nov 87 Prevent GET_FILENAME copying a filename > than MAX_PATHLEN
- 16 Dec 87 Update D_CHECK to make fewer system calls.
- 29 Feb 88 Tidy the REPWILD routine - No Functional Change
- 15 Mar 88 Use ANSI Escape sequences for DOS Plus
- 27 Apr 88 Restore Range check to D_CHECK routine
- 25 May 88 Print a CR after a CLS to reset the current column count.
- 26 May 88 Change the Default HighLight and LowLight strings to NULL
- for DOSPLUS.
- 27 May 88 Added string undefs.
- 23 Jun 88 Add new ONOFF function for XXX [=] ON|OFF parsing
- 28 Jun 88 Correct bug in YES routine for FAR messages
- 1 Jul 88 Support Control-C from YES for TMP.
- 6 Jul 88 Support the CON:filename syntax for COPY.
- 19 Sep 88 Enhance error checking on the F_CHECK routine. Now traps the
- condition when switchar is at the end of the line.
- 1 Dec 88 Convert all path parsing routines to be KANJI friendly.
- 21 Dec 88 Add generic ISDEV routine to SUPPORT.C
- 21 Dec 88 "*" to "*.*" conversion moved to CMD_DIR.
- 18 Apr 89 c_write: write to STDERR if err_flag set
- 6 Jun 89 Correct GET_FILENAME to parse path passwords.
- 6 Jun 89 echo: check for endline after on/off.
- 10 Aug 89 get rid of sysdate_fmt (year does not need to be %04d, which
- upsets Japanese day)
- 10 Aug 89 day_name_len for day_names array elements
- 22 Aug 89 Japanese dayname comes after date
- Remove day_name_len & work out length from array.
- 11 Sep 89 strupr(), strlwr() and stricmp() are now Kanji aware.
- toupper() is now in DOSIF.ASM and uses international routine.
- 16 Oct 89 Kanji specific routines replaced with DBCS routines.
- 30 Oct 89 "Internal Error" moved to message.c (and no longer resident)
- 15 Dec 89 errors 50-72 give "Network error" rather than "Internal error"
- 6-Mar-90 Watcom C v 7.0
- 13-Mar-90 Output CR/LF after errors
- 4-May-90 append_slash added
- 4-May-90 get_filename stops at ';' unless followed by pathchar(s)
- ("append;" bug)
- 20-Sep-90 Created skip_char() and copy_char().
- Created is_blank() and amended deblank(), zap_spaces(),
- is_filechar() and is_pathchar() to use it.
- 13-Mar-91 changed nofiles() function to cope with DIR.. on NOVELL drives.
- 18-Mar-91 tolower() ( and therefore strlwr() ) is now aware of TURKISH
- capital I's with dots.
- 6-Aug-91 prompt_exec() function no longer uses the heap. This screwed us
- up if the file to be execed was a batch file.
- 09-Jun-92 is_pathchar and d_check now cope with drive '[', etc, as used
- by some novell applications. See also INVALID_DRV in command.h.
- 18-Jun-92 Added optional_line() function for '?' support in batch files.
- -----------------------------------------------------------------------------
- */
- #include "defines.h"
- #include <setjmp.h>
- /*#include <string.h>*/
- #if defined(MWC) && defined(strlen)
- #undef strcmp /* These are defined as macros in string.h */
- #undef strcpy /* which are expaneded in line under */
- #undef strlen /* Metaware C. These undefs avoid this. */
- #endif
- #include <portab.h>
- #include <mserror.h>
- #if defined(CDOSTMP)
- #include <ccpm.h>
- #include <sysdat.h>
- #endif
- #include "command.h"
- #include "toupper.h"
- #include "dosif.h"
- #include "global.h"
- #include "dos.h"
- EXTERN jmp_buf break_env;
- EXTERN VOID CDECL printf(BYTE *, ...);
- EXTERN VOID CDECL eprintf(BYTE *, ...);
- EXTERN VOID CDECL sprintf(BYTE *, BYTE *, ...);
- #if defined(CDOSTMP)
- EXTERN VOID CDECL int_break(VOID); /* COM.C Internal Break */
- #endif
- MLOCAL VOID screen(BYTE *, BYTE *);
- MLOCAL VOID outs(BYTE *);
- GLOBAL VOID crlf(VOID);
- GLOBAL VOID putc(BYTE);
- GLOBAL VOID c_write(BYTE *, UWORD);
- GLOBAL BYTE * fptr(BYTE *);
- GLOBAL BYTE * day_names(UWORD);
- /*.pa*/
- /*
- * The following screen control sequences can be redefined or removed
- * by entries in the environment or the OEM can patch these areas in the
- * COMMAND.COM object and change the default values.
- *
- */
- #define CLS_KEY "$CLS=" /* CLS entry in environment */
- #define REVON_KEY "$ON=" /* REVON entry in environment */
- #define REVOFF_KEY "$OFF=" /* REVOFF entry in environment */
- #ifdef DOSPLUS
- /*
- * For DOSPLUS the default screen control sequences are for an
- * ANSI Terminal (IBM Sub-Set).
- */
- #define CLS_DEF "