diff options
| author | B. Watson <urchlay@slackware.uk> | 2026-03-28 07:26:46 -0400 |
|---|---|---|
| committer | B. Watson <urchlay@slackware.uk> | 2026-03-28 07:26:46 -0400 |
| commit | 87b234ba73e9abb4ecb8966ef631a0d7b8f5915a (patch) | |
| tree | 8435c18071937d092e3265bb4c708caab24b9135 /src/nio.h | |
| parent | 898cfeb8a558245fc48bbba948c16205509e6a11 (diff) | |
| download | fujinet-chat-87b234ba73e9abb4ecb8966ef631a0d7b8f5915a.tar.gz | |
Save some more bytes (strip down nio.c API).
Diffstat (limited to 'src/nio.h')
| -rw-r--r-- | src/nio.h | 51 |
1 files changed, 6 insertions, 45 deletions
@@ -22,51 +22,12 @@ #define DVSTAT_PROTOCOL 2 #define DVSTAT_EXTENDED_ERROR 3 -/** - * Open N: device with devicespec - * @param devicespec - an N: device spec, e.g. N:TCP://FOO.COM:1234/ - * @param translation mode, 0=none, 1=cr, 2=lf, 3=cr/lf - * @return error code, or 1 if successful. - */ -unsigned char nopen(char* devicespec, unsigned char trans); - -/** - * Close N: device with devicespec - * @param devicespec - an N: device spec to close (the unit number is extracted) - * @return error code, or 1 if successful. - */ -unsigned char nclose(char* devicespec); - -/** - * Get status of specific N: device - * @param devicespec - an N: device spec to status (the unit number is extracted) - * @return error code, or 1 if successful, DVSTAT is also filled with status info. - * - * Format of DVSTAT: - * OS.dcb.dvstat[0] = # of bytes waiting LO - * OS.dcb.dvstat[1] = # of bytes waiting HI - * OS.dcb.dvstat[2] = reserved - * OS.dcb.dvstat[3] = Error code of last I/O operation. !1 = error. - */ -unsigned char nstatus(char* devicespec); - -/** - * Read # of bytes from specific N: device. - * @param devicespec - an N: device spec to read bytes from. - * @param buf - The buffer to read into, must be at least as big as len. - * @param len - The # of bytes to read (up to 65535) - * @return error code, or 1 if successful, buf is filled with data. - */ -unsigned char nread(char* devicespec, unsigned char* buf, unsigned short len); - -/** - * Write # of bytes to specific N: device. - * @param devicespec - an N: device spec to write to. - * @param buf - The buffer to write to device, should be at least as big as len. - * @param len - The # of bytes to write (up to 65535) - * @return error code, or 1 if successful, buf is filled with data. - */ -unsigned char nwrite(char* devicespec, unsigned char* buf, unsigned short len); +char nopen(void); +char nclose(void); +char nstatus(void); +char nread(char *buf, unsigned short len); +char nwrite(char *buf, unsigned short len); +char nreset(void); /** * Send username and password credentials |
