view utils.h @ 21:e3fab8f1b52c

strip comments.
author David A. Holland
date Mon, 20 Dec 2010 04:15:02 -0500
parents c08a947d8f30
children 76c114899f63
line wrap: on
line source

#include <stdbool.h>
#include <stddef.h>

struct place;


#define HOWMANY(arr) (sizeof(arr)/sizeof((arr)[0]))

extern const char ws[];
extern const char alnum[];


void *domalloc(size_t len);
void *dorealloc(void *ptr, size_t len);

char *dostrdup(const char *s);
char *dostrdup2(const char *s, const char *t);
char *dostrdup3(const char *s, const char *t, const char *u);
char *dostrndup(const char *s, size_t len);

size_t notrailingws(char *buf, size_t len);
bool is_identifier(const char *str);

/* in place.c */
void complain(const struct place *, const char *fmt, ...);
void complain_fail(void);
bool complain_failed(void);

/* in main.c */
void freestringlater(char *s);
void die(void);