projects
/
SXSI
/
TextCollection.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Debug swcsa
[SXSI/TextCollection.git]
/
swcsa
/
utils
/
basics.h
diff --git
a/swcsa/utils/basics.h
b/swcsa/utils/basics.h
index
6e4b39b
..
c9089cc
100755
(executable)
--- a/
swcsa/utils/basics.h
+++ b/
swcsa/utils/basics.h
@@
-1,11
+1,15
@@
// Basics
// Basics
-
+
#ifndef BASICSINCLUDED
#define BASICSINCLUDED
#ifndef BASICSINCLUDED
#define BASICSINCLUDED
- // Includes
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ // Includes
#include <sys/types.h>
#include <stdio.h>
#include <sys/types.h>
#include <stdio.h>
@@
-19,13
+23,13
@@
// Memory management
// 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
// Data types
@@
-49,7
+53,7
@@
void *Realloc (void *p, int n);
#define W (32)
// bits needed to represent a number between 0 and 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
// 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
@@
-108,5
+112,8
@@
void bitzero2 (uint *e, uint p, uint len);
} \
} \
}
} \
} \
}
+#ifdef __cplusplus
+ }
+#endif
#endif
#endif