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

Last change on this file since 682 was 555, checked in by Sam Hocevar, 10 years ago

ps3: make everything compile on the PS3. Of course, nothing links yet
because so much support is missing.

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