wmii/libcext/cext.h

46 lines
1.1 KiB
C
Raw Normal View History

2005-11-18 18:54:58 +03:00
/*
2006-01-20 17:20:24 +03:00
* (C)opyright MMIV-MMVI Anselm R. Garbe <garbeam at gmail dot com>
2005-11-18 18:54:58 +03:00
* See LICENSE file for license details.
*/
#include <sys/types.h>
#ifndef nil
#define nil (void *)0
#endif
/* array.c */
void ** cext_array_attach(void **array, void *p, unsigned int psize, unsigned int *size);
void cext_array_detach(void **array, void *p, unsigned int *size);
/* emallocz.c */
void *cext_emallocz(unsigned int size);
2005-11-18 18:54:58 +03:00
/* evector.c */
#define EVECTOR(name, type) \
typedef struct { \
unsigned int size; \
type * data; \
} name
EVECTOR(evector_t, void*);
void cext_evector_attach(evector_t *v, void *p);
void cext_evector_detach(evector_t *v, void *p);
2005-11-18 18:54:58 +03:00
/* estrdup.c */
char *cext_estrdup(const char *s);
2005-11-18 18:54:58 +03:00
/* strlcat.c */
unsigned int cext_strlcat(char *dst, const char *src, unsigned int siz);
2005-11-18 18:54:58 +03:00
/* strlcpy.c */
unsigned int cext_strlcpy(char *dst, const char *src, unsigned int siz);
2005-11-18 18:54:58 +03:00
/* strtonum.c */
2005-12-21 18:18:11 +03:00
long long cext_strtonum(const char *numstr, long long minval,
long long maxval, const char **errstrp);
2005-11-18 18:54:58 +03:00
/* tokenize.c */
unsigned int cext_tokenize(char **result, unsigned int reslen, char *str, char delim);