source: libabac/abac_util.h @ b8a6c918

abac0-leak
Last change on this file since b8a6c918 was 44c8505, checked in by Ted Faber <faber@…>, 10 years ago

Make chunk operations take pointers.

  • Property mode set to 100644
File size: 672 bytes
Line 
1#ifndef __UTIL_H__
2#define __UTIL_H__
3
4#include <sys/types.h>
5#include <stdlib.h>
6
7#ifndef __ABAC_CHUNK_T__
8#define __ABAC_CHUNK_T__
9typedef struct _abac_chunk_t {
10    unsigned char *ptr;
11    int len;
12} abac_chunk_t;
13
14void abac_chunk_free(abac_chunk_t *);
15int abac_chunk_null(abac_chunk_t *);
16int abac_chunk_show(abac_chunk_t *);
17
18#endif /* __ABAC_CHUNK_T__ */
19
20
21void *abac_xmalloc(size_t);
22char *abac_xstrdup(char *);
23void *abac_xrealloc(void *, size_t);
24void abac_split(char *string, char *delim, char **ret, int *num);
25
26#ifdef DEBUG
27#define debug_printf(...) fprintf(stderr, __VA_ARGS__)
28#else
29#define debug_printf(...) do { } while (0)
30#endif
31
32#endif /* __UTIL_H__ */
Note: See TracBrowser for help on using the repository browser.