2005-11-18 18:54:58 +03:00
|
|
|
/*
|
|
|
|
* (C)opyright MMIV-MMV Anselm R. Garbe <garbeam at gmail dot com>
|
|
|
|
* See LICENSE file for license details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
|
|
|
#ifndef nil
|
|
|
|
#define nil (void *)0
|
|
|
|
#endif
|
|
|
|
#ifndef FALSE
|
|
|
|
#define FALSE 0
|
|
|
|
#endif
|
|
|
|
#ifndef TRUE
|
|
|
|
#define TRUE 1
|
|
|
|
#endif
|
|
|
|
|
2005-12-06 16:22:58 +03:00
|
|
|
/* container.c */
|
|
|
|
typedef struct Container Container;
|
|
|
|
typedef struct CItem CItem;
|
|
|
|
|
|
|
|
struct CItem {
|
|
|
|
void *item;
|
|
|
|
CItem *prev;
|
|
|
|
CItem *next;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Container {
|
|
|
|
CItem *list;
|
|
|
|
CItem *stack;
|
|
|
|
} Container;
|
|
|
|
|
|
|
|
void attach_item
|
|
|
|
void *item_at(
|
|
|
|
|
|
|
|
|
2005-12-05 01:45:59 +03:00
|
|
|
void **attach_item_end(void **old, void *item, size_t size_item);
|
|
|
|
void **attach_item_begin(void **old, void *item, size_t size_item);
|
|
|
|
void **detach_item(void **old, void *item, size_t size_item);
|
|
|
|
int index_item(void **items, void *item);
|
|
|
|
int index_next_item(void **items, void *item);
|
|
|
|
int index_prev_item(void **items, void *item);
|
|
|
|
int count_items(void **items);
|
2005-11-18 18:54:58 +03:00
|
|
|
|
|
|
|
/* emalloc.c */
|
2005-12-05 01:45:59 +03:00
|
|
|
void *emalloc(size_t size);
|
2005-11-18 18:54:58 +03:00
|
|
|
|
|
|
|
/* estrdup.c */
|
2005-12-05 01:45:59 +03:00
|
|
|
char *estrdup(const char *s);
|
2005-11-18 18:54:58 +03:00
|
|
|
|
|
|
|
/* strlcat.c */
|
2005-12-05 01:45:59 +03:00
|
|
|
size_t _strlcat(char *dst, const char *src, size_t siz);
|
2005-11-18 18:54:58 +03:00
|
|
|
|
|
|
|
/* strlcpy.c */
|
2005-12-05 01:45:59 +03:00
|
|
|
size_t _strlcpy(char *dst, const char *src, size_t siz);
|
2005-11-18 18:54:58 +03:00
|
|
|
|
|
|
|
/* strtonum.c */
|
2005-12-05 01:45:59 +03:00
|
|
|
long long
|
2005-11-18 18:54:58 +03:00
|
|
|
__strtonum(const char *numstr, long long minval,
|
2005-12-05 01:45:59 +03:00
|
|
|
long long maxval, const char **errstrp);
|
2005-11-18 18:54:58 +03:00
|
|
|
|
|
|
|
/* tokenize.c */
|
2005-12-05 01:45:59 +03:00
|
|
|
size_t tokenize(char **result, size_t reslen, char *str, char delim);
|