source: abuse/branches/pd/imlib/port/svga/monoprnt.c @ 528

Last change on this file since 528 was 49, checked in by Sam Hocevar, 15 years ago
  • Imported original public domain release, for future reference.
  • Property svn:keywords set to Id
File size: 567 bytes
Line 
1#include <stdio.h>
2#include <stdarg.h>
3#include <unistd.h>
4#include <sys/types.h>
5#include <fcntl.h>
6#include <stdlib.h>
7#include "macs.hpp"
8
9int monofd=-1;
10
11void openmono()
12{ monofd=open("/dev/tty8",O_WRONLY);
13  CONDITION(monofd!=-1,"unable to open debug tty\n");
14}
15
16void mnclear()
17{ if (monofd<0) openmono();
18  int i;
19  for (i=0;i<25;i++);
20    write(monofd,"\n",1);
21}
22
23void mnprintf(const char *format, ...)
24{
25  char st[200];
26  va_list ap;
27  va_start(ap, format);
28  vsprintf(st,format,ap);
29  va_end(ap);
30  if (monofd<0) openmono();
31  write(monofd,st,strlen(st));
32}
Note: See TracBrowser for help on using the repository browser.