mirror of
git://git.psyc.eu/libpsyc
synced 2024-08-15 03:19:02 +00:00
moved debug.h lib.h to src
This commit is contained in:
parent
ad23d4ea99
commit
ab8f70150e
14 changed files with 15 additions and 15 deletions
|
@ -1,85 +0,0 @@
|
|||
#ifndef DEBUG_H
|
||||
# define DEBUG_H
|
||||
|
||||
#ifdef DEBUG
|
||||
# include <stdio.h>
|
||||
# define PP(args) printf args;
|
||||
#else
|
||||
# define PP(args)
|
||||
#endif
|
||||
|
||||
#ifdef TEST
|
||||
# define PT(MSG) PP(MSG);
|
||||
# define DT(CODE) CODE
|
||||
#else
|
||||
# define PT(MSG)
|
||||
# define DT(CODE)
|
||||
#endif
|
||||
|
||||
/* simplified form of conditional compilation */
|
||||
|
||||
#ifndef DEBUG_FLAGS
|
||||
# ifdef DEBUG
|
||||
# if DEBUG == 1
|
||||
# define DEBUG_FLAGS 0x03
|
||||
# else
|
||||
# if DEBUG == 2
|
||||
# define DEBUG_FLAGS 0x07
|
||||
# else
|
||||
# if DEBUG == 3
|
||||
# define DEBUG_FLAGS 0x0f
|
||||
# else
|
||||
# if DEBUG == 4
|
||||
# define DEBUG_FLAGS 0x1f
|
||||
# else
|
||||
# define DEBUG_FLAGS 0x01
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
# else
|
||||
# define DEBUG_FLAGS 0x00 /* no debugging */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if DEBUG_FLAGS & 0x01
|
||||
# define D0(CODE) CODE
|
||||
# define P0(MSG) PP(MSG);
|
||||
#else
|
||||
# define D0(CODE)
|
||||
# define P0(MSG)
|
||||
#endif
|
||||
|
||||
#if DEBUG_FLAGS & 0x02
|
||||
# define D1(CODE) CODE
|
||||
# define P1(MSG) PP(MSG);
|
||||
#else
|
||||
# define D1(CODE)
|
||||
# define P1(MSG)
|
||||
#endif
|
||||
|
||||
#if DEBUG_FLAGS & 0x04
|
||||
# define D2(CODE) CODE
|
||||
# define P2(MSG) PP(MSG);
|
||||
#else
|
||||
# define D2(CODE)
|
||||
# define P2(MSG)
|
||||
#endif
|
||||
|
||||
#if DEBUG_FLAGS & 0x08
|
||||
# define D3(CODE) CODE
|
||||
# define P3(MSG) PP(MSG);
|
||||
#else
|
||||
# define D3(CODE)
|
||||
# define P3(MSG)
|
||||
#endif
|
||||
|
||||
#if DEBUG_FLAGS & 0x10
|
||||
# define D4(CODE) CODE
|
||||
# define P4(MSG) PP(MSG);
|
||||
#else
|
||||
# define D4(CODE)
|
||||
# define P4(MSG)
|
||||
#endif
|
||||
|
||||
#endif // DEBUG_H
|
|
@ -1,24 +0,0 @@
|
|||
/* this is needed to compile the library, not to use it */
|
||||
|
||||
#ifndef PSYC_LIB_H
|
||||
# define PSYC_LIB_H
|
||||
|
||||
#include "../psyc.h"
|
||||
#include "./debug.h"
|
||||
#include <assert.h>
|
||||
|
||||
/* perlisms for readability */
|
||||
#define unless(COND) if (!(COND))
|
||||
#define until(COND) while (!(COND))
|
||||
|
||||
#define PSYC_NUM_ELEM(a) (sizeof(a) / sizeof(*(a)))
|
||||
|
||||
#if !defined(__USE_GNU) && !(defined(__FBSDID) && defined(__BSD_VISIBLE))
|
||||
void * memmem(const void *l, size_t l_len, const void *s, size_t s_len);
|
||||
#endif
|
||||
|
||||
#if !defined(__USE_GNU) && !(defined(__FBSDID) && defined(__BSD_VISIBLE))
|
||||
int itoa(int number, char* out, int base);
|
||||
#endif
|
||||
|
||||
#endif // PSYC_LIB_H
|
Loading…
Add table
Add a link
Reference in a new issue