4
* print to output file.
10
* output: interface to the rest of the world
11
* globals: Program_Name
12
* stdio: fprintf(), fputc(), stderr
13
* stdarg: va_list, va_start(), va_end(), vfprintf()
20
extern char* yyoutbuffer;
22
struct OutBlock* new_output()
25
out = (struct OutBlock*)malloc(sizeof(struct OutBlock));
26
out->nextBlock = NULL;
32
char* get_output(struct OutBlock* o)
39
while ( ob != NULL ) {
43
__out = malloc(sz*sizeof(char)+1);
47
if ( o->addr != NULL ) {
48
strcat(__out, o->addr);
59
#define THIS ((wiki_store*)Pike_fp->current_storage)
64
* print the given stuff to the output file
66
void output(char *fmt, ...)
70
int size = strlen(fmt);
77
str = va_arg(args, char*);
87
char* out = (char*)malloc(sizeof(char)*size);
92
vsprintf(out, fmt, args);
96
THIS->outCurrent->addr = out;
97
THIS->outCurrent->size = strlen(out);
98
THIS->outCurrent->nextBlock = new_output();
99
THIS->outCurrent = THIS->outCurrent->nextBlock;
107
* print the given stuff to the output file
109
void output_cb(char *fmt, int len)
111
char* out = (char*)malloc(sizeof(char)*len+1);
112
strncpy(out, fmt, len);
115
THIS->outCurrent->addr = out;
116
THIS->outCurrent->size = strlen(out);
117
THIS->outCurrent->nextBlock = new_output();
118
THIS->outCurrent = THIS->outCurrent->nextBlock;