2 * This file is part of cparser.
3 * Copyright (C) 2012 Matthias Braun <matze@braunis.de>
8 * @brief Abstracts away printing strings to a stream so we can reuse our
9 * printing routines for printing to files or into memory
19 /** print a string into current output */
20 extern void (*print_string)(const char *str);
21 extern void (*print_vformat)(const char *format, va_list ap);
22 extern void (*print_char)(const char c);
24 /** print a printf style format string to current output */
25 static inline void __attribute__((format(printf,1,2))) print_format(const char *format, ...)
29 print_vformat(format, ap);
33 /** Set current output to be a FILE* stream */
34 void print_to_file(FILE *out);
36 /** Set current output to an obstack (grows an object on the obstack) */
37 void print_to_obstack(struct obstack *obst);
39 /** Set current output to be a buffer with limited size */
40 void print_to_buffer(char *buffer, size_t buffer_size);
42 /** Assures that the string in the buffer is 0 terminated */
43 void finish_print_to_buffer(void);
45 /** push current printer output to the (printer output) stack */
46 void printer_push(void);
48 /** pop a printer output from the stack */
49 void printer_pop(void);