Browse Source

lib_test - add struct containing function pointer

master
heck 4 years ago
parent
commit
0c3a9d80e7
  1. 7
      examples/lib/lib_test/README.md
  2. 2
      examples/lib/lib_test/structs.h

7
examples/lib/lib_test/README.md

@ -23,7 +23,7 @@ just write your func/var using these types and debug the generation.
The ACID format deals with items. Everything is an item. The ACID format deals with items. Everything is an item.
There are qualifiers that can be used and combined to define an item. (list below) There are qualifiers that can be used and combined to define an item. (list below)
e.g PS = primitive struct that possibly has a typedef e.g PS = primitive struct
Of all the possible combinations, not all are valid (C lang). Its a futile attempt Of all the possible combinations, not all are valid (C lang). Its a futile attempt
trying to cover all the valid ones. But an effort has been made to cover the most trying to cover all the valid ones. But an effort has been made to cover the most
@ -39,7 +39,7 @@ For all the types defined the file:
contains an instance of each. contains an instance of each.
for all the possible function signature, well with a 100 types, for all the possible function signatures, well with a 100 types,
we can create 10000 different sigantures using 1 ret and 1 arg. we can create 10000 different sigantures using 1 ret and 1 arg.
Therefore, no functions have been defined. Therefore, no functions have been defined.
define them when you are interested in the combination, and pEpACIDgen the defintion. define them when you are interested in the combination, and pEpACIDgen the defintion.
@ -59,7 +59,8 @@ T = Typedef -> typedefs.h
I = Incomplete / (forward decl) -> struct.h/enums.h I = Incomplete / (forward decl) -> struct.h/enums.h
X = Anonymous (enums onnly) -> enums.h X = Anonymous (enums onnly) -> enums.h
a = Array (vars (all possible types) and struct fields) a = Array (vars (all possible types) and struct fields)
(//p = Pointer (vars (all possible types) and struct fields)) p = Pointer (vars (all possible types) and struct fields)
F = Function (so pF == function pointer)
func_<RETURN>_args_<ARG1_ARG2_...> = Function -> functions.h -> functions.h func_<RETURN>_args_<ARG1_ARG2_...> = Function -> functions.h -> functions.h
var_ = Variable -> vars.h var_ = Variable -> vars.h

2
examples/lib/lib_test/structs.h

@ -103,6 +103,7 @@ typedef struct IS AIS;
struct _PS { struct _PS {
int field__P_1; int field__P_1;
int field__P_2; int field__P_2;
void(*field__pF_3)(void);
}; };
// PS = primitive struct // PS = primitive struct
@ -110,6 +111,7 @@ struct _PS {
typedef struct PS { typedef struct PS {
int field__P_1; int field__P_1;
int field__P_2; int field__P_2;
void(*field__pF_3)(void);
} APS; } APS;
// _PSa = primitive struct containing an array without an alias // _PSa = primitive struct containing an array without an alias

Loading…
Cancel
Save