summaryrefslogtreecommitdiff
path: root/v4.0/src/CMD/JOIN
diff options
context:
space:
mode:
authorGravatar Mark Zbikowski2024-04-25 21:24:10 +0100
committerGravatar Microsoft Open Source2024-04-25 22:32:27 +0000
commit2d04cacc5322951f187bb17e017c12920ac8ebe2 (patch)
tree80ee017efa878dfd5344b44249e6a241f2a7f6e2 /v4.0/src/CMD/JOIN
parentMerge pull request #430 from jpbaltazar/typoptbr (diff)
downloadms-dos-main.tar.gz
ms-dos-main.tar.xz
ms-dos-main.zip
MZ is back!HEADmain
Diffstat (limited to 'v4.0/src/CMD/JOIN')
-rw-r--r--v4.0/src/CMD/JOIN/JOIN.C669
-rw-r--r--v4.0/src/CMD/JOIN/JOIN.LNK12
-rw-r--r--v4.0/src/CMD/JOIN/JOIN.SKL22
-rw-r--r--v4.0/src/CMD/JOIN/JOINPARS.H156
-rw-r--r--v4.0/src/CMD/JOIN/MAKEFILE81
-rw-r--r--v4.0/src/CMD/JOIN/_MSGRET.ASM250
-rw-r--r--v4.0/src/CMD/JOIN/_PARSE.ASM121
7 files changed, 1311 insertions, 0 deletions
diff --git a/v4.0/src/CMD/JOIN/JOIN.C b/v4.0/src/CMD/JOIN/JOIN.C
new file mode 100644
index 0000000..b0e13d8
--- /dev/null
+++ b/v4.0/src/CMD/JOIN/JOIN.C
@@ -0,0 +1,669 @@
1/*  */
2/**************************************************************************/
3/* */
4/* UTILITY NAME: Join */
5/* */
6/* SOURCE FILE NAME: Join.C */
7/* */
8/* STATUS: Join Utility, DOS Version 4.0 */
9/* */
10/* FUNCTIONAL DESCRIPTION: This utility allows the splicing of a */
11/* physical drive to a pathname on another physical drive such that */
12/* operations performed using the pathname as an argument take place */
13/* on the physical drive. */
14/* */
15/* SYNTAX: [d:][path]JOIN or */
16/* [d:][path]JOIN d: d:\directory or */
17/* [d:][path]JOIN d: /D */
18/* where: */
19/* [d:][path] to specify the drive and path that */
20/* contains the JOIN command file, if it is not */
21/* in the current directory of the default drive. */
22/* */
23/* d: to specify the drive to be connected to a */
24/* directory on another drive. */
25/* */
26/* d:\directory to specify the directory that */
27/* you will join a drive under. The directory */
28/* must be at the root and only one level deep. */
29/* */
30/* /D to disconnect a join. You must specify the */
31/* drive letter of the drive whose join you */
32/* want to delete. */
33/* */
34/* LINKS: */
35/* CDS.C - Functions to get/set DOS CDS structures */
36/* DPB.C - Functions to get DOS DPB structures */
37/* ERRTST.C - Drive and path validity testing functions */
38/* SYSVAR.C - Functions to get/set DOS System Variable structures */
39/* COMSUBS.LIB - DOS DBCS function calls */
40/* MAPPER.LIB - DOS function calls */
41/* SLIBC3.LIB - C library functions */
42/* _MSGRET.SAL - Assembler interface for common DOS message services */
43/* _PARSE.SAL - Assembler interface for common DOS parser */
44/* */
45/* ERROR HANDLING: Error message displayed and utility is terminated. */
46/* */
47/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
48/* */
49/* MODIFICATIONS: */
50/* */
51/* Converted to CMERGE 03/26/85 by GregT */
52/* */
53/* M000 May 23/85 Barrys */
54/* Disallow splicing similar drives. */
55/* */
56/* M001 May 24/85 Barrys */
57/* The original IBM version of JOIN allowed the delete splice switch */
58/* "/D" immediately after the drive specification. The argument parsing */
59/* code has been Revised to allow this combination. */
60/* */
61/* M002 June 5/85 Barrys */
62/* Changed low version check for specific 320. */
63/* */
64/* M003 July 15/85 Barrys */
65/* Checked for any possible switch characters in the other operands. */
66/* */
67/* M004 July 15/85 Barrys */
68/* Moved check for physical drive before check for NET and SHARED tests. */
69/* */
70/* 33D0016 July 16/86 RosemarieG */
71/* Put SHARED test on an equal basis with physical drive check. */
72/* Last fix (M004) erroneously allowed joining physical or local shared */
73/* drives. This is because it only performed the SHARED test if the */
74/* drive failed the physical test. */
75/* */
76/* May /87 SusanM */
77/* Deletion of source code dealing with parsing and displaying messages */
78/* and addition of SYSLOADMSG, SYSDISPMSG, SYSPARSE in order to conform */
79/* to DOS Version 4.0 specifications to utilize common DOS parser and */
80/* message service routines. */
81/* */
82/* AC000: Changed code for DOS Version 4.0 S.M 5/87 */
83/* */
84/* AN000: New code for DOS Version 4.0 S.M 5/87 */
85/* AN000;M = message services */
86/* AN000;P = parser service */
87/* */
88/* Ax001: Changed code req'd - PTM0003919 S.M 3/88 */
89/* Incorrect message response */
90/* */
91/* Ax002: Changed code req'd - PTM0004046 S.M 3/88 */
92/* Incomplete message response */
93/* */
94/**************************************************************************/
95
96#include "cds.h"
97#include "ctype.h"
98#include "dos.h"
99#include "joinpars.h" /* ;AN000;P Parser structures */
100#include "jointype.h"
101#include "stdio.h"
102#include "sysvar.h"
103
104/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ PARSE EQUATES ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/
105#define ASCII_DRIVE 'A'-1 /* ;AN000;P Convert to Ascii drive */
106#define CAPRESULT 0x0001 /* ;AN000;P Cap result by file table */
107#define DRVONLY_OPT 0x0101 /* ;AN000;P Drive only & optional */
108#define ERRORLEVEL1 1 /* ;AN000;P Parsing error occurred */
109#define FILESPEC_OPT 0x0201 /* ;AN000;P File spec & optional */
110#define MAXPOSITION 2 /* ;AN000;P Max positionals in cmdline */
111#define MINPOSITION 0 /* ;AN000;P Min positionals in cmdline */
112#define NOCAPPING 0x0000 /* ;AN000;P Do not cap result */
113#define SWITCH_OPT 0x0000 /* ;AN000;P Optional switch */
114
115/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ MESSAGE EQUATES ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/
116#define MSG_NOMEM 1 /* ;AN000;M Insufficient memory */
117#define MSG_PARMNUM 2 /* ;AN000;M Too many parameters */
118#define MSG_DIRNEMP 3 /* ;AN000;M Directory not empty */
119#define MSG_BADPARM 4 /* ;AN000;M Invalid parameter */
120#define MSG_NETERR 5 /* ;AN000;M Cannot %1 a network drive */
121#define MSG_INVSWTCH 6 /* ;AN000;M Invalid switch */
122
123#define BLNK ' ' /* ;AN000;M For sublist.pad_char */
124#define CARRY 0x0001 /* ;AN000;M Check carry flag */
125#define D_SWITCH "/D" /* ;AN000;M Only 1 switch */
126#define EXT_ERR_CLASS 0x01 /* ;AN000;M DOS Extended error class */
127#define FALSE 0
128#define MAX 256
129#define MAXWIDTH 0 /* ;AN000;M 0 ensures no padding */
130#define MINWIDTH 1 /* ;AN000;M At least 1 char in parm */
131#define NO_HANDLE 0xffff /* ;AN000;M No handle specified */
132#define NO_INPUT 0x00 /* ;AN000;M No input characters */
133#define NO_REPLACE 0x00 /* ;AN000;M No replacable parameters */
134#define NULL 0
135#define PARSE_ERR_CLASS 0x02 /* ;AN000;M Parse error class */
136#define RESERVED 0 /* ;AN000;M Reserved byte field */
137#define STDERR 0x0002 /* ;AN000;M Standard error device handle */
138#define STDOUT 0x0001 /* ;AN000;M Std output device handle */
139#define STR_INPUT 16 /* ;AN000;M Byte def for sublist.flags */
140#define SUB_ID1 1 /* ;AN000;M Only 1 replaceable parameter */
141#define SUBCNT0 0 /* ;AN000;M 0 substitutions in message */
142#define SUBCNT1 1 /* ;AN000;M 1 substitution in message */
143#define SUBLIST_LENGTH 11 /* ;AN000;M Length of sublist structure */
144#define UTILITY_CLASS 0x0ff /* ;AN000;M Utility message class */
145
146/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ MISCELLANEOUS ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/
147extern char *strchr() ; /* M003 */
148extern char *strbscan() ; /* SM extern'd */
149
150char cmdln_drive[64] = {0} ; /* ;AN002; Save user's input in */
151char cmdln_flspec[64] = {0} ; /* ;AN002; order to pass to error */
152char cmdln_invalid[64] = {0} ; /* ;AN002; */
153char cmdln_switch[64] = {0} ; /* ;AN002; message, if needed */
154char fix_es_reg[1] ; /* ;AN000;P Corrects es reg after type-"far" */
155char p_drive[3] = {0} ; /* ;AN000;P Recvs drive ltr from parser */
156char p_filespec[64] = {0} ; /* ;AN000;P Recvs filespec from parser */
157char replparm_JOIN[] = "JOIN" ; /* ;AN000;P Cannot JOIN a network drv */
158
159unsigned char source[MAX] = {0} ; /* ;AN000;P buffer for string manipulation */
160
161struct sysVarsType SysVars ;
162
163/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ PARSE STRUCTURES ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/
164struct p_parms p_p ; /* ;AN000;P # of extras & pts to descrptn */
165struct p_parmsx p_px ; /* ;AN000;P min/max parms & pts to controls */
166struct p_control_blk p_con1 ; /* ;AN000;P 1st posit parm in cmd str */
167struct p_control_blk p_con2 ; /* ;AN000;P 2nd posit parm in cmd str */
168struct p_switch_blk p_swi1 ; /* ;AN000;P /D switch in cmd str */
169struct p_result_blk rslt1 ; /* ;AN000;P Result blk rtrnd from parser */
170struct p_fresult_blk rslt2 ; /* ;AN000;P Result blk rtrnd from parser */
171struct p_result_blk rslt3 ; /* ;AN000;P Result blk rtrnd from parser */
172struct noval novals = {0} ; /* ;AN000;P Value list not used */
173
174union REGS inregs, outregs ; /* ;AN000;P Define register variables */
175
176/**************************************************************************/
177/* */
178/* SUBROUTINE NAME: main (program entry point) */
179/* */
180/* SUBROUTINE FUNCTION: Preload message file */
181/* Get the command line parameters */
182/* Parse the command line by calling SYSPARSEC */
183/* Verify the correctness of the parameters */
184/* Check for splice deletion switch */
185/* Determine if directory not empty */
186/* Check source and destination drives not same */
187/* Determine if network or shared drive */
188/* Determine if currently spliced */
189/* Determine if existing dir or can't mkdir */
190/* Print messages by calling SYSDISPMSG */
191/* */
192/* EXTERNAL ROUTINES: SYSLOADMSG */
193/* SYSDISPMSG */
194/* SYSPARSE */
195/* */
196/* INTERNAL ROUTINES: DoList Parser_Prep */
197/* Load_Msg dispmsg_terminate */
198/* Display_Msg */
199/* */
200/**************************************************************************/
201
202main(c, v)
203int c ;
204char *v[] ;
205{
206 struct findType findbuf ;
207 struct CDSType CDS ;
208
209 char path [MAXPATHLEN],*p ;
210 char far * fptr ; /* ;AN000;P Pointer to parser's buffer */
211
212 int delflag = FALSE ; /* M001 delete splice flag */
213 int dstdrv ; /* M000 dest. drive number */
214 int fchar = 0 ; /* ;AN000;P Parser filespec chars */
215 int i ;
216 int index ; /* ;AN000;P Used in creating cmdline string */
217 int more_toparse = TRUE ; /* ;AN000;P While parsing cmdline */
218 int pdrive_flg = FALSE ; /* ;AN000;P Is there a drive letter? */
219 int pflspec_flg = FALSE ; /* ;AN000;P Is there a filespec? */
220
221/************************ BEGIN ***********************************************/
222
223 load_msg() ; /* ;AN000;M Point to msgs & chks DOS ver */
224
225 for (index = 1; index <= c; index++) /* ;AN000;P Loop through end of cmd line */
226 { /* ;AN000;P */
227 strcat(source,v[index]) ; /* ;AN000;P Add the argument */
228 strcat(source," ") ; /* ;AN000;P Separate with a space */
229 } /* ;AN000;P */
230 Parser_Prep(source) ; /* ;AN000;P Initialization for the parser */
231
232 while (more_toparse) /* ;AN000;P test the flag */
233 { /* ;AN000;P */
234 index = 0 ; /* ;AN002; Init array index */
235 parse(&inregs,&outregs) ; /* ;AN000;P call the parser */
236 if (outregs.x.ax == P_No_Error) /* ;AN000;P if no error */
237 { /* ;AN000;P */
238 if (outregs.x.dx == (unsigned short)&rslt1) /* ;AN000;P if result is drv ltr */
239 { /* ;AN000;P */
240 p_drive[0] = *(rslt1.p_result_buff) ; /* ;AN000;P save the drive letter */
241 p_drive[0] += (char)ASCII_DRIVE ; /* ;AN000;P */
242 p_drive[1] = COLON ; /* ;AN000;P */
243 pdrive_flg = TRUE ; /* ;AN000;P and set the flag */
244 for (inregs.x.si ; inregs.x.si < outregs.x.si ; inregs.x.si++) /* ;AN002; Copy whatever */
245 { /* ;AN002; parser just parsed */
246 cmdln_drive[index] = *(char *)inregs.x.si ; /* ;AN002; */
247 index++ ; /* ;AN002; */
248 } /* ;AN002; */
249 } /* ;AN000;P */
250 else /* ;AN000;P */
251 if (outregs.x.dx == (unsigned short)&rslt2) /* ;AN000;P if result is filespec */
252 { /* ;AN000;P */
253 for (fptr = rslt2.fp_result_buff; (char)*fptr != NULL; fptr++) /* ;AN000;P Point to parser's buffer */
254 { /* ;AN000;P */
255 p_filespec[fchar] = (char)*fptr ; /* ;AN000;P Copy char */
256 fchar++ ; /* ;AN000;P */
257 } /* ;AN000;P */
258 strcpy(fix_es_reg,NULL) ; /* ;AN000;P (Set es reg correct) */
259 pflspec_flg = TRUE ; /* ;AN000;P and set the flag */
260 for (inregs.x.si ; inregs.x.si < outregs.x.si ; inregs.x.si++) /* ;AN002; Copy whatever */
261 { /* ;AN002; parser just parsed */
262 cmdln_flspec[index] = *(char *)inregs.x.si ; /* ;AN002; */
263 index++ ; /* ;AN002; */
264 } /* ;AN002; */
265 } /* ;AN000;P */
266 else /* ;AN000;P */
267 { /* ;AN000;P */
268 for (inregs.x.si ; inregs.x.si < outregs.x.si ; inregs.x.si++) /* ;AN002; Copy whatever */
269 { /* ;AN002; parser just parsed */
270 cmdln_switch[index] = *(char *)inregs.x.si ; /* ;AN002; */
271 index++ ; /* ;AN002; */
272 } /* ;AN002; */
273 if (!delflag) /* ;AN000;P Check for dup switch */
274 delflag = TRUE ; /* ;AN000;P it's /D switch */
275 else /* ;AN000;P else it's a dup switch */
276 dispmsg_terminate(MSG_INVSWTCH,cmdln_switch) ; /* ;AN000;P display msg & end */
277 } /* ;AN000;P */
278 } /* ;AN000;P */
279 else /* ;AN000;P */
280 if (outregs.x.ax != P_RC_EOL) /* ;AN000;P there must be an error */
281 { /* ;AN000;P */
282 for (inregs.x.si ; inregs.x.si < outregs.x.si ; inregs.x.si++) /* ;AN002; Copy whatever */
283 { /* ;AN002; parser just parsed */
284 cmdln_invalid[index] = *(char *)inregs.x.si ; /* ;AN002; */
285 index++ ; /* ;AN002; */
286 } /* ;AN002; */
287 switch (outregs.x.ax) /* ;AN000;P See what error the */
288 { /* ;AN000;P parser may have found */
289 case P_Too_Many : dispmsg_terminate(MSG_PARMNUM,cmdln_invalid) ; /* ;AN002; Too many parameters */
290 break ; /* ;AN000;P more_toparse = FALSE */
291 case P_Not_In_SW : dispmsg_terminate(MSG_INVSWTCH,cmdln_invalid) ;/* ;AN002; Invalid switch */
292 break ; /* ;AN000;P more_toparse = FALSE */
293 case P_Op_Missing : /* ;AN000;P Required operand missing */
294 case P_Not_In_Key : /* ;AN000;P Not in kywrd list provided */
295 case P_Out_Of_Range : /* ;AN000;P Out of range specified */
296 case P_Not_In_Val : /* ;AN000;P Not in val list provided */
297 case P_Not_In_Str : /* ;AN000;P Not in strg list provided */
298 case P_Syntax : dispmsg_terminate(MSG_BADPARM,cmdln_invalid) ; /* ;AN000;P incorrect syntax */
299 break ; /* ;AN000;P more_toparse = FALSE */
300 default : dispmsg_terminate(MSG_BADPARM,cmdln_invalid) ; /* ;AN000;P */
301 break ; /* ;AN000;P more_toparse = FALSE */
302 } /* ;AN000;P */
303 } /* ;AN000;P */
304 else /* ;AN000;P */
305 more_toparse = FALSE ; /* ;AN000;P End of the cmdline */
306 inregs.x.cx = outregs.x.cx ; /* ;AN000;P Move the count */
307 inregs.x.si = outregs.x.si ; /* ;AN000;P Move the pointer */
308 } /* ;AN000;P */
309
310 if (pdrive_flg && !(pflspec_flg || delflag)) /* ;AN000;P drive & no flspec or delete ? */
311 dispmsg_terminate(MSG_BADPARM,cmdln_drive) ; /* ;AN000;P display error msg & exit utility */
312
313 if (pflspec_flg && !pdrive_flg) /* ;AN000;P filespec & no drive ? */
314 dispmsg_terminate(MSG_BADPARM,cmdln_flspec) ; /* ;AN000;P display error msg & exit utility */
315
316 if (delflag && !pdrive_flg) /* ;AN000;P delete & no drive ? */
317 dispmsg_terminate(MSG_BADPARM,cmdln_switch) ; /* ;AN000;P display error msg & exit utility */
318
319 if (pdrive_flg && pflspec_flg && delflag) /* ;AN000;P drive, filespec & /D ? */
320 dispmsg_terminate(MSG_PARMNUM,cmdln_switch) ; /* ;AN000;P display error msg & exit utility */
321
322 GetVars(&SysVars) ; /* Access to DOS data structures */
323 strcpy(fix_es_reg,NULL) ; /* ;AN000;P (Set es reg correct) */
324
325 if (c == 1)
326 DoList() ; /* list splices */
327 else
328 {
329 i = p_drive[0] - 'A' ; /* ;AC000;P Convert to drv # */
330 if (!fGetCDS(i, &CDS))
331 dispmsg_terminate(MSG_BADPARM,cmdln_drive) ; /* ;AC000;M display error msg & exit utility */
332
333 strcpy(fix_es_reg,NULL) ; /* ;AN000;P (Set es reg correct) */
334 if (delflag == TRUE) /* Deassigning perhaps? */
335 {
336 if (!TESTFLAG(CDS.flags, CDSSPLICE))
337 dispmsg_terminate(MSG_BADPARM,cmdln_switch) ; /* ;AC000;M If NOT spliced */
338
339 if (fPathErr(CDS.text))
340 dispmsg_terminate(MSG_BADPARM,cmdln_drive) ; /* ;AC000;M If prefix of curdir */
341
342 CDS.text[0] = i + 'A' ;
343 CDS.text[1] = ':' ;
344 CDS.text[2] = '\\' ;
345 CDS.text[3] = 0 ;
346 CDS.cbEnd = 2 ;
347
348 if (i >= SysVars.cDrv)
349 CDS.flags = FALSE ;
350 else
351 CDS.flags = CDSINUSE ;
352 GetVars(&SysVars) ;
353 strcpy(fix_es_reg,NULL) ; /* ;AN000;P (Set es reg correct) */
354 SysVars.fSplice-- ;
355 PutVars(&SysVars) ;
356 strcpy(fix_es_reg,NULL) ; /* ;AN000;P (Set es reg correct) */
357 fPutCDS(i, &CDS) ;
358 strcpy(fix_es_reg,NULL) ; /* ;AN000;P (Set es reg correct) */
359 }
360 else
361 {
362 if (TESTFLAG(CDS.flags,CDSSPLICE))
363 dispmsg_terminate(MSG_BADPARM,cmdln_drive) ; /* ;AC000; If now spliced */
364
365 rootpath(p_filespec,path) ; /* Get root path */
366
367 if (i == getdrv() || /* M004 Start */ /* Can't mov curdrv */
368 !fPhysical(i) || /* ;AC000; */
369 fShared(i)) /* 33D0016 RG */
370 { /* Determine if it was a NET error */
371 if (fNet(i) || fShared(i))
372 dispmsg_terminate(MSG_NETERR) ; /* ;AC000;M display error msg & exit utility */
373 dispmsg_terminate(MSG_BADPARM,cmdln_drive) ; /* ;AC000;M display error msg & exit utility */
374 }
375
376 strcpy(fix_es_reg,NULL) ; /* ;AN000;P (Set es reg correct) */
377 if (fPathErr(path) || *strbscan(path+3, "/\\") != 0) /* or curdir prefix */
378 dispmsg_terminate(MSG_BADPARM,cmdln_flspec) ; /* ;AC000; */
379
380 strcpy(fix_es_reg,NULL) ; /* ;AN000;P (Set es reg correct) */
381 if (fNet(path[0] - 'A') || fShared(path[0] - 'A'))
382 dispmsg_terminate(MSG_NETERR) ; /* ;AC000;M display error msg & exit utility */
383
384 strcpy(fix_es_reg,NULL) ; /* ;AN000;P (Set es reg correct) */
385 dstdrv = *path - 'A' ; /* M000 Check src and dst drvs ar not same */
386 if (i == dstdrv) /* M000 */
387 dispmsg_terminate (MSG_BADPARM,cmdln_flspec) ; /* M000 */ /* ;AC000; */
388 if (mkdir(path) == -1) /* If can't mkdir or if no dir or */
389 { /* if note is file */
390 if (ffirst(path, A_D, &findbuf) == -1 ||
391 !TESTFLAG(findbuf.attr,A_D))
392 dispmsg_terminate(MSG_BADPARM,cmdln_flspec) ; /* ;AC000;M display error msg & exit utility */
393
394 p = path + strlen(path) ;
395 strcat(p, "\\*.*") ;
396
397 if (ffirst(path, 0, &findbuf) != -1)
398 dispmsg_terminate(MSG_DIRNEMP,cmdln_flspec) ; /* ;AC001;M If dir not empty */
399
400 *p = 0 ;
401 }
402
403 strcpy(CDS.text, path) ;
404 CDS.flags = CDSINUSE | CDSSPLICE ;
405 fPutCDS(i, &CDS) ;
406 strcpy(fix_es_reg,NULL) ; /* ;AN000;P (Set es reg correct) */
407 GetVars(&SysVars) ;
408 strcpy(fix_es_reg,NULL) ; /* ;AN000;P (Set es reg correct) */
409 SysVars.fSplice++ ;
410 PutVars(&SysVars) ;
411 strcpy(fix_es_reg,NULL) ; /* ;AN000;P (Set es reg correct) */
412 }
413 }
414 exit(0) ;
415}
416/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/
417
418DoList() /* Print list of cur joins */
419{
420 int i ;
421 struct CDSType CDS ;
422
423 for (i=0 ; fGetCDS(i, &CDS) ; i++)
424 {
425 if (TESTFLAG(CDS.flags,CDSSPLICE))
426 printf("%c: => %s\n", i+'A', CDS.text) ;
427 }
428 return ;
429}
430/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/
431/**************************************************************************/
432/* */
433/* SUBROUTINE NAME: load_msg */
434/* */
435/* SUBROUTINE FUNCTION: Load the set of SUBST Utility messages to */
436/* become available for display_msg call. */
437/* */
438/* ERROR EXIT: Utility will be terminated by sysloadmsg if */
439/* version check is incorrect. */
440/* */
441/* EXTERNAL REF: SYSLOADMSG */
442/* */
443/**************************************************************************/
444
445load_msg() /* ;AN000;M */
446{ /* ;AN000;M */
447 sysloadmsg(&inregs,&outregs) ; /* ;AN000;M Load utility messages */
448 if (outregs.x.cflag & CARRY) /* ;AN000;M If problem loading msgs */
449 { /* ;AN000;M */
450 sysdispmsg(&outregs,&outregs) ; /* ;AN000;M then display the err msg */
451 exit(ERRORLEVEL1) ; /* ;AN000;M and exit utility */
452 } /* ;AN000;M */
453 return ; /* ;AN000;M */
454} /* ;AN000;M */
455/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/
456/**************************************************************************/
457/* */
458/* SUBROUTINE NAME: display_msg */
459/* */
460/* SUBROUTINE FUNCTION: The correct message called by main is displayed */
461/* to standard out. */
462/* */
463/* INPUT: msg_num (message number to display) */
464/* outline (substitution parameter) */
465/* */
466/* OUTPUT: none */
467/* */
468/* ERROR EXIT: Display error message corresponding to number */
469/* returned in AX. */
470/* */
471/* EXTERNAL REF: SYSDISPMSG */
472/* */
473/**************************************************************************/
474
475display_msg(msg_num,outline) /* ;AN000;M */
476int msg_num ; /* ;AN000;M Message number #define'd */
477char *outline ; /* ;AN000;M Substitution parameter */
478{ /* ;AN000;M */
479 unsigned char function ; /* ;AN000;M Y/N response or press key? */
480 unsigned int message, /* ;AN000;M Message number to display */
481 msg_class, /* ;AN000;M Which class of messages? */
482 sub_cnt, /* ;AN000;M Number of substitutions? */
483 handle ; /* ;AN000;M Display where? */
484
485 struct sublist /* ;AN000;M */
486 { /* ;AN000;M */
487 unsigned char size ; /* ;AN000;M Points to next sublist */
488 unsigned char reserved ; /* ;AN000;M Required for disp msg */
489 unsigned far *value ; /* ;AN000;M Data pointer */
490 unsigned char id ; /* ;AN000;M Id of substitution parm (%1) */
491 unsigned char flags ; /* ;AN000;M Format of data - (a0sstttt) */
492 unsigned char max_width ; /* ;AN000;M Maximum field width */
493 unsigned char min_width ; /* ;AN000;M Minimum field width */
494 unsigned char pad_char ; /* ;AN000;M char to pad field */
495 } sublist ; /* ;AN000;M */
496
497 switch (msg_num) /* ;AN000;M Which msg to display? */
498 { /* ;AN000;M */
499 case MSG_NOMEM : function = NO_INPUT ; /* ;AN000;M Y/N response or press key? */
500 message = 8 ; /* ;AN000;M Message number to display */
501 msg_class = EXT_ERR_CLASS ; /* ;AN000;M Which class of messages? */
502 sub_cnt = SUBCNT0 ; /* ;AN000;M Number of substitutions? */
503 handle = STDERR ; /* ;AN000;M Display where? */
504 break ; /* ;AN000;M */
505 case MSG_PARMNUM : function = NO_INPUT ; /* ;AN000;M Y/N response or press key? */
506 message = 1 ; /* ;AN000;M Message number to display */
507 msg_class = PARSE_ERR_CLASS ; /* ;AN000;M Which class of messages? */
508 sub_cnt = SUBCNT1 ; /* ;AN000;M Number of substitutions? */
509 handle = STDERR ; /* ;AN000;M Display where? */
510 break ; /* ;AN000;M */
511 case MSG_DIRNEMP : function = NO_INPUT ; /* ;AN000;M Y/N response or press key? */
512 message = 2 ; /* ;AN000;M Message number to display */
513 msg_class = UTILITY_CLASS ; /* ;AN000;M Which class of messages? */
514 sub_cnt = SUBCNT1 ; /* ;AN000;M Number of substitutions? */
515 handle = STDERR ; /* ;AN000;M Display where? */
516 break ; /* ;AN000;M */
517 case MSG_BADPARM : function = NO_INPUT ; /* ;AN000;M Y/N response or press key? */
518 message = 10 ; /* ;AN000;M Message number to display */
519 msg_class = PARSE_ERR_CLASS ; /* ;AN000;M Which class of messages? */
520 sub_cnt = SUBCNT1 ; /* ;AN000;M Number of substitutions? */
521 handle = STDERR ; /* ;AN000;M Display where? */
522 break ; /* ;AN000;M */
523 case MSG_NETERR : function = NO_INPUT ; /* ;AN000;M Y/N response or press key? */
524 message = 12 ; /* ;AN000;M Message number to display */
525 msg_class = UTILITY_CLASS ; /* ;AN000;M Which class of messages? */
526 sub_cnt = SUBCNT1 ; /* ;AN000;M Number of substitutions? */
527 handle = STDERR ; /* ;AN000;M Display where? */
528 break ; /* ;AN000;M */
529 case MSG_INVSWTCH: function = NO_INPUT ; /* ;AN000;M Y/N response or press key? */
530 message = 3 ; /* ;AN000;M Message number to display */
531 msg_class = PARSE_ERR_CLASS ; /* ;AN000;M Which class of messages? */
532 sub_cnt = SUBCNT1 ; /* ;AN000;M Number of substitutions? */
533 handle = STDERR ; /* ;AN000;M Display where? */
534 break ; /* ;AN000;M */
535 default : exit(ERRORLEVEL1) ; /* ;AN000;M */
536 break ; /* ;AN000;M */
537 } /* ;AN000;M */
538
539 switch (msg_num) /* ;AN000;M */
540 { /* ;AN000;M */
541 case MSG_NOMEM : inregs.x.ax = message ; /* ;AN000;M Insufficient memory */
542 inregs.x.bx = handle ; /* ;AN000;M STDERR */
543 inregs.x.cx = sub_cnt ; /* ;AN000;M SUBCNT0 */
544 inregs.h.dl = function ; /* ;AN000;M NO_INPUT */
545 inregs.h.dh = msg_class ; /* ;AN000;M Extended, Parse or Utility */
546 sysdispmsg(&inregs,&outregs) ; /* ;AN000;M Call common msg service */
547 break ; /* ;AN000;M */
548 case MSG_INVSWTCH: /* ;AN000;M Invalid switch */
549 case MSG_DIRNEMP : /* ;AN000;M Directory not empty */
550 case MSG_PARMNUM : /* ;AN000;M Too many parameters */
551 case MSG_BADPARM : sublist.value = (unsigned far *)outline ; /* ;AN000;M Invalid parameter */
552 sublist.size = SUBLIST_LENGTH ; /* ;AN000;M */
553 sublist.reserved = RESERVED ; /* ;AN000;M */
554 sublist.id = 0 ; /* ;AN000;M */
555 sublist.flags = STR_INPUT ; /* ;AN000;M */
556 sublist.max_width = MAXWIDTH ; /* ;AN000;M */
557 sublist.min_width = MINWIDTH ; /* ;AN000;M */
558 sublist.pad_char = (unsigned char)BLNK ; /* ;AN000;M */
559 inregs.x.ax = message ; /* ;AN000;M Cannot JOIN a network drive */
560 inregs.x.bx = handle ; /* ;AN000;M STDERR */
561 inregs.x.si = (unsigned int)&sublist ; /* ;AN000;M Point to the substitution buffer */
562 inregs.x.cx = sub_cnt ; /* ;AN000;M SUBCNT1 */
563 inregs.h.dl = function ; /* ;AN000;M STR_INPUT */
564 inregs.h.dh = msg_class ; /* ;AN000;M Extended, Parse or Utility */
565 sysdispmsg(&inregs,&outregs) ; /* ;AN000;M Call common msg service */
566 break ; /* ;AN000;M */
567 case MSG_NETERR : sublist.value = (unsigned far *)replparm_JOIN ; /* ;AN000;M Cannot JOIN a network drive */
568 sublist.size = SUBLIST_LENGTH ; /* ;AN000;M */
569 sublist.reserved = RESERVED ; /* ;AN000;M */
570 sublist.id = SUB_ID1 ; /* ;AN000;M */
571 sublist.flags = STR_INPUT ; /* ;AN000;M */
572 sublist.max_width = MAXWIDTH ; /* ;AN000;M */
573 sublist.min_width = MINWIDTH ; /* ;AN000;M */
574 sublist.pad_char = (unsigned char)BLNK ; /* ;AN000;M */
575 inregs.x.ax = message ; /* ;AN000;M Cannot JOIN a network drive */
576 inregs.x.bx = handle ; /* ;AN000;M STDERR */
577 inregs.x.si = (unsigned int)&sublist ; /* ;AN000;M Point to the substitution buffer */
578 inregs.x.cx = sub_cnt ; /* ;AN000;M SUBCNT1 */
579 inregs.h.dl = function ; /* ;AN000;M STR_INPUT */
580 inregs.h.dh = msg_class ; /* ;AN000;M Extended, Parse or Utility */
581 sysdispmsg(&inregs,&outregs) ; /* ;AN000;M Call common msg service */
582 break ; /* ;AN000;M */
583 default : exit(ERRORLEVEL1) ; /* ;AN000;M */
584 break ; /* ;AN000;M */
585 } /* ;AN000;M */
586
587 if (outregs.x.cflag & CARRY) /* ;AN000;M Is the carry flag set? */
588 { /* ;AN000;M Then setup regs for extd-err */
589 inregs.x.bx = STDERR ; /* ;AN000;M */
590 inregs.x.cx = SUBCNT0 ; /* ;AN000;M */
591 inregs.h.dl = NO_INPUT ; /* ;AN000;M */
592 inregs.h.dh = EXT_ERR_CLASS ; /* ;AN000;M */
593 sysdispmsg(&inregs,&outregs) ; /* ;AN000;M Call to display ext_err msg */
594 exit(ERRORLEVEL1) ; /* ;AN000;M */
595 } /* ;AN000;M */
596 return ; /* ;AN000;M */
597} /* ;AN000;M */
598/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/
599/**************************************************************************/
600/* */
601/* SUBROUTINE NAME: dispmsg_terminate */
602/* */
603/* SUBROUTINE FUNCTION: Display the message, then terminate the utility.*/
604/* */
605/* INPUT: msg_num (#define'd message to display) */
606/* outline (substitution parameter) */
607/* */
608/**************************************************************************/
609
610dispmsg_terminate(msg_num,outline) /* ;AN000;P */
611int msg_num ; /* ;AN000;P Message number #define'd */
612char *outline ; /* ;AN001;P Substitution parameter */
613{ /* ;AN000;P */
614 display_msg(msg_num,outline) ; /* ;AN000;P First, display the msg */
615 exit(ERRORLEVEL1) ; /* ;AN000;P Then, terminate utility */
616} /* ;AN000;P */
617/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/
618/**************************************************************************/
619/* */
620/* SUBROUTINE NAME: Parser_Prep */
621/* */
622/* SUBROUTINE FUNCTION: Initialize all structures for the parser. */
623/* */
624/* INPUT: source (command line string) */
625/* */
626/* OUTPUT: none */
627/* */
628/* EXTERNAL REF: parse */
629/* */
630/**************************************************************************/
631
632Parser_Prep(source) /* ;AN000;P */
633char *source ; /* ;AN000;P Commandline */
634{ /* ;AN000;P */
635 p_p.p_parmsx_address = &p_px ; /* ;AN000;P Address of extended parm list */
636 p_p.p_num_extra = 0 ; /* ;AN000;P No extra declarations */
637
638 p_px.p_minp = MINPOSITION ; /* ;AN000;P */
639 p_px.p_maxp = MAXPOSITION ; /* ;AN000;P */
640 p_px.p_control1 = &p_con1 ; /* ;AN000;P Point to 1st control blk */
641 p_px.p_control2 = &p_con2 ; /* ;AN000;P Point to 2nd control blk */
642 p_px.p_maxs = 1 ; /* ;AN000;P Specify # of switches */
643 p_px.p_switch = &p_swi1 ; /* ;AN000;P Point to the switch blk */
644 p_px.p_maxk = 0 ; /* ;AN000;P Specify # of keywords */
645
646 p_con1.p_match_flag = DRVONLY_OPT ; /* ;AN000;P Drive only & optional */
647 p_con1.p_function_flag = NOCAPPING ; /* ;AN000;P Cap result by file table */
648 p_con1.p_result_buf = (unsigned int)&rslt1 ; /* ;AN000;P Point to result blk */
649 p_con1.p_value_list = (unsigned int)&novals ; /* ;AN000;P Point to no value list */
650 p_con1.p_nid = 0 ; /* ;AN000;P Not a switch id */
651
652 p_con2.p_match_flag = FILESPEC_OPT ; /* ;AN000;P File spec & optional */
653 p_con2.p_function_flag = CAPRESULT ; /* ;AN000;P Cap result by file table */
654 p_con2.p_result_buf = (unsigned int)&rslt2 ; /* ;AN000;P Point to result blk */
655 p_con2.p_value_list = (unsigned int)&novals ; /* ;AN000;P Point to no value list */
656 p_con2.p_nid = 0 ; /* ;AN000;P Not a switch id */
657
658 p_swi1.sp_match_flag = SWITCH_OPT ; /* ;AN000;P Optional (switch) */
659 p_swi1.sp_function_flag = NOCAPPING ; /* ;AN000;P Cap result by file table */
660 p_swi1.sp_result_buf = (unsigned int)&rslt3 ; /* ;AN000;P Point to result blk */
661 p_swi1.sp_value_list = (unsigned int)&novals ; /* ;AN000;P Point to no value list */
662 p_swi1.sp_nid = 1 ; /* ;AN000;P One switch allowed */
663 strcpy(p_swi1.sp_keyorsw,D_SWITCH) ; /* ;AN000;P Identify the switch */
664
665 inregs.x.cx = 0 ; /* ;AN000;P Operand ordinal */
666 inregs.x.di = (unsigned int)&p_p ; /* ;AN000;P Address of parm list */
667 inregs.x.si = (unsigned int)source ; /* ;AN000;P Make DS:SI point to source */
668 return ; /* ;AN000; */
669} /* ;AN000;P */
diff --git a/v4.0/src/CMD/JOIN/JOIN.LNK b/v4.0/src/CMD/JOIN/JOIN.LNK
new file mode 100644
index 0000000..fd0b443
--- /dev/null
+++ b/v4.0/src/CMD/JOIN/JOIN.LNK
@@ -0,0 +1,12 @@
1JOIN.OBJ+
2..\..\inc\ERRTST.OBJ+
3..\..\inc\SYSVAR.OBJ+
4..\..\inc\CDS.OBJ+
5..\..\inc\DPB.OBJ+
6_MSGRET.OBJ+
7_PARSE.OBJ
8JOIN
9NUL
10..\..\inc\comsubs.lib+
11..\..\mapper\mapper.lib;
12 \ No newline at end of file
diff --git a/v4.0/src/CMD/JOIN/JOIN.SKL b/v4.0/src/CMD/JOIN/JOIN.SKL
new file mode 100644
index 0000000..dd6806f
--- /dev/null
+++ b/v4.0/src/CMD/JOIN/JOIN.SKL
@@ -0,0 +1,22 @@
1;JOIN Utility
2;Message Service Routine
3
4:util JOIN ;BEGIN UTIL ;AN000;
5
6:class 1 ;EXTENDED ERRORS ;AN000;
7;------- ---------------
8;:use EXTEND8 ;Insufficient memory
9
10:class 2 ;PARSE ERRORS ;AN000;
11;------- ------------
12;:use PARSE1 ;Too many parameters
13;:use PARSE3 ;Invalid switch
14;:use PARSE10 ;Invalid parameter
15
16:class A ;COMMON & DEFINED MSGS ;AN000;
17;------- ------------
18:use 1 COMMON1 ;Incorrect DOS version ;AN000;
19:def 2 "Directory not empty",CR,LF ;AN000;
20:use 12 COMMON12 ;Cannot %1 a network drive ;AN000;
21
22:end ;END UTIL ;AN000;
diff --git a/v4.0/src/CMD/JOIN/JOINPARS.H b/v4.0/src/CMD/JOIN/JOINPARS.H
new file mode 100644
index 0000000..8573a17
--- /dev/null
+++ b/v4.0/src/CMD/JOIN/JOINPARS.H
@@ -0,0 +1,156 @@
1/*  */
2/*----------------------------------------------------------------------+
3| |
4| This file contains the structures and defines that are needed to use |
5| the parser from a C program. |
6| ** customized for the JOIN and SUBST utilities ** |
7| |
8| Date: 5-21-87 |
9| |
10| |
11+----------------------------------------------------------------------*/
12
13
14struct p_parms
15 {
16 struct p_parmsx *p_parmsx_address; /* address of p_parmsx */
17 unsigned char p_num_extra; /* number of extra stuff */
18 };
19
20struct p_parmsx
21 {
22 unsigned char p_minp; /* Minimum positional number */
23 unsigned char p_maxp; /* Maximum positional number */
24 struct p_control_blk *p_control1; /* Address of the 1st CONTROL block */
25 struct p_control_blk *p_control2; /* Address of the 2nd CONTROL block */
26 unsigned char p_maxs; /* Maximun switches */
27 struct p_switch_blk *p_switch; /* Address of the SWITCH block */
28 unsigned char p_maxk; /* Maximum keywords */
29 };
30
31
32struct p_control_blk
33 {
34 unsigned int p_match_flag; /* Controls type matched */
35 unsigned int p_function_flag; /* Function should be taken */
36 unsigned int p_result_buf; /* Result buffer address */
37 unsigned int p_value_list; /* Value list address */
38 unsigned char p_nid; /* # of keyword/SW synonyms */
39 };
40
41struct p_switch_blk
42 {
43 unsigned int sp_match_flag; /* Controls type matched */
44 unsigned int sp_function_flag; /* Function should be taken */
45 unsigned int sp_result_buf; /* Result buffer address */
46 unsigned int sp_value_list; /* Value list address */
47 unsigned char sp_nid; /* # of keyword/SW synonyms */
48 unsigned char sp_keyorsw[3]; /* keyword or sw */
49 };
50
51/* Match_Flags */
52
53#define P_Num_Val 0x8000 /* Numeric Value */
54#define P_SNum_Val 0x4000 /* Signed numeric value */
55#define P_Simple_S 0x2000 /* Simple string */
56#define P_Date_S 0x1000 /* Date string */
57#define P_Time_S 0x0800 /* Time string */
58#define P_Cmpx_S 0x0400 /* Complex string */
59#define P_File_Spc 0x0200 /* File Spec */
60#define P_Drv_Only 0x0100 /* Drive Only */
61#define P_Qu_String 0x0080 /* Quoted string */
62#define P_Ig_Colon 0x0010 /* Ignore colon at end in match */
63#define P_Repeat 0x0002 /* Repeat allowed */
64#define P_Optional 0x0001 /* Optional */
65
66/*----------------------------------------------------------------------+
67| |
68| Function flags |
69| |
70+----------------------------------------------------------------------*/
71
72#define P_CAP_File 0x0001 /* CAP result by file table */
73#define P_CAP_Char 0x0002 /* CAP result by character table */
74#define P_Rm_Colon 0x0010 /* Remove ":" at the end */
75
76
77
78#define P_nval_None 0 /* no value list ID */
79#define P_nval_Range 1 /* range list ID */
80#define P_nval_Value 2 /* value list ID */
81#define P_nval_String 3 /* string list ID */
82#define P_Len_Range 9 /* Length of a range choice(two DD plus one DB) */
83#define P_Len_Value 5 /* Length of a value choice(one DD plus one DB) */
84#define P_Len_String 3 /* Length of a string choice(one DW plus one DB) */
85
86
87/*----------------------------------------------------------------------+
88| |
89| Result block structure |
90| |
91+----------------------------------------------------------------------*/
92
93struct p_result_blk
94 {
95 unsigned char P_Type; /* Type returned */
96 unsigned char P_Item_Tag; /* Matched item tag */
97 unsigned int P_SYNONYM_Ptr; /* pointer to Synonym list returned */
98 unsigned int p_result_buff[2]; /* result value */
99 };
100
101struct p_fresult_blk
102 {
103 unsigned char fP_Type; /* Type returned */
104 unsigned char fP_Item_Tag; /* Matched item tag */
105 unsigned int fP_SYNONYM_Ptr; /* pointer to Synonym list returned */
106 char far * fp_result_buff; /* result value */
107 };
108
109/*----------------------------------------------------------------------+
110| |
111| type |
112| |
113+----------------------------------------------------------------------*/
114
115#define P_EOL 0 /* End of line */
116#define P_Number 1 /* Number */
117#define P_List_Idx 2 /* List Index */
118#define P_String 3 /* String */
119#define P_Complex 4 /* Complex */
120#define P_File_Spec 5 /* File Spec */
121#define P_Drive 6 /* Drive */
122#define P_Date_F 7 /* Date */
123#define P_Time_F 8 /* Time */
124#define P_Quoted_String 9 /* Quoted String */
125
126#define P_No_Tag 0x0FF /* No ITEM_TAG found */
127
128/*----------------------------------------------------------------------+
129| |
130| Value list structure |
131| |
132+----------------------------------------------------------------------*/
133
134struct noval
135 {
136 unsigned char null;
137 };
138
139/*----------------------------------------------------------------------+
140| |
141| following return code will be returned in the AX register. |
142| |
143+----------------------------------------------------------------------*/
144
145#define P_No_Error 0 /* No error */
146#define P_Too_Many 1 /* Too many operands */
147#define P_Op_Missing 2 /* Required operand missing */
148#define P_Not_In_SW 3 /* Not in switch list provided */
149#define P_Not_In_Key 4 /* Not in keyword list provided */
150#define P_Out_Of_Range 6 /* Out of range specified */
151#define P_Not_In_Val 7 /* Not in value list provided */
152#define P_Not_In_Str 8 /* Not in string list provided */
153#define P_Syntax 9 /* Syntax error */
154#define P_RC_EOL 0x0ffff /* End of command line */
155
156
diff --git a/v4.0/src/CMD/JOIN/MAKEFILE b/v4.0/src/CMD/JOIN/MAKEFILE
new file mode 100644
index 0000000..c177f0f
--- /dev/null
+++ b/v4.0/src/CMD/JOIN/MAKEFILE
@@ -0,0 +1,81 @@
1#************************* makefile for cmd\join ************************
2
3msg =..\..\messages
4dos =..\..\dos
5inc =..\..\inc
6hinc =..\..\h
7map =..\..\mapper
8here =..\cmd\join # This is the path from INC or MAP dir's to here.
9make =nmake -i
10
11#
12####################### dependencies begin here. #########################
13#
14
15all: join.exe
16
17$(inc)\errtst.obj:
18 cd $(inc)
19 $(make)
20 cd $(here)
21
22$(inc)\sysvar.obj:
23 cd $(inc)
24 $(make)
25 cd $(here)
26
27$(inc)\cds.obj:
28 cd $(inc)
29 $(make)
30 cd $(here)
31
32$(inc)\dpb.obj:
33 cd $(inc)
34 $(make)
35 cd $(here)
36
37$(inc)\comsubs.lib:
38 cd $(inc)
39 $(make)
40 cd $(here)
41
42$(map)\mapper.lib:
43 cd $(map)
44 $(make)
45 cd $(here)
46
47join.ctl: join.skl \
48 $(msg)\$(COUNTRY).msg \
49 makefile
50
51_msgret.obj: _msgret.asm \
52 $(inc)\msgserv.asm \
53 $(inc)\sysmsg.inc \
54 join.ctl \
55 join.cla \
56 join.cl1 \
57 join.cl2 \
58 join.skl
59
60_parse.obj: _parse.asm \
61 $(inc)\parse.asm \
62 $(inc)\psdata.inc
63
64join.obj: join.c \
65 makefile \
66 joinpars.h \
67 $(hinc)\cds.h \
68 $(hinc)\jointype.h \
69 $(hinc)\sysvar.h
70
71join.exe: join.obj \
72 $(inc)\errtst.obj \
73 $(inc)\sysvar.obj \
74 $(inc)\cds.obj \
75 $(inc)\dpb.obj \
76 $(map)\mapper.lib \
77 $(inc)\comsubs.lib \
78 _msgret.obj \
79 _parse.obj \
80 join.lnk
81 link @join.lnk
diff --git a/v4.0/src/CMD/JOIN/_MSGRET.ASM b/v4.0/src/CMD/JOIN/_MSGRET.ASM
new file mode 100644
index 0000000..085cb8b
--- /dev/null
+++ b/v4.0/src/CMD/JOIN/_MSGRET.ASM
@@ -0,0 +1,250 @@
1page 60,132
2name _msgret
3title C to Message Retriever
4;-------------------------------------------------------------------
5;
6; MODULE: _msgret
7;
8; PURPOSE: Supplies an interface between C programs and
9; the DOS 3.3 message retriever
10;
11; CALLING FORMAT:
12; sysloadmsg(&inregs,&outregs);
13; sysgetmsg(&inregs,&outregs);
14; sysdispmsg(&inregs,&outregs);
15;
16; DATE: 5-21-87
17;
18;-------------------------------------------------------------------
19
20 INCLUDE SYSMSG.INC ;PERMIT SYSTEM MESSAGE HANDLER DEFINITION;AN000;
21
22 MSG_UTILNAME <JOIN> ;IDENTIFY THE COMPONENT ;AN000;
23
24 .8087 ;AN000;
25_TEXT SEGMENT BYTE PUBLIC 'CODE' ;AN000;
26_TEXT ENDS ;AN000;
27_DATA SEGMENT WORD PUBLIC 'DATA' ;AN000;
28_DATA ENDS ;AN000;
29CONST SEGMENT WORD PUBLIC 'CONST' ;AN000;
30CONST ENDS ;AN000;
31_BSS SEGMENT WORD PUBLIC 'BSS' ;AN000;
32_BSS ENDS ;AN000;
33DGROUP GROUP CONST, _BSS, _DATA ;AN000;
34 ASSUME CS: _TEXT, DS: _TEXT, SS: DGROUP, ES: DGROUP ;AN000;
35
36
37 public _sysloadmsg ;AN000;
38 public _sysgetmsg ;AN000;
39 public _sysdispmsg ;AN000;
40
41;-------------------------------------------------------------------
42;-------------------------------------------------------------------
43
44_DATA segment ;AN000;
45.XLIST ;AN000;
46.XCREF ;AN000;
47 MSG_SERVICES <MSGDATA> ;DATA AREA FOR THE MESSAGE HANDLER ;AN000;
48.LIST ;AN000;
49.CREF ;AN000;
50_DATA ends ;AN000;
51
52
53_TEXT segment ;AN000;
54
55;-------------------------------------------------------------------
56
57; = = = = = = = = = = = =
58
59 ;DEFAULT=CHECK DOS VERSION ;AN000;
60 ;DEFAULT=NEARmsg ;AN000;
61 ;DEFAULT=INPUTmsg ;AN000;
62 ;DEFAULT=NUMmsg ;AN000;
63 ;DEFAULT=NO TIMEmsg ;AN000;
64 ;DEFAULT=NO DATEmsg ;AN000;
65; MSG_SERVICES <LOADmsg,GETmsg,DISPLAYmsg,CHARmsg,NUMmsg,TIMEmsg,DATEmsg,INPUTmsg,FARmsg>;AN000;
66; MSG_SERVICES <JOIN.CLA,JOIN.CL1,JOIN.CL2> ;MSG TEXT ;AN000;
67.XLIST ;AN000;
68.XCREF ;AN000;
69; MSG_SERVICES <MSGDATA> ;DATA AREA FOR THE MESSAGE HANDLER ;AN000;
70 MSG_SERVICES <LOADmsg,GETmsg,DISPLAYmsg,CHARmsg,NUMmsg,TIMEmsg,DATEmsg,INPUTmsg,FARmsg>;AN000;
71 MSG_SERVICES <JOIN.CLA,JOIN.CL1,JOIN.CL2> ;MSG TEXT ;AN000;
72.LIST ;AN000;
73.CREF ;AN000;
74;-------------------------------------------------------------------
75
76_sysloadmsg proc near ;AN000;
77
78 push bp ; save user's base pointer ;AN000;
79 mov bp,sp ; set bp to current sp ;AN000;
80 push di ; save some registers ;AN000;
81 push si ;AN000;
82
83; copy C inregs into proper registers
84
85 mov di,[bp+4] ; fix di (arg 0) ;AN000;
86
87;-------------------------------------------------------------------
88
89 mov ax,[di+0ah] ; load di ;AN000;
90 push ax ; the di value from inregs is now on stack;AN000;
91
92 mov ax,[di+00] ; get inregs.x.ax ;AN000;
93 mov bx,[di+02] ; get inregs.x.bx ;AN000;
94 mov cx,[di+04] ; get inregs.x.cx ;AN000;
95 mov dx,[di+06] ; get inregs.x.dx ;AN000;
96 mov si,[di+08] ; get inregs.x.si ;AN000;
97 pop di ; get inregs.x.di from stack ;AN000;
98
99 push bp ; save base pointer ;AN000;
100
101;-------------------------------------------------------------------
102 call sysloadmsg ; call the message retriever ;AN000;
103;-------------------------------------------------------------------
104
105 pop bp ; restore base pointer ;AN000;
106 push di ; the di value from call is now on stack;AN000;
107 mov di,[bp+6] ; fix di (arg 1) ;AN000;
108
109 mov [di+00],ax ; load outregs.x.ax ;AN000;
110 mov [di+02],bx ; load outregs.x.bx ;AN000;
111 mov [di+04],cx ; load outregs.x.cx ;AN000;
112 mov [di+06],dx ; load outregs.x.dx ;AN000;
113 mov [di+08],si ; load outregs.x.si ;AN000;
114
115 lahf ; get flags into ax ;AN000;
116 mov al,ah ; move into low byte ;AN000;
117 mov [di+0ch],ax ; load outregs.x.cflag ;AN000;
118
119 pop ax ; get di from stack ;AN000;
120 mov [di+0ah],ax ; load outregs.x.di ;AN000;
121
122;-------------------------------------------------------------------
123
124 pop si ; restore registers ;AN000;
125 pop di ;AN000;
126 mov sp,bp ; restore sp ;AN000;
127 pop bp ; restore user's bp ;AN000;
128 ret ;AN000;
129
130_sysloadmsg endp ;AN000;
131
132
133_sysgetmsg proc near ;AN000;
134
135 push bp ; save user's base pointer ;AN000;
136 mov bp,sp ; set bp to current sp ;AN000;
137 push di ; save some registers ;AN000;
138 push si ;AN000;
139
140; copy C inregs into proper registers
141
142 mov di,[bp+4] ; fix di (arg 0) ;AN000;
143
144;-------------------------------------------------------------------
145
146 mov ax,[di+0ah] ; load di ;AN000;
147 push ax ; the di value from inregs is now on stack;AN000;
148
149 mov ax,[di+00] ; get inregs.x.ax ;AN000;
150 mov bx,[di+02] ; get inregs.x.bx ;AN000;
151 mov cx,[di+04] ; get inregs.x.cx ;AN000;
152 mov dx,[di+06] ; get inregs.x.dx ;AN000;
153 mov si,[di+08] ; get inregs.x.si ;AN000;
154 pop di ; get inregs.x.di from stack ;AN000;
155
156 push bp ; save base pointer ;AN000;
157
158;-------------------------------------------------------------------
159 call sysgetmsg ; call the message retriever ;AN000;
160;-------------------------------------------------------------------
161
162 pop bp ; restore base pointer ;AN000;
163 push di ; the di value from call is now on stack;AN000;
164 mov di,[bp+6] ; fix di (arg 1) ;AN000;
165
166 mov [di+00],ax ; load outregs.x.ax ;AN000;
167 mov [di+02],bx ; load outregs.x.bx ;AN000;
168 mov [di+04],cx ; load outregs.x.cx ;AN000;
169 mov [di+06],dx ; load outregs.x.dx ;AN000;
170 mov [di+08],si ; load outregs.x.si ;AN000;
171
172 lahf ; get flags into ax ;AN000;
173 mov al,ah ; move into low byte ;AN000;
174 mov [di+0ch],ax ; load outregs.x.cflag ;AN000;
175
176 pop ax ; get di from stack ;AN000;
177 mov [di+0ah],ax ; load outregs.x.di ;AN000;
178
179;-------------------------------------------------------------------
180
181 pop si ; restore registers ;AN000;
182 pop di ;AN000;
183 mov sp,bp ; restore sp ;AN000;
184 pop bp ; restore user's bp ;AN000;
185 ret ;AN000;
186
187_sysgetmsg endp ;AN000;
188
189_sysdispmsg proc near ;AN000;
190
191 push bp ; save user's base pointer ;AN000;
192 mov bp,sp ; set bp to current sp ;AN000;
193 push di ; save some registers ;AN000;
194 push si ;AN000;
195
196; copy C inregs into proper registers
197
198 mov di,[bp+4] ; fix di (arg 0) ;AN000;
199
200;-------------------------------------------------------------------
201
202 mov ax,[di+0ah] ; load di ;AN000;
203 push ax ; the di value from inregs is now on stack;AN000;
204
205 mov ax,[di+00] ; get inregs.x.ax ;AN000;
206 mov bx,[di+02] ; get inregs.x.bx ;AN000;
207 mov cx,[di+04] ; get inregs.x.cx ;AN000;
208 mov dx,[di+06] ; get inregs.x.dx ;AN000;
209 mov si,[di+08] ; get inregs.x.si ;AN000;
210 pop di ; get inregs.x.di from stack ;AN000;
211
212 push bp ; save base pointer ;AN000;
213
214;-------------------------------------------------------------------
215 call sysdispmsg ; call the message retriever ;AN000;
216;-------------------------------------------------------------------
217
218 pop bp ; restore base pointer ;AN000;
219 push di ; the di value from call is now on stack;AN000;
220 mov di,[bp+6] ; fix di (arg 1) ;AN000;
221
222 mov [di+00],ax ; load outregs.x.ax ;AN000;
223 mov [di+02],bx ; load outregs.x.bx ;AN000;
224 mov [di+04],cx ; load outregs.x.cx ;AN000;
225 mov [di+06],dx ; load outregs.x.dx ;AN000;
226 mov [di+08],si ; load outregs.x.si ;AN000;
227
228 lahf ; get flags into ax ;AN000;
229 mov al,ah ; move into low byte ;AN000;
230 mov [di+0ch],ax ; load outregs.x.cflag ;AN000;
231
232 pop ax ; get di from stack ;AN000;
233 mov [di+0ah],ax ; load outregs.x.di ;AN000;
234
235;-------------------------------------------------------------------
236
237 pop si ; restore registers ;AN000;
238 pop di ;AN000;
239 mov sp,bp ; restore sp ;AN000;
240 pop bp ; restore user's bp ;AN000;
241 ret ;AN000;
242
243_sysdispmsg endp ;AN000;
244
245include msgdcl.inc
246
247_TEXT ends ; end code segment ;AN000;
248 end ;AN000;
249
250 \ No newline at end of file
diff --git a/v4.0/src/CMD/JOIN/_PARSE.ASM b/v4.0/src/CMD/JOIN/_PARSE.ASM
new file mode 100644
index 0000000..8c72302
--- /dev/null
+++ b/v4.0/src/CMD/JOIN/_PARSE.ASM
@@ -0,0 +1,121 @@
1page 60,132
2name _parse
3title C to PARSER interface
4;-------------------------------------------------------------------
5;
6; MODULE: _parse
7;
8; PURPOSE: Supplies an interface between C programs and
9; the DOS 3.3 parser
10;
11; **(Customized for the JOIN utility)
12;
13; CALLING FORMAT:
14; parse(&inregs,&outregs);
15;
16; DATE: 5-21-87
17;
18;-------------------------------------------------------------------
19
20; extrn sysparse:far
21
22 public _parse ;AN000;
23
24;-------------------------------------------------------------------
25
26; set for JOIN
27; -------------
28
29FarSW equ 0 ; make sysparse be a NEAR proc ;AN000;
30TimeSW equ 0 ; Check time format ;AN000;
31FileSW equ 1 ; Check file specification ;AN000;
32CAPSW equ 1 ; Perform CAPS if specified ;AN000;
33CmpxSW equ 0 ; Check complex list ;AN000;
34NumSW equ 0 ; Check numeric value ;AN000;
35KeySW equ 0 ; Support keywords ;AN000;
36SwSW equ 1 ; Support switches ;AN000;
37Val1SW equ 0 ; Support value definition 1 ;AN000;
38Val2SW equ 0 ; Support value definition 2 ;AN000;
39Val3SW equ 0 ; Support value definition 3 ;AN000;
40DrvSW equ 1 ; Support drive only format ;AN000;
41QusSW equ 0 ; Support quoted string format ;AN000;
42;-------------------------------------------------------------------
43
44DGROUP GROUP _DATA
45PGROUP GROUP _TEXT
46
47_DATA segment byte public 'DATA' ;AN000;
48BASESW = 1 ;SPECIFY, PSDATA POINTED TO BY "DS"
49INCSW = 0 ;PSDATA.INC IS ALREADY INCLUDED
50 INCLUDE PSDATA.INC ;PARSER'S WORK SPACE
51_DATA ends ;AN000;
52
53_TEXT segment byte public 'CODE' ;AN000;
54
55 ASSUME CS: PGROUP ;AN000;
56 ASSUME DS: DGROUP ;AN000;
57
58;-------------------------------------------------------------------
59include parse.asm ; include the parser ;AN000;
60;-------------------------------------------------------------------
61
62_parse proc near ;AN000;
63
64 push bp ; save user's base pointer ;AN000;
65 mov bp,sp ; set bp to current sp ;AN000;
66 push di ; save some registers ;AN000;
67 push si ;AN000;
68
69; copy C inregs into proper registers
70
71 mov di,[bp+4] ; fix di (arg 0) ;AN000;
72
73;-------------------------------------------------------------------
74
75 mov ax,[di+0ah] ; load di ;AN000;
76 push ax ; the di value from inregs is now on stack;AN000;
77
78 mov ax,[di+00] ; get inregs.x.ax ;AN000;
79 mov bx,[di+02] ; get inregs.x.bx ;AN000;
80 mov cx,[di+04] ; get inregs.x.cx ;AN000;
81 mov dx,[di+06] ; get inregs.x.dx ;AN000;
82 mov si,[di+08] ; get inregs.x.si ;AN000;
83 pop di ; get inregs.x.di from stack ;AN000;
84
85 push bp ; save base pointer ;AN000;
86
87;-------------------------------------------------------------------
88 call sysparse ; call the parser ;AN000;
89;-------------------------------------------------------------------
90
91 pop bp ; restore base pointer ;AN000;
92 push di ; the di value from call is now on stack;AN000;
93 mov di,[bp+6] ; fix di (arg 1) ;AN000;
94
95 mov [di+00],ax ; load outregs.x.ax ;AN000;
96 mov [di+02],bx ; load outregs.x.bx ;AN000;
97 mov [di+04],cx ; load outregs.x.cx ;AN000;
98 mov [di+06],dx ; load outregs.x.dx ;AN000;
99 mov [di+08],si ; load outregs.x.si ;AN000;
100
101 lahf ; get flags into ax ;AN000;
102 mov al,ah ; move into low byte ;AN000;
103 mov [di+0ch],ax ; load outregs.x.cflag ;AN000;
104
105 pop ax ; get di from stack ;AN000;
106 mov [di+0ah],ax ; load outregs.x.di ;AN000;
107
108;-------------------------------------------------------------------
109
110 pop si ; restore registers ;AN000;
111 pop di ;AN000;
112 mov sp,bp ; restore sp ;AN000;
113 pop bp ; restore user's bp ;AN000;
114 ret ;AN000;
115
116_parse endp ;AN000;
117
118_TEXT ends ; end code segment ;AN000;
119 end ;AN000;
120
121 \ No newline at end of file