X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=swcsa%2Futils%2Fbasics.h;h=6e4b39b9de691924b049b46233ab92660f6d2fba;hb=a56dda3a95d2df268969bd3c2c994b5d2f020410;hp=8e2f8200ae4c2ce30973eea261d1690b785b2bb4;hpb=72aa11ca7df7975f650344e8904a1a690be2480e;p=SXSI%2FTextCollection.git diff --git a/swcsa/utils/basics.h b/swcsa/utils/basics.h index 8e2f820..6e4b39b 100755 --- a/swcsa/utils/basics.h +++ b/swcsa/utils/basics.h @@ -5,10 +5,6 @@ #ifndef BASICSINCLUDED #define BASICSINCLUDED -#ifdef __cplusplus -extern "C" { -#endif - // Includes #include @@ -23,13 +19,13 @@ extern "C" { // Memory management - //#define malloc(n) Malloc(n) - //#define free(p) Free(p) - //#define realloc(p,n) Realloc(p,n) +#define malloc(n) Malloc(n) +#define free(p) Free(p) +#define realloc(p,n) Realloc(p,n) -static void *Malloc (size_t n); -static void Free (void *p); -static void *Realloc (void *p, size_t n); +void *Malloc (int n); +void Free (void *p); +void *Realloc (void *p, int n); // Data types @@ -53,7 +49,7 @@ static void *Realloc (void *p, size_t n); #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 @@ -112,8 +108,5 @@ void bitzero2 (uint *e, uint p, uint len); } \ } \ } -#ifdef __cplusplus - } -#endif #endif