diff --git a/kern.asm b/kern.asm old mode 100755 new mode 100644 diff --git a/kern.h b/kern.h old mode 100755 new mode 100644 index 6344225..978a784 --- a/kern.h +++ b/kern.h @@ -1,12 +1,12 @@ -/* kern.h Assembler Routinen 20-Nov-93 */ -extern int IPXinit(void); -extern int IPXopen_socket(UI sock, int live); -extern void IPXclose_socket(UI sock); -extern int IPXlisten(ECB *ecb); -extern void asm_esr_routine(void); -extern void esr_routine(ECB *ecb); -extern void xmemmove(void *ziel, void *quelle, UI anz); -extern int Net_Call(UI func, void *req, void *repl); - - - +/* kern.h Assembler Routinen 20-Nov-93 */ +extern int IPXinit(void); +extern int IPXopen_socket(UI sock, int live); +extern void IPXclose_socket(UI sock); +extern int IPXlisten(ECB *ecb); +extern void asm_esr_routine(void); +extern void esr_routine(ECB *ecb); +extern void xmemmove(void *ziel, void *quelle, UI anz); +extern int Net_Call(UI func, void *req, void *repl); + + + diff --git a/login.c b/login.c old mode 100755 new mode 100644 index c479f2b..dbc4974 --- a/login.c +++ b/login.c @@ -391,9 +391,17 @@ int func_exec(int argc, char *argv[], int mode) xfree(buff); if (nargv != NULL) { if (!mode) +#ifdef __WATCOMC__ + spawnvp(P_WAIT, buf, (const char * const *)nargv); +#else spawnvp(P_WAIT, buf, nargv); +#endif else +#ifdef __WATCOMC__ + execvp(buf, (const char * const *)nargv); +#else execvp(buf, nargv); +#endif } xfree(buf); } diff --git a/makefile.bcc b/makefile.bcc old mode 100755 new mode 100644 diff --git a/map.c b/map.c old mode 100755 new mode 100644 diff --git a/ncpcall.c b/ncpcall.c old mode 100755 new mode 100644 diff --git a/net.c b/net.c old mode 100755 new mode 100644 diff --git a/net.h b/net.h old mode 100755 new mode 100644 index ad1afce..eb7bfe1 --- a/net.h +++ b/net.h @@ -15,6 +15,9 @@ #include #include #include +#ifdef __WATCOMC__ +#include +#endif typedef unsigned int UI; typedef unsigned int uint; @@ -135,6 +138,12 @@ extern void leb(uint8 *s); extern char *getglobenv(char *option); extern int putglobenv(char *option); +#ifdef __WATCOMC__ +/* Borland C compatibility wrappers implemented in tools.c. */ +extern int getcurdir(int drive, char *directory); +extern void setdisk(int drive); +#endif + /* NETCALLS */ #define DRIVE_ADD 1 #define DRIVE_INSERT 2 @@ -159,6 +168,12 @@ extern int neterrno; alloc_dir_handle(0x13, (dhandle), (path), (drive), (rights)) extern int ipx_init(void); +extern int logout(void); +extern int redir_device_drive(int devicetyp, uint8 *devname, uint8 *remotename); +extern int list_redir(int index, int *devicetyp, uint8 *devname, uint8 *remotename); +extern int get_drive_info(uint8 drivenumber, uint8 *connid, + uint8 *dhandle, uint8 *statusflags); +extern int get_fs_name(int connid, char *name); extern int alloc_dir_handle(int func, int dhandle, char *path, int driveletter, uint8 *effrights); @@ -179,11 +194,13 @@ extern int ncp_16_02(int dirhandle, uint32 *creattime, uint32 *owner_id); +extern int ncp_14_46(uint32 *obj_id); extern int ncp_17_02(int module, int debuglevel); extern int ncp_17_14(uint8 *objname, uint16 objtyp, uint8 *password); extern int ncp_17_17(uint8 *key); extern int ncp_17_18(uint8 *cryptkey, uint8 *objname, uint16 objtyp); extern uint32 ncp_17_35(uint8 *objname, uint16 objtyp); +extern int ncp_17_36(uint32 obj_id, uint8 *objname, uint16 *objtyp); extern int ncp_17_40(uint8 *objname, uint16 objtyp, uint8 *password, uint8 *newpassword); @@ -193,6 +210,7 @@ extern int ncp_17_4b(uint8 *cryptkey, uint8 *objname, uint16 objtyp, /* map.c */ extern int func_map (int argc, char *argv[], int mode); extern int func_path (int argc, char *argv[], int mode); +extern void remove_nwpathes(void); /* login.c */ extern int func_login (int argc, char *argv[], int mode); diff --git a/netcall.c b/netcall.c old mode 100755 new mode 100644 diff --git a/nwcrypt.c b/nwcrypt.c old mode 100755 new mode 100644 diff --git a/nwcrypt.h b/nwcrypt.h old mode 100755 new mode 100644 diff --git a/nwdebug.c b/nwdebug.c old mode 100755 new mode 100644 diff --git a/nwtests.c b/nwtests.c old mode 100755 new mode 100644 diff --git a/slist.c b/slist.c old mode 100755 new mode 100644 diff --git a/teste.c b/teste.c old mode 100755 new mode 100644 index 7d6711e..c6fcc99 --- a/teste.c +++ b/teste.c @@ -1,95 +1,95 @@ -int main() -{ - char *fn="F.$LN"; - char *string="ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz"; - int result; - struct stat stbuff; - long offset; - char buff[1024]; - char readbuff[500]; - int j; - int fd=creatnew(fn, S_IREAD |S_IWRITE); - if (fd > -1) { - printf("Konnte Date erzeugen\n"); - close(fd); - } else { - printf("Konnte Datei nicht erzeugen\n"); - } - fd = open(fn, O_RDWR|O_CREAT|O_TRUNC|O_DENYNONE, 0666); - memset(buff, 0, sizeof(buff) ); - strcpy(buff, string); - write(fd, buff, strlen(buff)); - close(fd); - _chmod(fn, 1, _chmod(fn, 0) | 0x80 ); - stat(fn, &stbuff); - printf("Filesize ber stat =%ld\n", stbuff.st_size); - fd = open(fn, O_RDWR | O_BINARY |O_DENYNONE); - - offset = lseek(fd, 0L, SEEK_END); - printf("Filesize ber lseek =%ld\n", offset); - write(fd, buff, strlen(buff)); - - lseek(fd, 0L, SEEK_SET); - for (j=0; j < strlen(buff)*2; j++){ - read(fd, readbuff, 1); - printf("BUFF = %c\n", readbuff[0]); - } - lseek(fd, 1L, SEEK_SET); - for (j = 0; j < 20; j++){ - write(fd, buff+j, 1); - } - - for (j=0; j <60; j++){ - lseek(fd, (long) j, SEEK_SET); - read(fd, readbuff, 2); - printf("BUFF = %c, %c \n", readbuff[0], readbuff[1]); - } - - lseek(fd, 10L, SEEK_SET); - read(fd, buff, 1); - printf("BUFF[10] = %c\n", buff[0]); - result=lock(fd, 100L, 1L); - printf("lock result = %d\n", result); - result=unlock(fd, 100L, 1L); - printf("unlock result = %d\n", result); - close(fd); - - fd = open(fn, O_BINARY|O_RDWR|O_CREAT|O_TRUNC|O_DENYNONE, 0666); - if (fd > -1) { - int bufflen; - strcpy(buff, "d:..\\marlib\\c0l.obj+"); - strcat(buff, "\r\n"); - strcat(buff, "x"); - strcat(buff, "\r\n"); - strcat(buff, "x"); - strcat(buff, "\r\n"); - strcat(buff, "/c/x"); - strcat(buff, "\r\n"); - strcat(buff, "d:..\\marlib\\EMU.LIB+"); - strcat(buff, "\r\n"); - strcat(buff, "d:..\\marlib\\mathl.lib+"); - strcat(buff, "\r\n"); - strcat(buff, "d:..\\marlib\\cl.lib"); - bufflen=strlen(buff); - printf("bufflen = %d, buff=%s\n", bufflen, buff); - write(fd, buff, bufflen); - close(fd); - fd = open(fn, O_TEXT|O_RDONLY); - if (fd > -1) { - char *p=readbuff; - int anz = 0; - memset(readbuff, 0, sizeof(readbuff) ); - while (read(fd, p, 1) == 1){ - anz++; - p++; - } - printf("read = %d, buff=%s\n", anz, readbuff); - close(fd); - } - } - /* - result = detach(1); - printf("Detach result=0x%x", result); - */ - return(0); -} +int main() +{ + char *fn="F.$LN"; + char *string="ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz"; + int result; + struct stat stbuff; + long offset; + char buff[1024]; + char readbuff[500]; + int j; + int fd=creatnew(fn, S_IREAD |S_IWRITE); + if (fd > -1) { + printf("Konnte Date erzeugen\n"); + close(fd); + } else { + printf("Konnte Datei nicht erzeugen\n"); + } + fd = open(fn, O_RDWR|O_CREAT|O_TRUNC|O_DENYNONE, 0666); + memset(buff, 0, sizeof(buff) ); + strcpy(buff, string); + write(fd, buff, strlen(buff)); + close(fd); + _chmod(fn, 1, _chmod(fn, 0) | 0x80 ); + stat(fn, &stbuff); + printf("Filesize ber stat =%ld\n", stbuff.st_size); + fd = open(fn, O_RDWR | O_BINARY |O_DENYNONE); + + offset = lseek(fd, 0L, SEEK_END); + printf("Filesize ber lseek =%ld\n", offset); + write(fd, buff, strlen(buff)); + + lseek(fd, 0L, SEEK_SET); + for (j=0; j < strlen(buff)*2; j++){ + read(fd, readbuff, 1); + printf("BUFF = %c\n", readbuff[0]); + } + lseek(fd, 1L, SEEK_SET); + for (j = 0; j < 20; j++){ + write(fd, buff+j, 1); + } + + for (j=0; j <60; j++){ + lseek(fd, (long) j, SEEK_SET); + read(fd, readbuff, 2); + printf("BUFF = %c, %c \n", readbuff[0], readbuff[1]); + } + + lseek(fd, 10L, SEEK_SET); + read(fd, buff, 1); + printf("BUFF[10] = %c\n", buff[0]); + result=lock(fd, 100L, 1L); + printf("lock result = %d\n", result); + result=unlock(fd, 100L, 1L); + printf("unlock result = %d\n", result); + close(fd); + + fd = open(fn, O_BINARY|O_RDWR|O_CREAT|O_TRUNC|O_DENYNONE, 0666); + if (fd > -1) { + int bufflen; + strcpy(buff, "d:..\\marlib\\c0l.obj+"); + strcat(buff, "\r\n"); + strcat(buff, "x"); + strcat(buff, "\r\n"); + strcat(buff, "x"); + strcat(buff, "\r\n"); + strcat(buff, "/c/x"); + strcat(buff, "\r\n"); + strcat(buff, "d:..\\marlib\\EMU.LIB+"); + strcat(buff, "\r\n"); + strcat(buff, "d:..\\marlib\\mathl.lib+"); + strcat(buff, "\r\n"); + strcat(buff, "d:..\\marlib\\cl.lib"); + bufflen=strlen(buff); + printf("bufflen = %d, buff=%s\n", bufflen, buff); + write(fd, buff, bufflen); + close(fd); + fd = open(fn, O_TEXT|O_RDONLY); + if (fd > -1) { + char *p=readbuff; + int anz = 0; + memset(readbuff, 0, sizeof(readbuff) ); + while (read(fd, p, 1) == 1){ + anz++; + p++; + } + printf("read = %d, buff=%s\n", anz, readbuff); + close(fd); + } + } + /* + result = detach(1); + printf("Detach result=0x%x", result); + */ + return(0); +}