source: abuse/tags/pd/macabuse/imlib/dprint.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: 693 bytes
Line 
1#include <stdlib.h>
2#ifdef __WATCOMC__
3#include "i86.h"
4#endif
5#include <stdarg.h>
6#include <stdio.h>
7#include "macs.hpp"
8
9void  (*dprint_fun)(char *)=NULL;
10void  (*dget_fun)(char *,int)=NULL;
11
12void set_dprinter(void (*stat_fun)(char *))
13{
14  dprint_fun=stat_fun;
15}
16
17void set_dgetter(void (*stat_fun)(char *,int))
18{
19  dget_fun=stat_fun;
20}
21
22void dprintf(const char *format, ...)
23{
24  if (dprint_fun)
25  {
26    char st[1000],a,*sp;
27    int y;
28    va_list ap;
29    va_start(ap, format);
30    vsprintf(st,format,ap);
31    va_end(ap);
32    dprint_fun(st);
33  }
34}
35
36
37void dgets(char *buf, int size)
38{
39  if (dget_fun)
40  {
41    dget_fun(buf,size);
42  } else
43    ERROR(0,"dgets called but no handler set up"); 
44}
Note: See TracBrowser for help on using the repository browser.