diff --git a/test/relay_gen_cs.py b/test/relay_gen_cs.py index 0434c6369300ea0a6465255277a53247ce03bbf7..06a4e659507c21cf82071af63c1aad66abffb435 100755 --- a/test/relay_gen_cs.py +++ b/test/relay_gen_cs.py @@ -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