This repository was archived by the owner on Nov 16, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,26 @@ Similar to non-RPC application, the below files are manaully created. Create RPC
2222
2323` cl_common.c/h ` : RPC Client handler
2424
25+ ```
26+ cl_return_t CL_CALC_WRITE ( HANDLER *remote , cl_msg_t in, cl_bus_t *out )
27+ {
28+
29+ if ( remote != NULL && remote->clnt != (CLIENT *)NULL ) {
30+
31+ ...
32+ res = cl_calc_write_func_1( &req, remote->clnt );
33+ ...
34+
35+ return ret;
36+ } else {
37+
38+ return cl_calc_write( in,out );
39+
40+ }
41+
42+ }
43+ ```
44+
2545** CL** is an imaginary product name for example 3.
2646
2747
@@ -52,3 +72,20 @@ The following files are generated from `cl_calc.h`
5272** pycparser** installation. ( powered by [ PLY] ( https://github.com/dabeaz/ply ) )
5373
5474> pip install --index-url=https://pypi.python.org/simple/ pycparser
75+
76+ ```
77+ from pycparser import c_parser, c_ast, parse_file
78+
79+ class FuncCallVisitor(c_ast.NodeVisitor):
80+ def __init__(self):
81+ ...
82+
83+ def visit_FuncDecl (self, node):
84+ ...
85+
86+ if __name__ == "__main__":
87+
88+ ast = parse_file(args.filename, use_cpp=False)
89+ v = FuncCallVisitor()
90+ v.visit(ast)
91+ ```
You can’t perform that action at this time.
0 commit comments