|
|
1.1 ! root 1: #ifdef SBBS ! 2: #include "sbbs.h" ! 3: static sbbs_t *sbbs=NULL; ! 4: #else ! 5: #include <stdio.h> ! 6: #endif ! 7: ! 8: void con_init(void *sptr) ! 9: { ! 10: #ifdef SBBS ! 11: sbbs=(sbbs_t *)sptr; ! 12: #endif ! 13: } ! 14: ! 15: void con_write(char *str, size_t len) ! 16: { ! 17: #ifdef SBBS ! 18: for(int i=0; i<len; i++) ! 19: sbbs->outchar(str[i]); ! 20: #else ! 21: fwrite(str, len, 1, stdout); ! 22: #endif ! 23: } ! 24: ! 25: int con_getchar(void) ! 26: { ! 27: #ifdef SBBS ! 28: int ch=NOINP; ! 29: while(ch==NOINP) ! 30: sbbs->incom(1000); ! 31: return ch; ! 32: #else ! 33: return(getchar()); ! 34: #endif ! 35: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.