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

Last change on this file since 128 was 124, checked in by Sam Hocevar, 15 years ago
  • Get rid of ugly tabs and trailing spaces everywhere.
File size: 990 bytes
RevLine 
[56]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
[2]12#include <stdlib.h>
13#include <stdarg.h>
14#include <stdio.h>
[56]15
[2]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{
[124]23    dprint_fun = stat_fun;
[2]24}
25
26void set_dgetter(void (*stat_fun)(char *,int))
27{
[124]28    dget_fun = stat_fun;
[2]29}
30
31void dprintf(const char *format, ...)
32{
[124]33    if (dprint_fun)
34    {
35        char st[1000];
36        va_list ap;
[2]37
[124]38        va_start(ap, format);
39        vsprintf(st,format,ap);
40        va_end(ap);
41        dprint_fun(st);
42    }
[2]43}
44
45
46void dgets(char *buf, int size)
47{
[124]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    }
[2]56}
Note: See TracBrowser for help on using the repository browser.