123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- virtual patch
- virtual report
- @initialize:python
- depends on report
- @
- @@
- import pickle
- f_void = {}
- f_other = {}
- def insert_function(f, params):
- void_pos = []
- i = 0
- for prm in params:
- if prm.startswith("void *"):
- void_pos.append(i)
- i += 1
- if len(void_pos) != 0:
- f_void[f] = void_pos
- else:
- f_other[f] = i + 1
- @r_const_dev
- depends on patch
- disable optional_qualifier
- @
- @@
- -struct device *
- +const struct device *
- @r_find_func_declare
- depends on report
- @
- identifier f;
- type ret_type;
- parameter list[nb_params] params;
- @@
- ret_type f(params);
- @script:python
- depends on report
- @
- f << r_find_func_declare.f;
- params << r_find_func_declare.params;
- @@
- insert_function(f, params)
- @r_find_func_impl_inlines
- depends on report
- @
- identifier f;
- type ret_type;
- parameter list[nb_params] params;
- @@
- (
- ret_type f(params)
- {
- ...
- }
- |
- static inline ret_type f(params)
- {
- ...
- }
- )
- @script:python
- depends on report
- @
- f << r_find_func_impl_inlines.f;
- params << r_find_func_impl_inlines.params;
- @@
- insert_function(f, params)
- @finalize:python
- depends on report
- @
- @@
- with open("function_names.pickle", "wb") as f:
- data = {}
- data['f_void'] = f_void
- data['f_other'] = f_other
- pickle.dump(data, f, pickle.HIGHEST_PROTOCOL)
|