Commit b3a1c847 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(isc_puts): New function.

(isc_putul): New function.
parent 5c7f7e33
......@@ -512,6 +512,18 @@ extern int
isc_putc(int chr,
IscSession * scb);
/*
** Put a NUL-terminated string on the transmit queue (the NUL is not sent).
*/
extern int
isc_puts(const char *str,
IscSession *scb);
/*
** Put a decimal representation of ``nr'' on the transmit queue.
*/
extern int isc_putul(unsigned long nr, IscSession *scb);
#ifdef ISC_PRINTF_SUPPORT
......
......@@ -83,6 +83,34 @@ isc_write(IscSession * scb,
return length;
}
int
isc_puts(const char *str,
IscSession *scb)
{
return isc_write(scb, str, strlen(str));
}
int
isc_putul(unsigned long nr,
IscSession *scb)
{
static char buf[sizeof(unsigned long) * 3 + 1];
char *cp;
if (nr < 10)
return isc_putc("0123456789"[nr], scb);
else
{
cp = buf + sizeof(buf);
while (nr > 0)
{
*--cp = (nr % 10) + '0';
nr /= 10;
}
return isc_write(scb, cp, buf + sizeof(buf) - cp);
}
}
#ifdef ISC_PRINTF_SUPPORT
......
Markdown is supported
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