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

Last change on this file since 494 was 494, checked in by Sam Hocevar, 12 years ago

style: remove trailing spaces, fix copyright statements.

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