home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 September
/
Simtel20_Sept92.cdr
/
msdos
/
catalog
/
pibcat17.arc
/
PIBCAT.GLO
< prev
next >
Wrap
Text File
|
1989-03-31
|
9KB
|
163 lines
(*----------------------------------------------------------------------*)
(* GLOBAL VARIABLE DEFINITIONS *)
(*----------------------------------------------------------------------*)
USES (* DOS but not IBM PC specific *)
Dos;
TYPE
AnyStr = STRING[255] (* Matches any string for parameter passing *);
String2 = STRING[2] (* Two character string *);
String3 = STRING[3] (* Three character string *);
String8 = STRING[8] (* Eight character string *);
(*----------------------------------------------------------------------*)
(* Error types for library files *)
(*----------------------------------------------------------------------*)
CONST
Open_Error = 1 (* Error when opening file *);
Format_Error = 2 (* Library format bad *);
End_Of_File = 3 (* End of library directory *);
Too_Many_Subs = 4 (* Too many nested subdirs *);
(*----------------------------------------------------------------------*)
(* Global program variables *)
(*----------------------------------------------------------------------*)
CONST
FF_Char : CHAR = ^L (* Form feed character *);
TYPE
Output_Buffer = ARRAY[1..8192] OF CHAR;
TYPE
Condensed_Type = ( Condensed_Columnar, Condensed_Comma );
VAR
Cat_Drive : CHAR (* Drive to catalog *);
Output_File : TEXT (* File to receive output *);
Output_File_Name : AnyStr (* Output file name *);
Output_File_Buffer : Output_Buffer (* Output file buffer *);
Status_File : TEXT (* Processing status lines *);
Status_File_Name : AnyStr (* Status file name *);
Do_Printer_Format : BOOLEAN (* Format for printer *);
Left_Margin : INTEGER (* Left margin *);
Page_Size : INTEGER (* Page size for output *);
Expand_Libs : BOOLEAN (* TRUE to expand libraries *);
Expand_Libs_In : BOOLEAN (* TRUE to expand libraries *)
(* in main catalog list *);
Left_Margin_String : AnyStr (* Blanks for left margin *);
Library_Indent : INTEGER (* Indent for libraries *);
User_Break : BOOLEAN (* TRUE if ^C stops liting *);
Find_Spec : AnyStr (* File spec for listing *);
Entry_Spec : AnyStr (* Entry spec for listing *);
Entry_Name : AnyStr (* Name portion, entry spec *);
Entry_Ext : AnyStr (* Extension, entry spec *);
Use_Entry_Spec : BOOLEAN (* TRUE to use entry spec *);
Total_Files : LONGINT (* Total files found *);
Total_Space : LONGINT (* Total space used *);
Total_Entries : LONGINT (* Total entries found *);
Total_ESpace : LONGINT (* Total space used, entries*);
Total_Dirs : LONGINT (* Total dirs scanned *);
Page_Number : INTEGER (* Current page number *);
Lines_Left : INTEGER (* Lines left on cur. page *);
Help_Only : BOOLEAN (* TRUE if doing help only *);
Read_Open_Mode : BYTE (* Open mode for reads *);
Write_Open_Mode : BYTE (* Open mode for writes *);
Show_Long_File_Names : BOOLEAN (* Show long file names *);
Use_Share : BOOLEAN (* TRUE to use SHARE *);
GMT_Difference : LONGINT (* # hours local time *);
(* leads/lags GMT *)
Use_Daylight_Savings : BOOLEAN (* TRUE to adjust times for *);
(* daylight savings in .DWC *)
Do_Condensed_Listing : BOOLEAN (* TRUE to produce condensed*);
(* format listing. *)
Condensed_Listing_Type: Condensed_Type (* Type of condensed listing*);
Volume_Label : AnyStr (* Disk volume label *);
Condensed_Output_Line : AnyStr (* Condensed output line *);
Do_Blank_Line : BOOLEAN (* TRUE to print blank line *);
Current_Subdirectory : AnyStr (* Current subdirectory *);
Open_For_Append : BOOLEAN (* Open output for append *);
(*----------------------------------------------------------------------*)
(* Titles and subtitles for paginated listings *)
(*----------------------------------------------------------------------*)
VAR
Volume_Title : AnyStr (* Main title for entire listing *);
Subdir_Title : AnyStr (* Current subdirectory title *);
File_Title : AnyStr (* Current library file if any *);
(*----------------------------------------------------------------------*)
(* Saved file names from nested directories *)
(*----------------------------------------------------------------------*)
CONST
MaxFiles = 2047 (* Max files in one segment *);
MaxSeg = 360 (* Maximum # segments *);
SegShift = 11 (* 2 ** 11 = 2048 *);
TYPE
Short_Dir_Record = RECORD
File_Attr : BYTE (* File attributes *);
File_Time : LONGINT (* Creation time *);
File_Size : LONGINT (* Size in bytes *);
File_Name : STRING[12] (* File name *);
END;
File_Stack_Type = ARRAY[0..MaxFiles] OF Short_Dir_Record;
File_Stack_Ptr = ^File_Stack_Type;
VAR
(* List of files in current and all *)
(* previous directories along path *)
(* back to root directory. *)
(* *)
(* Since Turbo Pascal doesn't allow *)
(* arrays to exceed 64K bytes in *)
(* size, we will use a vector of *)
(* pointers to simulate a long *)
(* vector. The size of each segment *)
(* is chosen to be a power of 2 so *)
(* that subscripts can be expressed *)
(* using simple masking operations. *)
File_Stack : ARRAY[ 0 .. MaxSeg ] OF File_Stack_Ptr;
Stack_Alloc : INTEGER (* # of stack entries allocated *);
File_Count : WORD (* # of files currently saved *);
(*----------------------------------------------------------------------*)
(* Names of the months and days in each month for date conversions *)
(*----------------------------------------------------------------------*)
(* STRUCTURED *) CONST
Month_Names : ARRAY[1..12] OF STRING[3] =
('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' );
(* STRUCTURED *) CONST
Days_Per_Month : ARRAY[1..12] OF BYTE
= ( 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 );
(*----------------------------------------------------------------------*)
(* Starting/ending dates for daylight savings time from 1980 to now *)
(*----------------------------------------------------------------------*)
TYPE
Daylight_Savings_Record = RECORD
Starting_Time : LONGINT;
Ending_Time : LONGINT;
END;
VAR
Daylight_Savings_Time : ARRAY[1980..2000] OF Daylight_Savings_Record;