3 * libneuro, a light weight abstraction of high or lower libraries
4 * and toolkit for applications.
5 * Copyright (C) 2005-2006 Nicholas Niro, Robert Lemay
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 /*--- Extern Headers Including ---*/
30 /*--- Local Headers Including ---*/
32 /*--- Main Module Header ---*/
35 /*--- Global Variables ---*/
37 /*--- Static Variables ---*/
38 static u8 debug_level
= 0;
40 /*--- Static Prototypes ---*/
42 /*--- Static Functions ---*/
44 /*--- Global Functions ---*/
47 Neuro_DebugPrint(char *filename, char *funcName, u32 lineNum, const char *control, ...)
50 Neuro_DebugPrint(char *type
, char *control
, char *filename
, char *funcName
, u32 lineNum
)
54 char *msg = calloc(1, 520);
56 va_start(args, control);
57 vasprintf(msg, control, args);
60 fprintf(stderr
, "%s : %s:%s:%d -- %s\n", type
, filename
, funcName
, lineNum
, control
);
61 /* fprintf(stderr, "%s\n", control); */
68 Debug_Val(u8 level
, char *control
, ...)
73 if (debug_level
>= level
)
75 /* msg = calloc(1, 520); */
76 va_start(args
, control
);
77 /* vasprintf(msg, control, args); */
78 vfprintf(stderr
, control
, args
);
86 Neuro_SetDebugLevel(u8 level
)
106 /*--- Constructor Destructor ---*/