Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sven Gestegård Robertz
LabComm
Commits
46cfde75
Commit
46cfde75
authored
May 13, 2013
by
Anders Blomdell
Browse files
Remove cruft at end of file
parent
a3924ab2
Changes
1
Hide whitespace changes
Inline
Side-by-side
test/relay_gen_cs.py
View file @
46cfde75
...
...
@@ -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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment