mirror of
https://github.com/microsoft/MS-DOS.git
synced 2026-01-27 05:42:55 +00:00
MZ is back!
This commit is contained in:
223
v4.0/src/CMD/BACKUP/BACKPARS.H
Normal file
223
v4.0/src/CMD/BACKUP/BACKPARS.H
Normal file
@@ -0,0 +1,223 @@
|
||||
/* 0 */
|
||||
/*-----------------------------------------------------------------------*/
|
||||
/*- -*/
|
||||
/*- FILE: BACKPARS.H -*/
|
||||
/*- -*/
|
||||
/*- PURPOSE: Defines structures and DEFINES for the DOS PARSE -*/
|
||||
/*- service routines. -*/
|
||||
/*- -*/
|
||||
/*- DATE: 6/5/87 -*/
|
||||
/*- -*/
|
||||
/*-----------------------------------------------------------------------*/
|
||||
|
||||
|
||||
/**********************************************************/
|
||||
/* STRUCTURE TO DEFINE ADDITIONAL COMMAND LINE DELIMITERS */
|
||||
/**********************************************************/
|
||||
struct p_parms /*;AN000;4*/
|
||||
{ /*;AN000;4*/
|
||||
WORD parmsx_ptr; /* POINTER TO PARMS STRUCTURE *//*;AN000;4*/
|
||||
BYTE p_num_extra; /* 1 SAYS THAT A DELIMITER LIST FOLLOWS */ /*;AN000;4*/
|
||||
BYTE p_len_extra_delim; /* NUMBER OF ADDITIONAL DELIMITERS *//*;AN000;4*/
|
||||
BYTE p_extra_delim[2]; /* ADDITIONAL DELIMITERS */ /*;AN000;4*/
|
||||
}; /*;AN000;4*/
|
||||
|
||||
/**************************************************/
|
||||
/* STRUCTURE TO DEFINE BACKUP SYNTAX REQUIREMENTS */
|
||||
/**************************************************/
|
||||
struct p_parmsx /*;AN000;4*/
|
||||
{ /*;AN000;4*/
|
||||
BYTE p_minpos; /* THERE ARE 2 REQUIRED POSITIONAL PARMS*/ /*;AN000;4*/
|
||||
BYTE p_maxpos; /* THERE ARE 2 REQUIRED POSITIONAL PARMS*/ /*;AN000;4*/
|
||||
WORD pos1_ptr; /* POINTER TO SOURCE FILESPEC DEF AREA*/ /*;AN000;4*/
|
||||
WORD pos2_ptr; /* POINTER TO TARGET DRIVE DEF AREA*/ /*;AN000;4*/
|
||||
BYTE num_sw; /* THERE ARE 7 SWITCHES (/S, /F, /M, /A, /L:, /T:, /D:) */ /*;AN000;4*/
|
||||
WORD sw1_ptr; /* POINTER TO FIRST SWITCH DEFINITION AREA*//*;AN000;4*/
|
||||
WORD sw2_ptr; /* POINTER TO SECOND SWITCH DEFINITION AREA*//*;AN000;4*/
|
||||
WORD sw3_ptr; /* POINTER TO THIRD SWITCH DEFINITION AREA*//*;AN000;4*/
|
||||
WORD sw4_ptr; /* POINTER TO FOURTH SWITCH DEFINITION AREA*//*;AN000;4*/
|
||||
WORD sw5_ptr; /* POINTER TO FIFTH SWITCH DEFINITION AREA*//*;AN000;4*/
|
||||
WORD num_keywords; /* NUMBER OF KEYWORDS IN BACKUP SYNTAX*/ /*;AN000;4*/
|
||||
}; /*;AN000;4*/
|
||||
|
||||
/****************************************/
|
||||
/* STRUCTURE TO DEFINE POSITIONAL PARMS */
|
||||
/****************************************/
|
||||
struct p_pos_blk /*;AN000;4*/
|
||||
{ /*;AN000;4*/
|
||||
WORD match_flag; /* Controls type matched */ /*;AN000;4*/
|
||||
WORD function_flag; /* Function should be taken */ /*;AN000;4*/
|
||||
WORD result_buf; /* Result buffer address */ /*;AN000;4*/
|
||||
WORD value_list; /* Value list address */ /*;AN000;4*/
|
||||
BYTE nid; /* # of keyword/SW synonyms (0) *//*;AN000;4*/
|
||||
}; /*;AN000;4*/
|
||||
|
||||
/********************************/
|
||||
/* STRUCTURE TO DEFINE SWITCHES */
|
||||
/********************************/
|
||||
struct p_sw_blk /*;AN000;4*/
|
||||
{ /*;AN000;4*/
|
||||
WORD p_match_flag; /* Controls type matched */ /*;AN000;4*/
|
||||
WORD p_function_flag; /* Function should be taken */ /*;AN000;4*/
|
||||
WORD p_result_buf; /* Result buffer address */ /*;AN000;4*/
|
||||
WORD p_value_list; /* Value list address */ /*;AN000;4*/
|
||||
BYTE p_nid; /* # of switches */ /*;AN000;4*/
|
||||
BYTE switch1[3]; /* Save area for switch */ /*;AN000;4*/
|
||||
BYTE switch2[3]; /* Save area for switch */ /*;AN000;4*/
|
||||
BYTE switch3[3]; /* Save area for switch */ /*;AN000;4*/
|
||||
BYTE switch4[3]; /* Save area for switch */ /*;AN000;4*/
|
||||
}; /*;AN000;4*/
|
||||
/**/
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
/**************************/
|
||||
/* RETURN BUFFER FOR TIME */
|
||||
/**************************/
|
||||
struct timebuff /*;AN000;4*/
|
||||
{ /*;AN000;4*/
|
||||
BYTE t_type; /* TYPE RETURNED*/ /*;AN000;4*/
|
||||
BYTE t_item_tag; /* SPACE FOR ITEM TAG*/ /*;AN000;4*/
|
||||
WORD t_synonym_ptr; /* pointer to Synonym list returned */ /*;AN000;4*/
|
||||
BYTE hours; /*;AN000;4*/
|
||||
BYTE minutes; /*;AN000;4*/
|
||||
BYTE seconds; /*;AN000;4*/
|
||||
BYTE hundreds; /*;AN000;4*/
|
||||
}; /*;AN000;4*/
|
||||
|
||||
/**************************/
|
||||
/* RETURN BUFFER FOR DATE */
|
||||
/**************************/
|
||||
struct datebuff
|
||||
{ /*;AN000;4*/
|
||||
BYTE d_type; /* TYPE RETURNED*/ /*;AN000;4*/
|
||||
BYTE d_item_tag; /* SPACE FOR ITEM TAG*/ /*;AN000;4*/
|
||||
WORD d_synonym_ptr; /* pointer to Synonym list returned */ /*;AN000;4*/
|
||||
WORD year; /*;AN000;4*/
|
||||
BYTE month; /*;AN000;4*/
|
||||
BYTE day; /*;AN000;4*/
|
||||
}; /*;AN000;4*/
|
||||
|
||||
|
||||
/*******************************************/
|
||||
/* RETURN BUFFER FOR POSITIONAL PARAMETERS */
|
||||
/*******************************************/
|
||||
struct p_result_blk /*;AN000;4*/
|
||||
{ /*;AN000;4*/
|
||||
BYTE p_type; /* Type returned */ /*;AN000;4*/
|
||||
BYTE p_item_tag; /* Matched item tag */ /*;AN000;4*/
|
||||
WORD p_synonym_ptr; /* pointer to Synonym list returned *//*;AN000;4*/
|
||||
DWORD p_string_ptr; /* Pointer to string /*;AN000;4*/
|
||||
}; /*;AN000;4*/
|
||||
|
||||
/****************************************/
|
||||
/* RETURN BUFFER FOR SWITCH INFORMATION */
|
||||
/****************************************/
|
||||
struct switchbuff /*;AN000;4*/
|
||||
{ /*;AN000;4*/
|
||||
BYTE sw_type; /* TYPE RETURNED*/ /*;AN000;4*/
|
||||
BYTE sw_item_tag; /* Matched item tag */ /*;AN000;4*/
|
||||
WORD sw_synonym_ptr; /* pointer to synonym */ /*;AN000;4*/
|
||||
DWORD sw_string_ptr; /* Pointer to string */ /*;AN000;4*/
|
||||
}; /*;AN000;4*/
|
||||
|
||||
|
||||
/********************************/
|
||||
/* VALUE LIST FOR /F: PARAMETER */
|
||||
/********************************/
|
||||
struct val_list_struct /*;AN000;pxxxx*/
|
||||
{ /*;AN000;pxxxx*/
|
||||
BYTE nval; /*;AN000;pxxxx*/
|
||||
BYTE num_ranges; /*;AN000;pxxxx*/
|
||||
BYTE num_choices; /*;AN000;pxxxx*/
|
||||
BYTE num_strings; /*;AN000;pxxxx*/
|
||||
BYTE item_tag01; /*;AN000;pxxxx*/
|
||||
WORD val01; /*;AN000;pxxxx*/
|
||||
BYTE item_tag02; /*;AN000;pxxxx*/
|
||||
WORD val02; /*;AN000;pxxxx*/
|
||||
BYTE item_tag03; /*;AN000;pxxxx*/
|
||||
WORD val03; /*;AN000;pxxxx*/
|
||||
BYTE item_tag04; /*;AN000;pxxxx*/
|
||||
WORD val04; /*;AN000;pxxxx*/
|
||||
BYTE item_tag05; /*;AN000;pxxxx*/
|
||||
WORD val05; /*;AN000;pxxxx*/
|
||||
BYTE item_tag06; /*;AN000;pxxxx*/
|
||||
WORD val06; /*;AN000;pxxxx*/
|
||||
BYTE item_tag07; /*;AN000;pxxxx*/
|
||||
WORD val07; /*;AN000;pxxxx*/
|
||||
BYTE item_tag08; /*;AN000;pxxxx*/
|
||||
WORD val08; /*;AN000;pxxxx*/
|
||||
BYTE item_tag09; /*;AN000;pxxxx*/
|
||||
WORD val09; /*;AN000;pxxxx*/
|
||||
BYTE item_tag10; /*;AN000;pxxxx*/
|
||||
WORD val10; /*;AN000;pxxxx*/
|
||||
BYTE item_tag11; /*;AN000;pxxxx*/
|
||||
WORD val11; /*;AN000;pxxxx*/
|
||||
BYTE item_tag12; /*;AN000;pxxxx*/
|
||||
WORD val12; /*;AN000;pxxxx*/
|
||||
BYTE item_tag13; /*;AN000;pxxxx*/
|
||||
WORD val13; /*;AN000;pxxxx*/
|
||||
BYTE item_tag14; /*;AN000;pxxxx*/
|
||||
WORD val14; /*;AN000;pxxxx*/
|
||||
BYTE item_tag15; /*;AN000;pxxxx*/
|
||||
WORD val15; /*;AN000;pxxxx*/
|
||||
BYTE item_tag16; /*;AN000;pxxxx*/
|
||||
WORD val16; /*;AN000;pxxxx*/
|
||||
BYTE item_tag17; /*;AN000;pxxxx*/
|
||||
WORD val17; /*;AN000;pxxxx*/
|
||||
BYTE item_tag18; /*;AN000;pxxxx*/
|
||||
WORD val18; /*;AN000;pxxxx*/
|
||||
BYTE item_tag19; /*;AN000;pxxxx*/
|
||||
WORD val19; /*;AN000;pxxxx*/
|
||||
BYTE item_tag20; /*;AN000;pxxxx*/
|
||||
WORD val20; /*;AN000;pxxxx*/
|
||||
BYTE item_tag21; /*;AN000;pxxxx*/
|
||||
WORD val21; /*;AN000;pxxxx*/
|
||||
BYTE item_tag22; /*;AN000;pxxxx*/
|
||||
WORD val22; /*;AN000;pxxxx*/
|
||||
BYTE item_tag23; /*;AN000;pxxxx*/
|
||||
WORD val23; /*;AN000;pxxxx*/
|
||||
BYTE item_tag24; /*;AN000;pxxxx*/
|
||||
WORD val24; /*;AN000;pxxxx*/
|
||||
BYTE item_tag25; /*;AN000;pxxxx*/
|
||||
WORD val25; /*;AN000;pxxxx*/
|
||||
BYTE item_tag26; /*;AN000;pxxxx*/
|
||||
WORD val26; /*;AN000;pxxxx*/
|
||||
BYTE item_tag27; /*;AN000;pxxxx*/
|
||||
WORD val27; /*;AN000;pxxxx*/
|
||||
|
||||
}; /*;AN000;pxxxx*/
|
||||
|
||||
/*********************************/
|
||||
/* VALUE TABLE FOR /F: PARAMETER */
|
||||
/*********************************/
|
||||
struct val_table_struct /*;AN000;pxxxx*/
|
||||
{ /*;AN000;pxxxx*/
|
||||
BYTE val01[7]; /*;AN000;pxxxx*/
|
||||
BYTE val02[7]; /*;AN000;pxxxx*/
|
||||
BYTE val03[7]; /*;AN000;pxxxx*/
|
||||
BYTE val04[7]; /*;AN000;pxxxx*/
|
||||
BYTE val05[7]; /*;AN000;pxxxx*/
|
||||
BYTE val06[7]; /*;AN000;pxxxx*/
|
||||
BYTE val07[7]; /*;AN000;pxxxx*/
|
||||
BYTE val08[7]; /*;AN000;pxxxx*/
|
||||
BYTE val09[7]; /*;AN000;pxxxx*/
|
||||
BYTE val10[7]; /*;AN000;pxxxx*/
|
||||
BYTE val11[7]; /*;AN000;pxxxx*/
|
||||
BYTE val12[7]; /*;AN000;pxxxx*/
|
||||
BYTE val13[7]; /*;AN000;pxxxx*/
|
||||
BYTE val14[7]; /*;AN000;pxxxx*/
|
||||
BYTE val15[7]; /*;AN000;pxxxx*/
|
||||
BYTE val16[7]; /*;AN000;pxxxx*/
|
||||
BYTE val17[7]; /*;AN000;pxxxx*/
|
||||
BYTE val18[7]; /*;AN000;pxxxx*/
|
||||
BYTE val19[7]; /*;AN000;pxxxx*/
|
||||
BYTE val20[7]; /*;AN000;pxxxx*/
|
||||
BYTE val21[7]; /*;AN000;pxxxx*/
|
||||
BYTE val22[7]; /*;AN000;pxxxx*/
|
||||
BYTE val23[7]; /*;AN000;pxxxx*/
|
||||
BYTE val24[7]; /*;AN000;pxxxx*/
|
||||
BYTE val25[7]; /*;AN000;pxxxx*/
|
||||
BYTE val26[7]; /*;AN000;pxxxx*/
|
||||
BYTE val27[7]; /*;AN000;pxxxx*/
|
||||
}; /*;AN000;pxxxx*/
|
||||
4385
v4.0/src/CMD/BACKUP/BACKUP.C
Normal file
4385
v4.0/src/CMD/BACKUP/BACKUP.C
Normal file
File diff suppressed because it is too large
Load Diff
502
v4.0/src/CMD/BACKUP/BACKUP.H
Normal file
502
v4.0/src/CMD/BACKUP/BACKUP.H
Normal file
@@ -0,0 +1,502 @@
|
||||
/*0 */
|
||||
/*-----------------------------------------------------------
|
||||
/*-
|
||||
/*- FILE: BACKUP.H
|
||||
/*-
|
||||
/*- PURPOSE: For the BACKUP utility, this file has the required
|
||||
/*- BACKUP defines, message numbers, structures,
|
||||
/*- and subroutine declarations.
|
||||
/*-
|
||||
/*---------------------------------------------------------*/
|
||||
|
||||
/*----------------------
|
||||
/*- Utility #DEFINES...
|
||||
/*----------------------*/
|
||||
|
||||
#define DHLENGTH 139 /* Length, in bytes, of a Disk Header */
|
||||
#define DBLENGTH 70 /* Length, in bytes, of a Directory Block */
|
||||
#define FHLENGTH 34 /* Length, in bytes, of a File Header */
|
||||
|
||||
#define BYTE unsigned char
|
||||
#define WORD unsigned short
|
||||
#define DWORD unsigned long
|
||||
|
||||
#define NOERROR 0
|
||||
#define NUL 0
|
||||
|
||||
#define FALSE 0
|
||||
#define TRUE !FALSE
|
||||
|
||||
#define BACKSLASH 0x5c
|
||||
|
||||
#define READONLYOFF 254 /* bit mask, will be ANDed with current attribute to turn off readonly bit */
|
||||
|
||||
#define READONLY 0x01 /* File Attributes */
|
||||
#define HIDDEN 0x02
|
||||
#define SYSTEM 0x04
|
||||
#define VOLLABEL 0x08
|
||||
#define SUBDIR 0x10
|
||||
#define ARCHIVE 0x20
|
||||
|
||||
#define DENYALL 0x10 /* Sharing Mode */
|
||||
#define DENYWRITE 0x20
|
||||
#define DENYREAD 0x30
|
||||
#define DENYNONE 0x40
|
||||
|
||||
#define READACCESS 0x00 /* Access Modes */
|
||||
#define WRITEACCESS 0x01
|
||||
#define READWRITE 0x02
|
||||
|
||||
|
||||
#define NO_CP_CHECK 0x100 /*;AN000;5*/
|
||||
|
||||
#define SYNCHRONOUS 0x4000 /* OS/2 File Write-Through */
|
||||
#define NOTSYNCHRONOUS 0x0000 /* OS/2 File Write-Through */
|
||||
#define OPENDASD 0x8000 /* OS/2 Open a DASD device */
|
||||
#define OPEN_IT 0x01 /*;AN000;5*/
|
||||
#define CREATE_IT 0x12 /*;AN000;5*/
|
||||
|
||||
#define NO_INHERIT 0x80 /* Inheritance bit */
|
||||
|
||||
#define STDIN 0x00 /* Predefined handles */
|
||||
#define STDOUT 0x01
|
||||
#define STDERR 0x02
|
||||
|
||||
#define BOFILE 0 /* LSEEK move methods */
|
||||
#define CURRPOS 1
|
||||
#define EOFILE 2
|
||||
|
||||
#define GET 0 /* CHMOD functions */
|
||||
#define SET 1
|
||||
|
||||
#define SSTRING 0x2000 /*;AN000;4 Parser Match Flags */
|
||||
#define DATESTRING 0x1000 /*;AN000;4*/
|
||||
#define TIMESTRING 0x0800 /*;AN000;4*/
|
||||
#define FILESPEC 0x0200 /*;AN000;4*/
|
||||
#define DRIVELETTER 0x0100 /*;AN000;4*/
|
||||
#define OPTIONAL 0x0001 /*;AN000;4*/
|
||||
|
||||
#define CAP_FILETABLE 0x0001 /*;AN000;4 Parser Function flag*/
|
||||
#define CAP_CHARTABLE 0x0002 /*;AN000;4 Parser Function flag*/
|
||||
|
||||
#define LABELLEN 11
|
||||
|
||||
#define SETLOGICALDRIVE 0x440F /*;AN000;8 */
|
||||
|
||||
|
||||
/*--------APPEND FUNCTIONS-----------*/
|
||||
#define INSTALL_CHECK 0xB700 /*;AN000;2*/
|
||||
#define NOT_INSTALLED 0 /*;AN000;2*/
|
||||
#define GET_APPEND_VER 0xB702 /*;AN000;2*/
|
||||
#define NET_APPEND 1 /*;AN000;2*/
|
||||
#define DOS_APPEND 2 /*;AN000;2*/
|
||||
#define GET_STATE 0xB706 /*;AN000;2*/
|
||||
#define SET_STATE 0xB707 /*;AN000;2*/
|
||||
|
||||
#define APPEND_X_BIT 0x8000 /*;AN000;2*/
|
||||
|
||||
|
||||
|
||||
#define ACTIONHOOK 2
|
||||
#define CTRLC 1
|
||||
#define CTRLBREAK 4
|
||||
|
||||
#define EOL -1 /*;AN000;4*/
|
||||
#define QUOTED_STRING 9 /*;AN000;4*/
|
||||
#define RET_DATE 7 /*;AN000;4*/
|
||||
#define RET_TIME 8 /*;AN000;4*/
|
||||
|
||||
#define CPSW_ACTIVE 1 /*;AN000;3*/
|
||||
#define CPSW_NOTACTIVE 0 /*;AN000;3*/
|
||||
#define GET_CPSW 0x3303 /*;AN000;3*/
|
||||
|
||||
#define CARRY 0x0001 /*;AN000;*/
|
||||
/***********************************/
|
||||
/* Utility-specific definitions */
|
||||
/***********************************/
|
||||
|
||||
#define ROOTDIR 0
|
||||
#define BACKUPDIR 1
|
||||
|
||||
#define PUT_SEG(fp,seg) (*((unsigned *)&(fp)+1)) = (unsigned) seg
|
||||
#define PUT_OFF(fp,off) (*((unsigned *)&(fp))) = (unsigned) off
|
||||
|
||||
#define MAXMSGLEN 160
|
||||
#define PATHLEN 64
|
||||
#define MAX_RETRY_OPEN_COUNT 5
|
||||
|
||||
#define RETCODE_NO_ERROR 0 /* Errorlevels */
|
||||
#define RETCODE_NO_FILES 1
|
||||
#define RETCODE_SHARE_ERROR 2
|
||||
#define RETCODE_CTL_BREAK 3
|
||||
#define RETCODE_ERROR 4
|
||||
|
||||
/************************************************/
|
||||
/* NOTE FROM PARSER SUBROUTINE !!!!! */
|
||||
/************************************************/
|
||||
/* The SECONDS bits in the DOS Directory are in */
|
||||
/* 2-second increments. Therefore, div by 2, */
|
||||
/* take the integer portion and use in search. */
|
||||
/* Note that files can be backed up that were */
|
||||
/* modified 1 second before the time that a user*/
|
||||
/* enters, which is better than not backing up */
|
||||
/* a file that was modified at exactly that time*/
|
||||
/************************************************/
|
||||
|
||||
/*-------------------------------------------*/
|
||||
/*------ BACKUP messages --------*/
|
||||
/*-------------------------------------------*/
|
||||
#define BAD_DOS_VER 1 /*;AN000;6*/
|
||||
#define INSUFF_MEMORY 2 /*;AN000;6*/
|
||||
|
||||
#define INV_DRIVE 6 /*;AN000;6*/
|
||||
#define INV_DATE 7 /*;AN000;6*/
|
||||
#define INV_TIME 8 /*;AN000;6*/
|
||||
|
||||
#define INV_PATH 11 /*;AN000;6*/
|
||||
#define NO_SOURCE 12 /*;AN000;6*/
|
||||
#define NO_TARGET 13 /*;AN000;6*/
|
||||
#define SRC_AND_TGT_SAME 14 /*;AN000;6*/
|
||||
#define ERR_EXEC_FORMAT 15 /*;AN000;6*/
|
||||
#define CANT_FIND_FORMAT 16 /*;AN000;d178*/
|
||||
#define CANT_OPEN_LOGFILE 17 /*;AN000;6*/
|
||||
#define LOGGING 18 /*;AN000;6*/
|
||||
#define NOTLASTMSG 19 /*;AN000;6*/
|
||||
#define ERASEMSG 20 /*;AN000;6*/
|
||||
#define FERASEMSG 21 /*;AN000;6*/
|
||||
#define BUDISKMSG 22 /*;AN000;6*/
|
||||
#define SEQUENCEMSG 23 /*;AN000;6*/
|
||||
#define NONEFNDMSG 24 /*;AN000;6*/
|
||||
#define INSERTSOURCE 25 /*;AN000;6*/
|
||||
#define INSERTTARGET 26 /*;AN000;6*/
|
||||
#define CONFLICTMSG 27 /*;AN000;6*/
|
||||
#define LASTDISKMSG 28 /*;AN000;6*/
|
||||
#define INVTARGET 29 /*;AN000;6*/
|
||||
#define LASTNOTBACKUP 30 /*;AN000;6*/
|
||||
#define FDISKFULLMSG 31 /*;AN000;6*/
|
||||
#define LOGFILE_TARGET_FULL 32 /*;AN000;6*/
|
||||
#define PRESS_ANY_KEY 33 /*;AN000;6*/
|
||||
#define CRLF 34 /*;AN000;6*/
|
||||
#define CANT_FORMAT_HARDFILE 35 /*;AN000;/*
|
||||
|
||||
/*------------------------------------*/
|
||||
/*- MESSAGE CLASSES -*/
|
||||
/*------------------------------------*/
|
||||
#define EXTENDED 1 /*;AN000;6*/
|
||||
#define PARSEERROR 2 /*;AN000;6*/
|
||||
#define UTIL_MSG -1 /*;AN000;6*/
|
||||
|
||||
#define NOWAIT 0 /*;AN000;6*/
|
||||
#define WAIT 0xc8 /*;AN000;6*/
|
||||
|
||||
|
||||
/*-------------------------------------------------------------*/
|
||||
/*- CONTROL BLOCK FOR EACH BACKUP DISKETTE */
|
||||
/*-------------------------------------------------------------*/
|
||||
/*- THIS STRUCTURE WILL MAKE UP THE FIRST DH_DHLength BYTES */
|
||||
/*- OF THE control.xxx FILE ON THE BACKUP TARGET. */
|
||||
/*- IT IDENTIFIES THE DISK AS BEING A BACKUP, AND INCLUDES */
|
||||
/*- DISKETTE SEQUENCE NUMBER AND A FLAG INDICATING IF THIS */
|
||||
/*- IS THE LAST TARGET. */
|
||||
/*-------------------------------------------------------------*/
|
||||
|
||||
#define LAST_TARGET 0xFF
|
||||
#define NOT_LAST_TARGET 0x00
|
||||
|
||||
struct Disk_Header
|
||||
{
|
||||
BYTE DH_Length; /* Length, in bytes, of disk header */
|
||||
BYTE DH_Identifier[8]; /* Identifies disk as a backup */
|
||||
BYTE DH_Sequence; /* Backup diskette seq num (1-255) */
|
||||
BYTE DH_reserved [128]; /* Save area for nothing */
|
||||
BYTE DH_LastDisk; /* Indicates if this is last target */
|
||||
/* 0xFF if last target, 0 otherwise */
|
||||
};
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*- DIRECTORY BLOCK */
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*- THIS STRUCTURE IS WRITTEN TO THE control.xxx FILE AT LEAST ONCE */
|
||||
/*- FOR EACH SUBDIRECTORY, INCLUDING THE ROOT, BACKED UP. IT CONTAINS */
|
||||
/*- THE PATH TO THAT DIRECTORY, THE NUMBER OF FILES FROM THAT */
|
||||
/*- DIRECTORY THAT ARE BACKED UP ON CURRENT TARGET, AND THE OFFSET */
|
||||
/*- OF THE NEXT DIRECTORY BLOCK ON THAT DISKETTE, IF ONE EXISTS. */
|
||||
/*- IF THERE ARE NO OTHER DIRECTORY BLOCKS, IT EQUALS 0xffffffff. */
|
||||
/*----------------------------------------------------------------------*/
|
||||
#define LAST_DB 0xFFFFFFFF
|
||||
|
||||
struct Dir_Block
|
||||
{
|
||||
BYTE DB_Length; /* Length, in bytes, of dir block */
|
||||
BYTE DB_Path[63];
|
||||
/* ASCII path of this directory, */
|
||||
/* drive letter omitted */
|
||||
WORD DB_NumEntries; /* Num of filenames currently in list*/
|
||||
DWORD DB_NextDB; /* Offset of next directory block */
|
||||
}; /* =0xffffffff if there are no more*/
|
||||
/* on current target */
|
||||
|
||||
/*--------------------------------------------------------------------*/
|
||||
/*- CONTROL BLOCK FOR EACH BACKED-UP FILE */
|
||||
/*--------------------------------------------------------------------*/
|
||||
/*- THIS STRUCTURE WILL BE REPEATED AFTER THE DIRECTORYBLOCK ONCE */
|
||||
/*- FOR EACH FILE BACKED UP FROM THAT DIRECTORY. IT CONTAINS THE */
|
||||
/*- FILENAME, DIRECTORY INFORMATION, AND OTHER NECESSARY INFORMATION. */
|
||||
/*--------------------------------------------------------------------*/
|
||||
#define NOTLASTPART 0
|
||||
#define LASTPART 1
|
||||
|
||||
#define NOTSUCCESSFUL 0
|
||||
#define SUCCESSFUL 2
|
||||
|
||||
#define EXT_ATTR 4 /*;AN000;3*/
|
||||
|
||||
struct File_Header
|
||||
{
|
||||
BYTE FH_Length; /* Length, in bytes, of file header */
|
||||
BYTE FH_FName[12]; /* ASCII file name (from directory)*/
|
||||
BYTE FH_Flags; /* bit 0=1 if last part of file */
|
||||
/* bit 1=1 if it is backed up successfully */
|
||||
/* bit 2=1 if Extended Attributes are backed up (New for DOS4.00) ;AN000;3*/
|
||||
DWORD FH_FLength; /* Total length of the file (from directory) */
|
||||
WORD FH_FSequence; /* Sequence #, for files that span */
|
||||
DWORD FH_BeginOffset; /* Offset in BACKUP.xxx where this segment begins */
|
||||
DWORD FH_PartSize; /* Length of part of file on current target */
|
||||
WORD FH_Attribute; /* File attribute (from directory) */
|
||||
WORD FH_FTime; /* Time when file was last modified (from directory)*/
|
||||
WORD FH_FDate; /* Date when file was last modified (from directory)*/
|
||||
};
|
||||
|
||||
/*--------------------------------------------------------------------*/
|
||||
/*- THIS IS THE STRUCTURE THAT IS USED IN THE LINKED LIST OF */
|
||||
/*- DIRECTORIES THAT NEED TO BE PROCESSED (if /S option specified) */
|
||||
/*--------------------------------------------------------------------*/
|
||||
struct node
|
||||
{
|
||||
struct node *np;
|
||||
char path[PATHLEN+15];
|
||||
};
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------*/
|
||||
/*- THIS IS THE STRUCTURE THAT IS USED BY THE DOS FUNCTION */
|
||||
/*- "RETURN COUNTRY INFORMATION" */
|
||||
/*--------------------------------------------------------------------*/
|
||||
struct ctry_info_blk
|
||||
{
|
||||
WORD country_code;
|
||||
WORD code_page;
|
||||
WORD date_format;
|
||||
#define USA 0
|
||||
#define EUR 1
|
||||
#define JAP 2
|
||||
BYTE currency_symbol[5];
|
||||
WORD thousands_separator;
|
||||
WORD decimal_Separator;
|
||||
WORD date_separator;
|
||||
WORD time_separator;
|
||||
BYTE currency_format;
|
||||
BYTE num_sig_dec_dig_in_currency;
|
||||
BYTE time_format;
|
||||
DWORD case_map_call;
|
||||
WORD data_list_separator;
|
||||
WORD reserved[5];
|
||||
};
|
||||
|
||||
/*------------------------------------------------------------------------*/
|
||||
/*- THIS STRUCTURE IS USED BY THE DOS MESSAGE HANDLER SERVICE ROUTINES -*/
|
||||
/*------------------------------------------------------------------------*/
|
||||
|
||||
/************************************************/
|
||||
/* Substitution List for Message Retriever */
|
||||
/************************************************/
|
||||
/*-----------------------
|
||||
; SUBLIST Equates
|
||||
;------------------------*/
|
||||
#define SUBLIST_SIZE 11 /*;AN000;6*/
|
||||
|
||||
#define LEFT_ALIGN 0x0 /*;AN000;600xxxxxx */
|
||||
#define RIGHT_ALIGN 0x80 /*;AN000;610xxxxxx */
|
||||
|
||||
#define CHAR_FIELD_CHAR 0x0 /*;AN000;6a0000000 */
|
||||
#define CHAR_FIELD_ASCIIZ 0x10 /*;AN000;6a0010000 */
|
||||
|
||||
#define UNSGN_BIN_BYTE 0x11 /*;AN000;6a0010001 - Unsigned BINary to Decimal CHARacter */
|
||||
#define UNSGN_BIN_WORD 0x21 /*;AN000;6a0100001 */
|
||||
#define UNSGN_BIN_DWORD 0x31 /*;AN000;6a0110001 */
|
||||
|
||||
|
||||
/*---------------------------------------------*/
|
||||
/*- Message substitution list structure -*/
|
||||
/*---------------------------------------------*/
|
||||
struct subst_list /*;AN000;6*/
|
||||
{ /*;AN000;6*/
|
||||
BYTE sl_size1; /* Size of List */ /*;AN000;6*/
|
||||
BYTE zero1; /* Reserved */ /*;AN000;6*/
|
||||
char far *value1; /* Time, date, or ptr to data item*/ /*;AN000;6*/
|
||||
BYTE one; /* n of %n */ /*;AN000;6*/
|
||||
BYTE flags1; /* Data Type flags */ /*;AN000;6*/
|
||||
BYTE max_width1; /* Maximum FIELD width */ /*;AN000;6*/
|
||||
BYTE min_width1; /* Minimum FIELD width */ /*;AN000;6*/
|
||||
BYTE pad_char1; /* Character for pad FIELD */ /*;AN000;6*/
|
||||
|
||||
BYTE sl_size2; /* Size of List */ /*;AN000;6*/
|
||||
BYTE zero2; /* Reserved */ /*;AN000;6*/
|
||||
char far *value2; /* Time; date; or ptr to data item*/ /*;AN000;6*/
|
||||
BYTE two; /* n of %n */ /*;AN000;6*/
|
||||
BYTE flags2; /* Data Type flags */ /*;AN000;6*/
|
||||
BYTE max_width2; /* Maximum FIELD width */ /*;AN000;6*/
|
||||
BYTE min_width2; /* Minimum FIELD width */ /*;AN000;6*/
|
||||
BYTE pad_char2; /* Character for pad FIELD */ /*;AN000;6*/
|
||||
}; /*;AN000;6*/
|
||||
|
||||
/*----------------------------------*/
|
||||
/*- EXTENDED OPEN PARAMETER LIST -*/
|
||||
/*----------------------------------*/
|
||||
#define EXTATTBUFLEN 4086 /*;AN000;3*/
|
||||
struct parm_list /*;AN000;3*/
|
||||
{ /*;AN000;3*/
|
||||
DWORD ext_attr_addr; /*;AN000;3*/
|
||||
WORD num_additional; /*;AN000;3*/
|
||||
BYTE id_io_mode; /*;AN000;3*/
|
||||
WORD io_mode; /*;AN000;3*/
|
||||
}; /*;AN000;3*/
|
||||
|
||||
/* */
|
||||
/*----------------------------------------------------*/
|
||||
/*- SUBROUTINE DECLARATIONS -*/
|
||||
/*----------------------------------------------------*/
|
||||
int cdecl sprintf(char *, char *, ...);
|
||||
int cdecl printf(char *,...);
|
||||
|
||||
void alloc_buffer(void);
|
||||
void alloc_first_node(void);
|
||||
struct node * alloc_node(unsigned int);
|
||||
void check_appendX(void); /*;AN000;2*/
|
||||
void alloc_seg(void);
|
||||
void build_ext(int);
|
||||
void change_levels(void);
|
||||
void check_date(WORD,BYTE,BYTE); /*;AN000;4*/
|
||||
void check_DOS_version(void);
|
||||
void check_drive_validity(int,char * []);
|
||||
void check_for_device_names(char * []); /*;AN000;p2592*/
|
||||
void check_last_target(void);
|
||||
void check_path_validity(char * []);
|
||||
void check_time(BYTE,BYTE,BYTE,BYTE); /*;AN000;4*/
|
||||
void clean_up_and_exit(void);
|
||||
void close_file(WORD);
|
||||
void close_out_current_target(void);
|
||||
void control_break_handler(void);
|
||||
void create_target(void);
|
||||
void datetime(void);
|
||||
void delete(char *);
|
||||
void delete_files(char);
|
||||
long disk_free_space(void);
|
||||
void display_it(int,WORD,int,BYTE,BYTE); /*;AN000;6*/
|
||||
void display_msg(int);
|
||||
void do_backup(void);
|
||||
void do_copy(void);
|
||||
void do_dos_error(WORD);
|
||||
extern unsigned far pascal set_int24_vector(void); /*;AN000;*/
|
||||
void error_exit(int);
|
||||
WORD exist(char *);
|
||||
WORD extended_open(WORD,WORD,char far *,WORD); /*;AN000;5*/
|
||||
void file_sharing_error(void); /*;AN000;9*/
|
||||
char far * far_ptr(WORD,WORD);
|
||||
void findclose(WORD);
|
||||
void find_all_subdirs(void);
|
||||
void find_first(char *,WORD *,struct FileFindBuf *,WORD);
|
||||
void find_first_file(void);
|
||||
void find_format(void); /*;AN000;d178*/
|
||||
void find_next(WORD,struct FileFindBuf *);
|
||||
void find_next_file(void);
|
||||
void find_the_first(void);
|
||||
void find_the_next(void);
|
||||
void format_target(void);
|
||||
void free_seg(unsigned);
|
||||
WORD get_attribute(char *);
|
||||
void get_current_dir(WORD,char *);
|
||||
WORD get_current_drive(void);
|
||||
void get_country_info(void);
|
||||
void get_diskette(void);
|
||||
void get_drive_types(void);
|
||||
void get_extended_attributes(WORD); /*;AN000;3 */
|
||||
void get_first_target(void);
|
||||
void get_hardfile(void);
|
||||
void get_next_target(void);
|
||||
void get_path(char *); /*;AN002;*/
|
||||
WORD handle_open(char *,WORD);
|
||||
WORD handle_read(WORD,WORD,char far *);
|
||||
WORD handle_write(WORD,WORD,char far *);
|
||||
void init(void); /*;AN000;6*/
|
||||
void insert_node(char *);
|
||||
WORD ioctl(WORD);
|
||||
void label_target_drive(void);
|
||||
DWORD lseek(WORD,BYTE,DWORD);
|
||||
int main(int, char * []);
|
||||
void mark_as_last_target(void);
|
||||
void mark_as_not_last_target(void);
|
||||
void mark_files_read_only(void);
|
||||
void open_logfile(void);
|
||||
void open_source_file(void);
|
||||
void open_target(void);
|
||||
void parser(int,char * []); /*;AN000;4*/
|
||||
void parse_error(WORD,WORD); /*;AN000;4*//*;AN008;*/
|
||||
void parse_init(void); /*;AN000;4*/
|
||||
void process_switch(void); /*;AN000;4*//*;AN008;*/
|
||||
void put_disk_header(void);
|
||||
void put_new_db(void);
|
||||
void put_new_fh(void);
|
||||
void remove_last_backslash_from_BDS(void);
|
||||
void remove_node(void);
|
||||
void replace_volume_label(char *);
|
||||
void reset_archive_bit(char *);
|
||||
void restore_default_directories(void);
|
||||
void save_current_dirs(void);
|
||||
void see_if_it_should_be_backed_up(void);
|
||||
void set_attribute(char *,WORD);
|
||||
void set_vectors(void); /*;AN000;*/
|
||||
void set_default_dir(void);
|
||||
void set_default_drive(WORD);
|
||||
void setsignal(WORD,WORD);
|
||||
void show_path(void);
|
||||
char *strcat(char *,const char *); /* */
|
||||
size_t strlen(const char *); /* */
|
||||
char *strcpy(char *, const char *); /* */
|
||||
char *strncpy(char *, const char *, unsigned int); /* */
|
||||
int strncmp(const char *,const char *,unsigned int);/* */
|
||||
int strcmp(const char *,const char *); /* */
|
||||
void terminate(void);
|
||||
void update_db_entries(WORD);
|
||||
void update_fh_entries(void);
|
||||
/***** void write_extended_attributes(void); /*;AN000;3*/
|
||||
WORD write_till_target_full(WORD,WORD);
|
||||
void write_to_control_file(char far *,WORD);
|
||||
void write_to_target(WORD);
|
||||
void xlat(char *,char *); /*;AN000;*/
|
||||
|
||||
extern void sysloadmsg(union REGS *, union REGS *); /*;AN000;6*/
|
||||
extern void update_logfile(union REGS *, union REGS *); /*;AN000;9*/
|
||||
extern void sysdispmsg(union REGS *, union REGS *); /*;AN000;6*/
|
||||
extern void parse (union REGS *, union REGS *); /*;AN000;4*/
|
||||
|
||||
/*-------------------------------*/
|
||||
/*- From COMSUB.H */
|
||||
/*-------------------------------*/
|
||||
|
||||
/* convert character to uppercase */
|
||||
extern int com_toupper(
|
||||
unsigned char ); /* character to be converted to uppercase */
|
||||
|
||||
|
||||
/* search the first occurrence of a character in a string */
|
||||
extern char *com_strchr(
|
||||
unsigned char *, /* a source string */
|
||||
unsigned char ); /* a character to be searched */
|
||||
|
||||
/* search the last charater occurrence in a string */
|
||||
extern unsigned char
|
||||
*com_strrchr(
|
||||
unsigned char *, /* source string */
|
||||
unsigned char ); /* target string */
|
||||
52
v4.0/src/CMD/BACKUP/BACKUP.SKL
Normal file
52
v4.0/src/CMD/BACKUP/BACKUP.SKL
Normal file
@@ -0,0 +1,52 @@
|
||||
;==========================================================
|
||||
|
||||
:util BACKUP ;AN000;
|
||||
|
||||
;---------
|
||||
:class A
|
||||
;---------
|
||||
:use 1 COMMON1 ;AN000; ;For "Incorrect DOS version
|
||||
:def 2 CR,LF,"Insufficient memory",CR,LF ;AN000;
|
||||
:def 6 CR,LF,"Invalid drive specification",CR,LF ;AN000;
|
||||
:use 7 COMMON23 ;AN000; ;For "Invalid date
|
||||
:use 8 COMMON24 ;AN000; ;For "Invalid time
|
||||
|
||||
|
||||
:use 11 COMMON25 ;AN000; ;For "Invalid path
|
||||
|
||||
:use 12 COMMON26 ;AN000; ;For "No source drive specified
|
||||
:use 13 COMMON27 ;AN000; ;For "No target drive specified
|
||||
:def 14 CR,LF,"Source and target drives are the same",CR,LF ;AN000;
|
||||
:def 15 CR,LF,"Error executing FORMAT",CR,LF ;AN000;d178
|
||||
:def 16 CR,LF,"Cannot find FORMAT.COM",CR,LF ;AN000;d178
|
||||
:def 17 CR,LF,"Error opening logfile",CR,LF ;AN000;
|
||||
:def 18 CR,LF,"Logging to file %1",CR,LF ;AN000;
|
||||
:def 19 CR,LF,"Last backup diskette not inserted",CR,LF ;AN000;
|
||||
|
||||
:def 20 CR,LF,"Warning! Files in the target drive",CR,LF ;AN000;
|
||||
"%1:\ root directory will be erased",CR,LF ;AN000;
|
||||
|
||||
:def 21 CR,LF,"Warning! Files in the target drive",CR,LF ;AN000;
|
||||
"%1:\BACKUP directory will be erased",CR,LF ;AN000;
|
||||
|
||||
:def 22 CR,LF,"*** Backing up files to drive %1: ***",CR,LF ;AN000;
|
||||
:def 23 "Diskette Number: %1",CR,LF ;AN000;
|
||||
:def 24 CR,LF,"Warning! No files were found to back up",CR,LF ;AN000;
|
||||
:def 25 CR,LF,"Insert backup source diskette in drive %1:",CR,LF ;AN000;
|
||||
|
||||
:def 26 CR,LF,"Insert backup diskette %1 in drive %2:",CR,LF ;AN000;
|
||||
:def 27 CR,LF,"*** Not able to backup file ***",CR,LF ;AN000;
|
||||
:def 28 CR,LF,"Insert last backup diskette in drive %1:",CR,LF ;AN000;
|
||||
|
||||
:def 29 CR,LF,"Target can not be used for backup",CR,LF ;AN000;
|
||||
:def 30 CR,LF,"*** Last file not backed up ***",CR,LF ;AN000;
|
||||
:def 31 CR,LF,"Fixed backup device %1: is full",CR,LF ;AN000;
|
||||
|
||||
:def 32 CR,LF,"Disk full error writing to BACKUP Log File",CR,LF ;AN000;
|
||||
;AN000;
|
||||
:use 33 COMMON28 ;AN000; ;For "Press any key to continue . . .
|
||||
:def 34 CR,LF ;AN000;
|
||||
:def 35 CR,LF,"Cannot FORMAT nonremovable drive %1:",CR,LF ;AN000;
|
||||
|
||||
:end ;AN000;
|
||||
;==========================================================
|
||||
45
v4.0/src/CMD/BACKUP/MAKEFILE
Normal file
45
v4.0/src/CMD/BACKUP/MAKEFILE
Normal file
@@ -0,0 +1,45 @@
|
||||
#************************** makefile for cmd\backup ***************************
|
||||
|
||||
cflags = -AS -Od -Zp $(extcsw)
|
||||
msg =..\..\messages
|
||||
dos =..\..\dos
|
||||
inc =..\..\inc
|
||||
hinc =..\..\h
|
||||
map =..\..\mapper
|
||||
here =..\cmd\backup
|
||||
|
||||
#
|
||||
####################### dependencies begin here. #########################
|
||||
#
|
||||
|
||||
all: backup.com
|
||||
|
||||
$(map)\mapper.lib:
|
||||
cd $(map)
|
||||
nmake
|
||||
cd $(here)
|
||||
|
||||
_parse.obj: _parse.asm \
|
||||
$(inc)\parse.asm \
|
||||
$(inc)\psdata.inc \
|
||||
makefile
|
||||
|
||||
backup.ctl: backup.skl \
|
||||
$(msg)\$(COUNTRY).MSG
|
||||
|
||||
_msgret.obj: _msgret.asm \
|
||||
backup.ctl \
|
||||
$(inc)\msgserv.asm \
|
||||
$(inc)\sysmsg.inc \
|
||||
$(inc)\versiona.inc \
|
||||
$(inc)\copyrigh.inc \
|
||||
makefile
|
||||
|
||||
backup.obj: backup.c backpars.h backup.h makefile \
|
||||
$(hinc)\doscalls.h
|
||||
|
||||
backup.com: backup.obj _parse.obj _msgret.obj \
|
||||
$(map)\mapper.lib $(inc)\comsubs.lib
|
||||
link /NOE backup + _parse + _msgret,,,$(map)\mapper + $(inc)\comsubs;
|
||||
convert backup.exe backup.com
|
||||
del backup.exe
|
||||
268
v4.0/src/CMD/BACKUP/_MSGRET.ASM
Normal file
268
v4.0/src/CMD/BACKUP/_MSGRET.ASM
Normal file
@@ -0,0 +1,268 @@
|
||||
page 60,132
|
||||
name _msgret
|
||||
title C to Message Retriever
|
||||
;-------------------------------------------------------------------
|
||||
;
|
||||
; MODULE: _msgret
|
||||
;
|
||||
; PURPOSE: Supplies an interface between C programs and
|
||||
; the DOS 3.30 message retriever
|
||||
;
|
||||
; CALLING FORMAT:
|
||||
; sysloadmsg(&inregs,&outregs);
|
||||
; sysdispmsg(&inregs,&outregs);
|
||||
; sysgetmsg(&inregs,&outregs);
|
||||
;
|
||||
; DATE: 5-21-87
|
||||
;
|
||||
;-------------------------------------------------------------------
|
||||
|
||||
INCLUDE SYSMSG.INC ;PERMIT SYSTEM MESSAGE HANDLER DEFINITION ;AN000;
|
||||
|
||||
MSG_UTILNAME <BACKUP> ;IDENTIFY THE COMPONENT ;AN000;
|
||||
|
||||
.8087
|
||||
_TEXT SEGMENT BYTE PUBLIC 'CODE'
|
||||
_TEXT ENDS
|
||||
_DATA SEGMENT WORD PUBLIC 'DATA'
|
||||
_DATA ENDS
|
||||
CONST SEGMENT WORD PUBLIC 'CONST'
|
||||
CONST ENDS
|
||||
_BSS SEGMENT WORD PUBLIC 'BSS'
|
||||
_BSS ENDS
|
||||
DGROUP GROUP CONST, _BSS, _DATA
|
||||
ASSUME CS: _TEXT, DS: _TEXT, SS: DGROUP, ES: DGROUP
|
||||
|
||||
|
||||
public _sysloadmsg
|
||||
public _sysdispmsg
|
||||
public _update_logfile
|
||||
|
||||
;-------------------------------------------------------------------
|
||||
;-------------------------------------------------------------------
|
||||
|
||||
_DATA segment
|
||||
.XLIST
|
||||
.XCREF
|
||||
MSG_SERVICES <MSGDATA> ;DATA AREA FOR THE MESSAGE HANDLER ;AN000;
|
||||
|
||||
.LIST
|
||||
.CREF
|
||||
_DATA ends
|
||||
|
||||
|
||||
_TEXT segment
|
||||
|
||||
;-------------------------------------------------------------------
|
||||
;DEFAULT=CHECK DOS VERSION
|
||||
;DEFAULT=NEARmsg
|
||||
;DEFAULT=INPUTmsg
|
||||
;DEFAULT=NUMmsg
|
||||
;DEFAULT=NO TIMEmsg
|
||||
;DEFAULT=NO DATEmsg
|
||||
.XLIST
|
||||
.XCREF
|
||||
MSG_SERVICES <LOADmsg,DISPLAYmsg,GETmsg,INPUTmsg,CHARmsg,NUMmsg,TIMEmsg,DATEmsg,FARmsg> ;AN000;
|
||||
MSG_SERVICES <BACKUP.CTL,BACKUP.CLA,BACKUP.CL1,BACKUP.CL2> ;AN000;
|
||||
.LIST
|
||||
.CREF
|
||||
;-------------------------------------------------------------------
|
||||
|
||||
_sysloadmsg proc near
|
||||
|
||||
push bp ; save user's base pointer
|
||||
mov bp,sp ; set bp to current sp
|
||||
push di ; save some registers
|
||||
push si
|
||||
|
||||
; copy C inregs into proper registers
|
||||
|
||||
mov di,[bp+4] ; fix di (arg 0)
|
||||
|
||||
;-------------------------------------------------------------------
|
||||
|
||||
mov ax,[di+0ah] ; load di
|
||||
push ax ; the di value from inregs is now on stack
|
||||
|
||||
mov ax,[di+00] ; get inregs.x.ax
|
||||
mov bx,[di+02] ; get inregs.x.bx
|
||||
mov cx,[di+04] ; get inregs.x.cx
|
||||
mov dx,[di+06] ; get inregs.x.dx
|
||||
mov si,[di+08] ; get inregs.x.si
|
||||
pop di ; get inregs.x.di from stack
|
||||
|
||||
push bp ; save base pointer
|
||||
|
||||
;-------------------------------------------------------------------
|
||||
call sysloadmsg ; call the message retriever
|
||||
;-------------------------------------------------------------------
|
||||
|
||||
pop bp ; restore base pointer
|
||||
push di ; the di value from call is now on stack
|
||||
mov di,[bp+6] ; fix di (arg 1)
|
||||
|
||||
mov [di+00],ax ; load outregs.x.ax
|
||||
mov [di+02],bx ; load outregs.x.bx
|
||||
mov [di+04],cx ; load outregs.x.cx
|
||||
mov [di+06],dx ; load outregs.x.dx
|
||||
mov [di+08],si ; load outregs.x.si
|
||||
|
||||
lahf ; get flags into ax
|
||||
mov al,ah ; move into low byte
|
||||
mov [di+0ch],ax ; load outregs.x.cflag
|
||||
|
||||
pop ax ; get di from stack
|
||||
mov [di+0ah],ax ; load outregs.x.di
|
||||
|
||||
;-------------------------------------------------------------------
|
||||
|
||||
pop si ; restore registers
|
||||
pop di
|
||||
mov sp,bp ; restore sp
|
||||
pop bp ; restore user's bp
|
||||
ret
|
||||
|
||||
_sysloadmsg endp
|
||||
|
||||
|
||||
;============================================================================
|
||||
;============================================================================
|
||||
;============================================================================
|
||||
|
||||
|
||||
_update_logfile proc near
|
||||
|
||||
push bp ; save user's base pointer
|
||||
mov bp,sp ; set bp to current sp
|
||||
push di ; save some registers
|
||||
push si
|
||||
|
||||
mov di,[bp+4] ; fix di (arg 0)
|
||||
;-------------------------------------------------------------------
|
||||
mov ax,[di+0ah] ; load di
|
||||
push ax ; the di value from inregs is now on stack
|
||||
|
||||
mov ax,[di+00] ; get inregs.x.ax
|
||||
mov bx,[di+02] ; get inregs.x.bx
|
||||
mov cx,[di+04] ; get inregs.x.cx
|
||||
mov dx,[di+06] ; get inregs.x.dx
|
||||
mov si,[di+08] ; get inregs.x.si
|
||||
pop di ; get inregs.x.di from stack
|
||||
|
||||
push bp ; save base pointer
|
||||
;-------------------------------------------------------------------
|
||||
mov dh,-1 ; Message class, Utility message
|
||||
mov cs:handle,bx ;AN000;9 Save logfile handle
|
||||
mov cs:len,cx ;AN000;9 Save write length
|
||||
push ds ;AN000;9
|
||||
pop cs:save_ds ;AN000;9
|
||||
call sysgetmsg ; call the message retriever
|
||||
;-------------------------------------------------------------------
|
||||
pop bp ; restore base pointer
|
||||
push di ; the di value from call is now on stack
|
||||
mov di,[bp+6] ; fix di (arg 1)
|
||||
|
||||
mov [di+00],ax ; load outregs.x.ax
|
||||
mov [di+02],bx ; load outregs.x.bx
|
||||
mov [di+04],cx ; load outregs.x.cx
|
||||
mov [di+06],dx ; load outregs.x.dx
|
||||
mov [di+08],si ; load outregs.x.si
|
||||
|
||||
lahf ; get flags into ax
|
||||
mov al,ah ; move into low byte
|
||||
mov [di+0ch],ax ; load outregs.x.cflag
|
||||
|
||||
pop ax ; get di from stack
|
||||
mov [di+0ah],ax ; load outregs.x.di
|
||||
mov cs:offst,si ;AN000;9
|
||||
|
||||
pop si ; restore registers
|
||||
pop di
|
||||
mov sp,bp ; restore sp
|
||||
pop bp ; restore user's bp
|
||||
|
||||
mov ah,040h ;AN000;9 Write the message to logfile
|
||||
mov bx,cs:handle ;AN000;9
|
||||
mov cx,cs:len ;AN000;9
|
||||
mov dx,cs:offst ;AN000;9
|
||||
int 021h ;AN000;9
|
||||
push cs:save_ds ;AN000;9
|
||||
pop ds ;AN000;9
|
||||
ret
|
||||
|
||||
handle dw ? ;AN000;9
|
||||
len dw ? ;AN000;9
|
||||
offst dw ? ;AN000;9
|
||||
save_ds dw ? ;AN000;9
|
||||
_update_logfile endp
|
||||
|
||||
;============================================================================
|
||||
;============================================================================
|
||||
;============================================================================
|
||||
|
||||
|
||||
_sysdispmsg proc near
|
||||
|
||||
push bp ; save user's base pointer
|
||||
mov bp,sp ; set bp to current sp
|
||||
push di ; save some registers
|
||||
push si
|
||||
|
||||
; copy C inregs into proper registers
|
||||
|
||||
mov di,[bp+4] ; fix di (arg 0)
|
||||
;-------------------------------------------------------------------
|
||||
mov ax,[di+0ah] ; load di
|
||||
push ax ; the di value from inregs is now on stack
|
||||
|
||||
mov ax,[di+00] ; get inregs.x.ax
|
||||
mov bx,[di+02] ; get inregs.x.bx
|
||||
mov cx,[di+04] ; get inregs.x.cx
|
||||
mov dx,[di+06] ; get inregs.x.dx
|
||||
mov si,[di+08] ; get inregs.x.si
|
||||
pop di ; get inregs.x.di from stack
|
||||
|
||||
push bp ; save base pointer
|
||||
;-------------------------------------------------------------------
|
||||
call sysdispmsg ; call the message retriever
|
||||
;-------------------------------------------------------------------
|
||||
pop bp ; restore base pointer
|
||||
push di ; the di value from call is now on stack
|
||||
mov di,[bp+6] ; fix di (arg 1)
|
||||
|
||||
mov [di+00],ax ; load outregs.x.ax
|
||||
mov [di+02],bx ; load outregs.x.bx
|
||||
mov [di+04],cx ; load outregs.x.cx
|
||||
mov [di+06],dx ; load outregs.x.dx
|
||||
mov [di+08],si ; load outregs.x.si
|
||||
|
||||
lahf ; get flags into ax
|
||||
mov al,ah ; move into low byte
|
||||
mov [di+0ch],ax ; load outregs.x.cflag
|
||||
|
||||
pop ax ; get di from stack
|
||||
mov [di+0ah],ax ; load outregs.x.di
|
||||
;-------------------------------------------------------------------
|
||||
pop si ; restore registers
|
||||
pop di
|
||||
mov sp,bp ; restore sp
|
||||
pop bp ; restore user's bp
|
||||
ret
|
||||
|
||||
_sysdispmsg endp
|
||||
|
||||
;============================================================================
|
||||
;============================================================================
|
||||
;============================================================================
|
||||
|
||||
;============================================================================
|
||||
;============================================================================
|
||||
;============================================================================
|
||||
|
||||
include msgdcl.inc
|
||||
|
||||
|
||||
_TEXT ends ; end code segment
|
||||
end
|
||||
|
||||
|
||||
121
v4.0/src/CMD/BACKUP/_PARSE.ASM
Normal file
121
v4.0/src/CMD/BACKUP/_PARSE.ASM
Normal file
@@ -0,0 +1,121 @@
|
||||
page 60,132
|
||||
name _parse
|
||||
title C to PARSER interface
|
||||
;-------------------------------------------------------------------
|
||||
;
|
||||
; MODULE: _parse
|
||||
;
|
||||
; PURPOSE: Supplies an interface between C programs and
|
||||
; the DOS 3.30 parser
|
||||
;
|
||||
; CALLING FORMAT:
|
||||
; parse(&inregs,&outregs);
|
||||
;
|
||||
; DATE: 5-21-87
|
||||
;
|
||||
;-------------------------------------------------------------------
|
||||
|
||||
; extrn sysparse:far
|
||||
|
||||
public _parse
|
||||
|
||||
include version.inc
|
||||
|
||||
;-------------------------------------------------------------------
|
||||
FarSW equ 0 ; make sysparse be a NEAR proc
|
||||
TimeSW equ 1 ; Check time format
|
||||
FileSW equ 1 ; Check file specification
|
||||
CAPSW equ 1 ; Perform CAPS if specified
|
||||
CmpxSW equ 0 ; Check complex list
|
||||
NumSW equ 0 ; Check numeric value
|
||||
KeySW equ 0 ; Support keywords
|
||||
SwSW equ 1 ; Support switches
|
||||
Val1SW equ 0 ; Support value definition 1
|
||||
Val2SW equ 0 ; Support value definition 2
|
||||
if ibmcopyright
|
||||
Val3SW equ 0 ; Support value definition 3
|
||||
else
|
||||
Val3SW equ 1 ; Support value definition 3
|
||||
endif
|
||||
DrvSW equ 1 ; Support drive only format
|
||||
QusSW equ 0 ; Support quoted string format
|
||||
IncSW equ 0 ; Dont include PSDATA, I just did it
|
||||
BaseSW equ 1 ; DS points to data
|
||||
;-------------------------------------------------------------------
|
||||
|
||||
DGROUP GROUP _DATA
|
||||
PGROUP GROUP _TEXT
|
||||
|
||||
_DATA segment byte public 'DATA'
|
||||
include psdata.inc
|
||||
_DATA ends
|
||||
|
||||
_TEXT segment byte public 'CODE'
|
||||
|
||||
ASSUME CS: PGROUP
|
||||
ASSUME DS: DGROUP
|
||||
|
||||
;-------------------------------------------------------------------
|
||||
.xlist
|
||||
include parse.asm ; include the parser
|
||||
.list
|
||||
;-------------------------------------------------------------------
|
||||
|
||||
_parse proc near
|
||||
|
||||
push bp ; save user's base pointer
|
||||
mov bp,sp ; set bp to current sp
|
||||
push di ; save some registers
|
||||
push si
|
||||
|
||||
; copy C inregs into proper registers
|
||||
|
||||
mov di,[bp+4] ; fix di (arg 0)
|
||||
|
||||
;-------------------------------------------------------------------
|
||||
|
||||
mov ax,[di+0ah] ; load di
|
||||
push ax ; the di value from inregs is now on stack
|
||||
|
||||
mov ax,[di+00] ; get inregs.x.ax
|
||||
mov bx,[di+02] ; get inregs.x.bx
|
||||
mov cx,[di+04] ; get inregs.x.cx
|
||||
mov dx,[di+06] ; get inregs.x.dx
|
||||
mov si,[di+08] ; get inregs.x.si
|
||||
pop di ; get inregs.x.di from stack
|
||||
|
||||
push bp ; save base pointer
|
||||
;-------------------------------------------------------------------
|
||||
call sysparse ; call the parser
|
||||
;-------------------------------------------------------------------
|
||||
pop bp ; restore base pointer
|
||||
push di ; the di value from call is now on stack
|
||||
mov di,[bp+6] ; fix di (arg 1)
|
||||
|
||||
mov [di+00],ax ; load outregs.x.ax
|
||||
mov [di+02],bx ; load outregs.x.bx
|
||||
mov [di+04],cx ; load outregs.x.cx
|
||||
mov [di+06],dx ; load outregs.x.dx
|
||||
mov [di+08],si ; load outregs.x.si
|
||||
|
||||
lahf ; get flags into ax
|
||||
mov al,ah ; move into low byte
|
||||
mov [di+0ch],ax ; load outregs.x.cflag
|
||||
|
||||
pop ax ; get di from stack
|
||||
mov [di+0ah],ax ; load outregs.x.di
|
||||
|
||||
;-------------------------------------------------------------------
|
||||
|
||||
pop si ; restore registers
|
||||
pop di
|
||||
mov sp,bp ; restore sp
|
||||
pop bp ; restore user's bp
|
||||
ret
|
||||
|
||||
_parse endp
|
||||
|
||||
_TEXT ends ; end code segment
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user