Commit 46cfde75 authored by Anders Blomdell's avatar Anders Blomdell
Browse files

Remove cruft at end of file

parent a3924ab2
......@@ -83,39 +83,4 @@ if __name__ == '__main__':
|}
"""))
print "\n".join(result)
exit(0)
for func,arg in sample:
result.extend(split_match('^[^|]*\|(.*)$', """
|void handle_%(func)s(%(arg)s *v, void *context)
|{
| struct labcomm_encoder *e = context;
| labcomm_encode_%(func)s(e, v);
|}""" % { 'func': func, 'arg': arg }))
pass
result.extend(split_match('^[^|]*\|(.*)$', """
|int main(int argc, char *argv[]) {
| struct labcomm_encoder *e;
| struct labcomm_decoder *d;
| int in, out;
|
| if (argc < 3) { return 1; }
| in = open(argv[1], O_RDONLY);
| if (in < 0) { return 1; }
| out = open(argv[2], O_WRONLY);
| if (out < 0) { return 1; }
| e = labcomm_encoder_new(labcomm_fd_writer, &out);
| d = labcomm_decoder_new(labcomm_fd_reader, &in);
"""))
for func,arg in sample:
result.extend(split_match('^[^|]*\|(.*)$', """
| labcomm_encoder_register_%(func)s(e);
| labcomm_decoder_register_%(func)s(d, handle_%(func)s, e);
""" % { 'func': func, 'arg': arg }))
result.extend(split_match('^[^|]*\|(.*)$', """
| labcomm_decoder_run(d);
| return 0;
|}
"""))
print "\n".join(result)
pass
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment