160 #define BUFFER_SIZE 512
174 bool in_string =
true;
176 for (
char * c = s; *c; c++)
187 for (j=0; j<indent; j++)
297 va_start(args, first);
302 next = va_arg(args,
string);
315 va_copy(acpy, *args);
335 va_start(args, format);
352 if (strchr(
"\"'&<>\n", *s))
358 char * escaped = (
char*)
malloc(
sizeof(
char)*len);
367 *e++=
'&'; *e++=
'q'; *e++=
'u'; *e++=
'o'; *e++=
't'; *e++=
';';
break;
369 *e++=
'&'; *e++=
'a'; *e++=
'p'; *e++=
'o'; *e++=
's'; *e++=
';';
break;
371 *e++=
'&'; *e++=
'a'; *e++=
'm'; *e++=
'p'; *e++=
';';
break;
373 *e++=
'&'; *e++=
'l'; *e++=
't'; *e++=
';';
break;
375 *e++=
'&'; *e++=
'g'; *e++=
't'; *e++=
';';
break;
379 *e++=
'&'; *e++=
'#'; *e++=
'1'; *e++=
'0'; *e++=
';';
break;
#define FOREACH(_fe_CASTER, _fe_item, _fe_list)
Apply/map an instruction block on all the elements of a list.
#define src(name, suf)
HPFC by Fabien Coelho, May 1993 and later...
#define message_assert(msg, ex)
#define STACK_MAP_X(_item, _itemtype, _code, _stack, _downwards)
not needed
bool stack_empty_p(const stack)
void stack_push(void *, stack)
stack use
void stack_free(stack *)
type, bucket_size, policy
stack stack_make(int, int, int)
allocation
void * stack_pop(stack)
POPs one item from stack s.
struct __string_buffer_head * string_buffer
minimal a la java StringBuffer...
void string_buffer_append_list(string_buffer sb, const list l)
append a list of string to a string buffer.
void string_buffer_free_all(string_buffer *psb)
free string buffer structure and force string freeing
void string_buffer_free(string_buffer *psb)
free string buffer structure, also free string contents according to the dup field
bool string_buffer_empty_p(const string_buffer sb)
return whether string_buffer sb is empty.
void string_buffer_append_sb(string_buffer sb, const string_buffer sb2)
append the string buffer sb2 to string buffer sb.
void string_buffer_printf_alist(string_buffer sb, const string format, va_list *args)
formatted alist version
static void string_buffer_append_internal(string_buffer sb, const string s)
append, without handling duplication
size_t string_buffer_size(const string_buffer sb)
return the size of the string in string_buffer sb
void string_buffer_printf(string_buffer sb, const string format,...)
append a formatted string to sb
void string_buffer_append_c_string_buffer(string_buffer sb, const string_buffer src, int indent)
put string buffer as a C-string definition of the string buffer, including external double-quotes.
void string_buffer_reset(string_buffer sb)
remove stack contents
string string_buffer_to_string(const string_buffer sb)
return malloc'ed string from string buffer sb
void string_buffer_cat(string_buffer sb, const string first,...)
append a NULL terminated list of string to sb.
string_buffer string_buffer_make(bool dup)
allocate a new string buffer
static string string_buffer_to_string_internal(const string_buffer sb, bool rev)
convert to a malloced string, maybe in rev-ersed order of the appends
string string_buffer_to_string_reverse(const string_buffer sb)
return malloc'ed string from string buffer sb going from bottom to top
void string_buffer_to_file(const string_buffer sb, FILE *out)
put string buffer into file.
void string_buffer_append(string_buffer sb, const string s)
append string s (if non empty) to string buffer sb, the duplication is done if needed according to th...
void string_buffer_append_xml_text(string_buffer sb, const string stuff, bool also_nl)
append a string with XML escapes
internally defined structure.
The structure used to build lists in NewGen.
int vasprintf(char **resultp, const char *format, va_list args)
Formatted output to strings.