Initial commit

This commit is contained in:
Artur Meski
2019-02-22 17:33:33 +00:00
parent 4eb029f91e
commit 6a17587378
43 changed files with 9703 additions and 0 deletions

31
macro.h Normal file
View File

@@ -0,0 +1,31 @@
#ifndef _INC_MACRO_H_
#define _INC_MACRO_H_
static inline void *smalloc(size_t size)
{
void *p;
p = malloc(size);
if (!p) {
printf("malloc failed!\n");
exit(1);
}
return p;
}
static inline void *smalloc_zero(size_t size)
{
void *p;
p = smalloc(size);
memset(p, 0, size);
return p;
}
/* Dodatkowe na czas debugowania, smieciowe... */
#define DBP printf("DEBUG POINT (%s), line %d reached\n", __FILE__, __LINE__);
#define DBMPR(t, d) { printf("\n(line=%d) %s\n", __LINE__, (t)); dbm_print((d), dbm_size); printf("\n"); }
#endif /* !_INC_MACRO_H_ */