File:  [Synchronet] / sbbs / src / conio / sbbsio.cpp
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:41:23 2018 UTC (8 years, 3 months ago) by root
Branches: digitaldynamics, MAIN
CVS tags: v_315b, v_314a, HEAD
3.14a

#ifdef SBBS
#include "sbbs.h"
static sbbs_t *sbbs=NULL;
#else
#include <stdio.h>
#endif

void con_init(void *sptr)
{
#ifdef SBBS
	sbbs=(sbbs_t *)sptr;
#endif
}

void con_write(char *str, size_t len)
{
#ifdef SBBS
    for(int i=0; i<len; i++)
        sbbs->outchar(str[i]);
#else
    fwrite(str, len, 1, stdout);
#endif
}

int con_getchar(void)
{
#ifdef SBBS
    int ch=NOINP;
    while(ch==NOINP)
        sbbs->incom(1000);
    return ch;
#else
    return(getchar());
#endif
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.