fixed the bitmap loader. Implemented the new bitmap loader into
[neuro.git] / src / debug.c
blob872c728c0414a245e6582a110075a1df8362ad45
2 /*
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
22 /* debug.c
23 * Module : Dbg_
26 /*--- Extern Headers Including ---*/
27 #include <stdio.h>
28 #include <stdarg.h>
29 #include <stdlib.h>
30 /*--- Local Headers Including ---*/
32 /*--- Main Module Header ---*/
33 #include "debug.h"
35 /*--- Global Variables ---*/
37 /*--- Static Variables ---*/
38 static u8 debug_level = 0;
40 /*--- Static Prototypes ---*/
42 /*--- Static Functions ---*/
44 /*--- Global Functions ---*/
46 /*void
47 Neuro_DebugPrint(char *filename, char *funcName, u32 lineNum, const char *control, ...)
49 void
50 Neuro_DebugPrint(char *type, char *control, char *filename, char *funcName, u32 lineNum)
53 va_list args;
54 char *msg = calloc(1, 520);
56 va_start(args, control);
57 vasprintf(msg, control, args);
58 va_end(args);
60 fprintf(stderr, "%s : %s:%s:%d -- %s\n", type, filename, funcName, lineNum, control);
61 /* fprintf(stderr, "%s\n", control); */
63 /* free(msg); */
66 /* */
67 void
68 Debug_Val(u8 level, char *control, ...)
70 va_list args;
71 /* char *msg;*/
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);
79 va_end(args);
81 /* free(msg); */
85 void
86 Neuro_SetDebugLevel(u8 level)
88 debug_level = level;
91 int
92 IsLittleEndian()
94 int i = 1;
95 char *p;
97 p = (char*)&i;
98 if (p[0] == 1)
99 return 1;
100 else
101 return 0;
104 /*--- Poll ---*/
106 /*--- Constructor Destructor ---*/