Commit 6349196e authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(isc_putc): Handle struct isc_scb_internal.

(isc_write): Handle struct isc_scb_internal.
parent 3bb04699
...@@ -40,17 +40,20 @@ ...@@ -40,17 +40,20 @@
#include "s-string.h" #include "s-string.h"
#include "isc.h" #include "isc.h"
#include "intern.h"
int int
isc_putc(int chr, isc_putc(int chr,
struct isc_scb *scb) struct isc_scb *session)
{ {
struct isc_scb_internal *scb = (struct isc_scb_internal*)session;
if (scb->state != ISC_STATE_DISABLED && if (scb->state != ISC_STATE_DISABLED &&
scb->state != ISC_STATE_RUNNING) scb->state != ISC_STATE_RUNNING)
return EOF; return EOF;
while (scb->sendindex == sizeof(scb->sendbuf)) while (scb->sendindex == sizeof(scb->sendbuf))
isc_flush(scb); isc_flush(session);
return scb->sendbuf[scb->sendindex++] = chr; return scb->sendbuf[scb->sendindex++] = chr;
} }
...@@ -58,7 +61,7 @@ isc_putc(int chr, ...@@ -58,7 +61,7 @@ isc_putc(int chr,
int int
isc_write(struct isc_scb * scb, isc_write(struct isc_scb *session,
const void * buffer, const void * buffer,
size_t length) size_t length)
{ {
...@@ -66,6 +69,7 @@ isc_write(struct isc_scb * scb, ...@@ -66,6 +69,7 @@ isc_write(struct isc_scb * scb,
int len; int len;
int blen; int blen;
int clen; int clen;
struct isc_scb_internal *scb = (struct isc_scb_internal*)session;
if (scb->state != ISC_STATE_DISABLED && if (scb->state != ISC_STATE_DISABLED &&
...@@ -82,7 +86,7 @@ isc_write(struct isc_scb * scb, ...@@ -82,7 +86,7 @@ isc_write(struct isc_scb * scb,
/* Make room in sendbuf */ /* Make room in sendbuf */
while (blen == 0) while (blen == 0)
{ {
isc_flush(scb); isc_flush(&scb->pub);
blen = sizeof(scb->sendbuf) - scb->sendindex; blen = sizeof(scb->sendbuf) - scb->sendindex;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment