// Basics
-
+
#ifndef BASICSINCLUDED
#define BASICSINCLUDED
- // Includes
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ // Includes
#include <sys/types.h>
#include <stdio.h>
// Memory management
-#define malloc(n) Malloc(n)
-#define free(p) Free(p)
-#define realloc(p,n) Realloc(p,n)
+#define malloc(n) Malloc_(n,__LINE__,__FILE__)
+#define free(p) Free_(p,__LINE__,__FILE__)
+#define realloc(p,n) Realloc_(p,n,__LINE__,__FILE__)
-void *Malloc (int n);
-void Free (void *p);
-void *Realloc (void *p, int n);
+void *Malloc_ (size_t n, size_t l, char * file);
+void Free_ (void *p, size_t l, char * file);
+void *Realloc_ (void *p, size_t n, size_t l, char * file);
// Data types
#define W (32)
// bits needed to represent a number between 0 and n
-uint bits (uint n);
+uint _bits (uint n);
// returns e[p..p+len-1], assuming len <= W
uint bitread (uint *e, uint p, uint len);
// writes e[p..p+len-1] = s, assuming len <= W
} \
} \
}
+#ifdef __cplusplus
+ }
+#endif
#endif