All pastes #274868 Raw Edit

Something

public c v1 · immutable
·published 2006-12-11 00:51 UTC
rendered paste body
#include "bios.h"#include "conio.h"char getc (){  return bios_getc ();}void putc (char c){  bios_putc (c);  if (c == '\n')    bios_putc ('\r');}void puts (char *s){  while (*s)    putc (*s++);}void gets (char *s, unsigned int len){  register unsigned int index = 0;  register char in;  while (index < len)  {    in = getc ();    putc (in);    if (in == '\r')    {      putc ('\n');      break;    }    else if (in == '\b')    {      putc (' ');      if (index)      {	putc ('\b');        index--;      }      continue;    }    s[index++] = in;  }  s[index] = '\0';  /* Emulate that the person went to the next line, if we run out of space. */  if (index == len)    putc ('\n');}/* vim:et:sta:set ts=8 sw=2: */