*** /w/kermit/sw/ckifio.c Thu Feb 13 15:19:34 1992 --- ckifio.c Tue Sep 1 19:27:53 1992 *************** *** 157,163 **** static char nambuf[MAXNAMLEN+2]; /* Buffer for a filename */ char *mtchs[MAXWLD], /* Matches found for filename */ ! **mtchptr; /* Pointer to current match */ /* utility functions from ckiutl.c */ extern int existobj(); --- 157,164 ---- static char nambuf[MAXNAMLEN+2]; /* Buffer for a filename */ char *mtchs[MAXWLD], /* Matches found for filename */ ! **mtchptr; /* Pointer to current match */ ! extern short v37; /* Are we 2.0 or greater? */ /* utility functions from ckiutl.c */ extern int existobj(); *************** *** 606,612 **** /* Z C H D I R -- Change directory */ int zchdir(char *dirnam) { ! return((chdir(dirnam) == 0) ? 1 : 0); } /* Z G T D I R -- Return pointer to user's current directory */ --- 607,618 ---- /* Z C H D I R -- Change directory */ int zchdir(char *dirnam) { ! if (chdir(dirnam) != 0) /* failed */ ! return 0; ! if (v37) /* This only if V37 or more */ ! if (!SetCurrentDirName(dirnam)) ! return 0; ! return 1; } /* Z G T D I R -- Return pointer to user's current directory */ *** /w/kermit/sw/ckiker.mak Mon Jan 20 19:12:39 1992 --- ckiker.mak Tue Sep 1 19:28:23 1992 *************** *** 1,13 **** # CKIKER.MAK, Version 5A(165), Tue Jan 21 20:52:00 1991 # ! # This test version of C Kermit uses CKUXLA.C as the translation module. ! # This isn't quite correct, but will do for testing purposes. You will ! # also need to copy CKUXLA.H onto CKIXLA.H to build from source. # - # This is a makefile for C Kermit using Amiga Aztec C V5.0b. The lint - # line is for Gimpel Lint V3.03 assuming some kind of standard setup. - # BUG NOTE: Amiga Aztec C V5.0d will not compile this code. - # # -wo here makes pointer-int conversions a warning instead of an error, # and is needed if you use prototypes for the Kermit functions. In # particular, the last argument of debug() is specified as an int, but --- 1,8 ---- # CKIKER.MAK, Version 5A(165), Tue Jan 21 20:52:00 1991 # ! # This is a makefile for C Kermit using Amiga Aztec C V5.n. The lint ! # line is for Gimpel FlexeLint, a commercial product. # # -wo here makes pointer-int conversions a warning instead of an error, # and is needed if you use prototypes for the Kermit functions. In # particular, the last argument of debug() is specified as an int, but *************** *** 18,24 **** # As of 5A(157), the data had finally become too big for the small # data model, so we are forced to large, but only if DYNAMIC is # not defined. The DYNAMIC #define causes C Kermit's send and ! # receive values to be allocated at run time. # # There is a bit of code now in which is specific to Version 2.0 # of the AmigaOS, (Kickstart version 37.nnn), and more will undoubtedly --- 13,20 ---- # As of 5A(157), the data had finally become too big for the small # data model, so we are forced to large, but only if DYNAMIC is # not defined. The DYNAMIC #define causes C Kermit's send and ! # receive values to be allocated at run time, and is recommended. ! # If DYNAMIC is used, small model can also be used. # # There is a bit of code now in which is specific to Version 2.0 # of the AmigaOS, (Kickstart version 37.nnn), and more will undoubtedly *************** *** 28,52 **** CC = cc ! OPTS = -DAMIGA -DDYNAMIC -DCK_ANSILIBS -DV37 ! CFLAGS = $(OPTS) -so -wo -hi functions.pre ! LFLAGS = -g # ! # Note the ckuxla.c in the lists belw. I have not yet written an ! # Amiga-specific version of ckuxla.c. Also, copy ckuxla.h onto a ! # new file, ckixla.h. # OBJS = ckcmai.o ckucmd.o ckuusr.o ckuus2.o ckuus3.o ckuus4.o ckuus5.o \ ! ckuus6.o ckuusx.o ckuusy.o \ ckcpro.o ckcfns.o ckcfn2.o ckcfn3.o ckuxla.o ckicon.o \ ! ckitio.o ckifio.o ckistu.o ckiutl.o SRCS = ckcmai.c ckucmd.c ckuusr.c ckuus2.c ckuus3.c ckuus4.c ckuus5.c \ ! ckuus6.c ckuusx.c ckuusy.c \ ckcpro.c ckcfns.c ckcfn2.c ckcfn3.c ckuxla.c ckicon.c \ ckitio.c ckifio.c ckistu.c ckiutl.c --- 24,51 ---- CC = cc ! OPTS = -DAMIGA -DDYNAMIC -DCK_ANSILIBS -DCK_ANSIC -DNODIAL -DMYCURSES ! CFLAGS = $(OPTS) -so -wo ! LFLAGS = # ! # All the object files needed to compile C Kermit. # OBJS = ckcmai.o ckucmd.o ckuusr.o ckuus2.o ckuus3.o ckuus4.o ckuus5.o \ ! ckuus6.o ckuus7.o ckuusx.o ckuusy.o \ ckcpro.o ckcfns.o ckcfn2.o ckcfn3.o ckuxla.o ckicon.o \ ! ckitio.o ckifio.o ckistu.o ckiutl.o \ ! ckcmdb.o + # + # The corresponding sources, used mainly to run lint. + # + SRCS = ckcmai.c ckucmd.c ckuusr.c ckuus2.c ckuus3.c ckuus4.c ckuus5.c \ ! ckuus6.c ckuus7.c ckuusx.c ckuusy.c \ ckcpro.c ckcfns.c ckcfn2.c ckcfn3.c ckuxla.c ckicon.c \ ckitio.c ckifio.c ckistu.c ckiutl.c *************** *** 89,91 **** --- 88,105 ---- clean: -delete $(OBJS) kermit wermit wart + + # + # Special rules for the Amiga-specific files + # + ckifio.o: ckifio.c + cc $(CFLAGS) -hi functions.pre ckifio.c + + ckitio.o: ckitio.c + cc $(CFLAGS) -hi functions.pre ckitio.c + + ckiutl.o: ckiutl.c + cc $(CFLAGS) -hi functions.pre ckiutl.c + + ckicon.o: ckicon.c + cc $(CFLAGS) -hi functions.pre ckicon.c *** /w/kermit/sw/ckitio.c Mon May 11 10:23:05 1992 --- ckitio.c Tue Sep 1 19:28:01 1992 *************** *** 17,40 **** /* C K I T I O -- Serial and Console I/O support for the Amiga */ /* ! Author: Jack Rouse, The Software Distillery ! Based on the CKUTIO.C module for Unix - Modified for Manx Aztec C and Version 1.2 and forward of Amiga's OS by - Stephen Walton of California State University, Northridge, - ecphssrw@afws.csun.edu. Further mods documented in ckiker.upd. - $Log: ckitio.c,v $ ! oRevision 1.7 92/03/16 13:50:58 swalton ! oSupport added for CTR/RTS flow control, using the new FLO_ manifest ! oconstants in version 5A. ! o ! oRevision 1.6 92/01/15 17:12:35 swalton ! oAdded Long BREAK support with new ttsndlb() routine. ! o ! oAdded support for multiple devices; the SET LINE command now takes a ! oline of the form "device/unit". ! o * Revision 1.5 91/07/18 16:04:57 swalton * ttinl() now null terminates a received packet correctly. * --- 17,41 ---- /* C K I T I O -- Serial and Console I/O support for the Amiga */ /* ! * Author: Jack Rouse, The Software Distillery ! * Based on the CKUTIO.C module for Unix ! * ! * Modified for Manx Aztec C and Version 1.2 and forward of Amiga's OS by ! * Stephen Walton of California State University, Northridge, ! * srw@csun.edu. Further mods documented in ckiker.upd. ! * $Log: ckitio.c,v $ ! * Revision 1.7 92/03/16 13:50:58 swalton ! * Support added for CTR/RTS flow control, using the new FLO_ manifest ! * constants in version 5A. ! * ! * Revision 1.6 92/01/15 17:12:35 swalton ! * Added Long BREAK support with new ttsndlb() routine. ! * ! * Added support for multiple devices; the SET LINE command now takes a ! * line of the form "device/unit". ! * * Revision 1.5 91/07/18 16:04:57 swalton * ttinl() now null terminates a received packet correctly. * *************** *** 110,115 **** --- 111,117 ---- struct Process *CurProc; /* current process */ struct CommandLineInterface *CurCLI; /* current CLI info */ struct IntuitionBase *IntuitionBase; /* ptr to Intuition lib */ + short v37; /* Are we version 37? */ /* static definitions */ static struct MsgPort *serport; /* message port for serial comm */ *************** *** 241,246 **** --- 243,252 ---- OpenLibrary("intuition.library", 0L) ) == NULL ) Fail("can't open Intuition"); + if (((struct Library *)IntuitionBase)->lib_Version >= 37) + v37 = TRUE; + else + v37 = FALSE; /* open the serial device to get configuration */ iob->io_SerFlags = SERF_SHARED; if (OpenDevice(SERIALNAME, 0L, (IOR *)iob, 0L) != 0) *************** *** 381,389 **** struct IOExtSer *iob = ReadIOB; char *p; ULONG unit; - if (serialopen) return(0); /* ignore if already open */ if (modem < 0) return -1; /* We don't do networks yet. */ /* verify the serial name */ #if 0 --- 387,399 ---- struct IOExtSer *iob = ReadIOB; char *p; ULONG unit; + static char cttname[50]; /* Current open ttname */ if (modem < 0) return -1; /* We don't do networks yet. */ + if (serialopen) /* Already have serial device open */ + if (strcmp(ttname, cttname) == 0) + return(0); /* Same device - ignore */ + else ttclos(0); /* Different device - close */ /* verify the serial name */ #if 0 *************** *** 397,402 **** --- 407,417 ---- if ((p = strchr(ttname, '/')) == NULL) unit = 0; else { + if (*(p + strlen(p) - 1) == 's') /* Open in shared mode */ + { + iob->io_SerFlags |= SERF_SHARED; + *(p + strlen(p) - 1) = '\0'; + } unit = (ULONG) atoi(p + 1); *p = '\0'; } *************** *** 414,419 **** --- 429,437 ---- /* set local mode */ if (*lcl == -1) *lcl = 1; /* always local */ if (p) *p = '/'; /* restore slash */ + if (iob->io_SerFlags & SERF_SHARED) + *(p + strlen(p)) = 's'; /* restore suffix if present */ + strcpy(cttname, ttname); return(0); } *************** *** 1156,1162 **** if (rawcon > 0) return(0); congm(); ! if ((rawcon = Open("RAW:0/0/640/200/Kermit", (LONG)MODE_NEWFILE)) == 0) return(-1); DOSFH(0) = DOSFH(1) = DOSFH(2) = rawcon; --- 1174,1180 ---- if (rawcon > 0) return(0); congm(); ! if ((rawcon = Open("RAW:0/0/1024/1024/Kermit", (LONG)MODE_NEWFILE)) == 0) return(-1); DOSFH(0) = DOSFH(1) = DOSFH(2) = rawcon; *** /w/kermit/sw/ckiutl.c Thu Feb 13 15:19:35 1992 --- ckiutl.c Tue Sep 1 19:28:09 1992 *************** *** 256,263 **** return(rc); } - #if V37 - #include static struct TagItem MyTags[] = { --- 256,261 ---- *************** *** 264,272 **** { SYS_Output, 0L}, { TAG_END, 0L} }; - #endif /* V37 */ - /* * pipeopen -- execute command to read output like a file */ --- 262,269 ---- { SYS_Output, 0L}, { TAG_END, 0L} }; + extern short v37; /* * pipeopen -- execute command to read output like a file */ *************** *** 278,293 **** /* create holder file */ fh = Open(PIPEHOLDER, (LONG)MODE_NEWFILE); if (fh == 0) return(0); - #if V37 - /* execute the command */ - MyTags[0].ti_Data = fh; - if (System(command, MyTags) != 0) - return NULL; - #else - Execute(command, 0, fh); - #endif - /* close the holder file */ Close(fh); --- 275,288 ---- /* create holder file */ fh = Open(PIPEHOLDER, (LONG)MODE_NEWFILE); if (fh == 0) return(0); + if (v37) { + /* execute the command */ + MyTags[0].ti_Data = fh; + if (System(command, MyTags) != 0) + return NULL; + } else + Execute(command, 0, fh); /* close the holder file */ Close(fh); *************** *** 480,491 **** int system(const char *command) { ! debug(F110, "system called with command", command, 0L); ! #if V37 ! MyTags[0].ti_Data = DOSFH(1); ! return(System((UBYTE *) command, MyTags)); ! #else ! Execute((UBYTE *) command, 0, DOSFH(1)); ! return 0; ! #endif } --- 475,486 ---- int system(const char *command) { ! debug(F110, "system called with command", command, 0L); ! if (v37) { ! MyTags[0].ti_Data = DOSFH(1); ! return(System((UBYTE *) command, MyTags)); ! } else { ! Execute((UBYTE *) command, 0, DOSFH(1)); ! return 0; ! } }