73 info(0,
"Usage test_si [option] si_source");
74 info(0,
"where options are");
75 info(0,
"-h print this text");
76 info(0,
"-f file output binary to the file");
77 info(0,
"-c charset charset given by http");
78 info(0,
"-v level set log level for stderr logging");
81 int main(
int argc,
char **argv)
97 while ((opt =
getopt(argc, argv,
"hf:c:v:")) != EOF) {
109 panic(0,
"Cannot open output file");
123 error(0,
"Invalid option %c", opt);
125 panic(0,
"Stopping");
131 error(0,
"Missing arguments");
133 panic(0,
"Stopping");
138 panic(0,
"Cannot read the si document");
143 output =
octstr_format(
"%s",
"si compiler returned %d\n", ret);
155 debug(
"test.si", 0,
"si binary was");
void error(int err, const char *fmt,...)
void info(int err, const char *fmt,...)
void octstr_append(Octstr *ostr1, const Octstr *ostr2)
int si_compile(Octstr *si_doc, Octstr *charset, Octstr **si_binary)
int getopt(int argc, char **argv, char *opts)
Octstr * octstr_imm(const char *cstr)
void log_set_output_level(enum output_level level)
int main(int argc, char **argv)
#define octstr_dump(ostr, level,...)
Octstr * octstr_format(const char *fmt,...)
void octstr_destroy(Octstr *ostr)
#define octstr_create(cstr)
Octstr * octstr_read_file(const char *filename)
void debug(const char *place, int err, const char *fmt,...)
void gwlib_shutdown(void)
int octstr_pretty_print(FILE *f, Octstr *ostr)