#include <stdio.h>
#include <stdlib.h>
-#include <ctype.h>
#ifdef HAVE_STRING_H
# include <string.h>
#else
#ifdef STANDALONE
# define xmalloc malloc
# define xrealloc realloc
+# define xfree free
#endif /* STANDALONE */
/* Pool support. For efficiency, map_html_tags() stores temporary
/* Forget old pool contents. The allocated memory is not freed. */
#define POOL_REWIND(pool) pool.index = 0
-/* Free heap-allocated memory for contents of POOL. This calls free()
- if the memory was allocated through malloc. It also restores
- `contents' and `size' to their original, pre-malloc values. That
- way after POOL_FREE, the pool is fully usable, just as if it were
- freshly initialized with POOL_INIT. */
+/* Free heap-allocated memory for contents of POOL. This calls
+ xfree() if the memory was allocated through malloc. It also
+ restores `contents' and `size' to their original, pre-malloc
+ values. That way after POOL_FREE, the pool is fully usable, just
+ as if it were freshly initialized with POOL_INIT. */
#define POOL_FREE(pool) do { \
if (!(pool).alloca_p) \
- free ((pool).contents); \
+ xfree ((pool).contents); \
(pool).contents = (pool).orig_contents; \
(pool).size = (pool).orig_size; \
(pool).index = 0; \
state = AC_S_DEFAULT;
break;
case AC_S_QUOTE1:
- assert (ch == '\'' || ch == '\"');
+ assert (ch == '\'' || ch == '"');
quote_char = ch; /* cheating -- I really don't feel like
introducing more different states for
different quote characters. */
finish:
POOL_FREE (pool);
if (!attr_pair_alloca_p)
- free (pairs);
+ xfree (pairs);
}
#undef ADVANCE