source: libabac/abac_util.h @ 0f8d3ab

abac0-leak
Last change on this file since 0f8d3ab was c5720ad, checked in by Mei <mei@…>, 11 years ago

1) flesh out abac_chunk_t utilities

  • Property mode set to 100644
File size: 750 bytes
RevLine 
[7f25a67f]1#ifndef __UTIL_H__
[f2622ee]2#define __UTIL_H__
[7f25a67f]3
4#include <sys/types.h>
[461541a]5#include <stdlib.h>
[7f25a67f]6
[f2622ee]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);
[8164e70]15abac_chunk_t abac_chunk_dup(char *, int);
16abac_chunk_t abac_chunk_new(char *, int);
17int abac_chunk_null(abac_chunk_t);
[c5720ad]18int abac_chunk_show(abac_chunk_t);
19
20#endif /* __ABAC_CHUNK_T__ */
[8164e70]21
22
[7764378]23void *abac_xmalloc(size_t);
[3c251d0]24char *abac_xstrdup(char *);
[461541a]25void *abac_xrealloc(void *, size_t);
[9a411d7]26void abac_split(char *string, char *delim, char **ret, int *num);
[7f25a67f]27
[dbbf777]28#ifdef DEBUG
29#define debug_printf(...) fprintf(stderr, __VA_ARGS__)
30#else
31#define debug_printf(...) do { } while (0)
32#endif
33
[7f25a67f]34#endif /* __UTIL_H__ */
Note: See TracBrowser for help on using the repository browser.