source: abuse/trunk/src/imlib/dprint.cpp @ 56

Last change on this file since 56 was 56, checked in by Sam Hocevar, 15 years ago
  • Add licensing terms to most C / C++ files (Ref #5).
File size: 909 bytes
Line 
1/*
2 *  Abuse - dark 2D side-scrolling platform game
3 *  Copyright (c) 1995 Crack dot Com
4 *
5 *  This software was released into the Public Domain. As with most public
6 *  domain software, no warranty is made or implied by Crack dot Com or
7 *  Jonathan Clark.
8 */
9
10#include "config.h"
11
12#include <stdlib.h>
13#include <stdarg.h>
14#include <stdio.h>
15
16#include "macs.hpp"
17
18void  (*dprint_fun)(char *) = NULL;
19void  (*dget_fun)(char *,int) = NULL;
20
21void set_dprinter(void (*stat_fun)(char *))
22{
23        dprint_fun = stat_fun;
24}
25
26void set_dgetter(void (*stat_fun)(char *,int))
27{
28        dget_fun = stat_fun;
29}
30
31void dprintf(const char *format, ...)
32{
33        if (dprint_fun)
34        {
35                char st[1000];
36                va_list ap;
37
38                va_start(ap, format);
39                vsprintf(st,format,ap);
40                va_end(ap);
41                dprint_fun(st);
42        }
43}
44
45
46void dgets(char *buf, int size)
47{
48        if (dget_fun)
49        {
50                dget_fun(buf,size);
51        }
52        else
53        {
54                ERROR(0,"dgets called but no handler set up");
55        }
56}
Note: See TracBrowser for help on using the repository browser.