add a missing section header table index conversion
[tangerine.git] / compiler / arossupport / rkprintf.c
blob62febcda3f91aa6a14826b3be3a76288f9c301e7
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Formats a message and makes sure the user will see it.
6 Lang: english
7 */
9 #include <aros/config.h>
10 #include <aros/arossupportbase.h>
11 #include <stdarg.h>
12 #include <stdlib.h>
13 #include <string.h>
14 #include <aros/system.h>
15 #include <proto/exec.h>
16 #include <proto/arossupport.h>
17 #undef rkprintf
18 #include <unistd.h>
20 #define AROSBase ((struct AROSBase *)(SysBase->DebugAROSBase))
22 /* Can't use ctypt.h *sigh* */
23 #define isdigit(x) ((x) >= '0' && (x) <= '9')
24 #define isprint(x) (((x) >= ' ' && (x) <= 128) || (x) >= 160)
26 /*****************************************************************************
28 NAME */
29 #include <proto/arossupport.h>
31 int rkprintf (
33 /* SYNOPSIS */
34 const STRPTR mainSystem,
35 const STRPTR subSystem,
36 int level,
37 const UBYTE * fmt,
38 ...)
40 /* FUNCTION
41 Call kprintf if debugging for this main and subsystem is enabled
42 at a level larger than the level above. The minimal level is 1
43 (this way, debugging can be disabled in the debug config file
44 by giving a level of 0).
46 You should not call this function directly but use the rbug
47 macro. The rbug macro does some magic to make the handling
48 more simple.
50 INPUTS
51 mainSystem - The main system. Use one of the DBG_MAINSYSTEM_*
52 macros to avoid typos.
53 subSystem - The part of the main system. Use one of the
54 DBG_*_SUBSYSTEM_* macros.
55 level - The debug level. Higher levels should give more details.
56 The lowest level is 1.
57 fmt - printf()-style format string
59 RESULT
60 The number of characters output.
62 NOTES
63 This function is not part of a library and may thus be called
64 any time.
66 EXAMPLE
67 if (cache)
69 ...
70 D(rbug(INTUITION, INPUTHANDLER, 3,
71 "allocating event from cache (%p)", event
72 ));
73 ...
76 BUGS
78 SEE ALSO
80 INTERNALS
82 HISTORY
83 24-12-95 digulla created
85 ******************************************************************************/
87 va_list ap;
88 int ret;
90 #warning FIXME check the systems and the debug level
91 // Check SysBase->DebugAROSBase->DebugConfig
93 va_start(ap, fmt);
94 ret = vkprintf(fmt, ap);
95 va_end(ap);
97 return ret;