From 0c3a9d80e7e2eebe0e422e0e10191b50a5865c2d Mon Sep 17 00:00:00 2001 From: heck Date: Wed, 10 Feb 2021 17:48:55 +0100 Subject: [PATCH] lib_test - add struct containing function pointer --- examples/lib/lib_test/README.md | 7 ++++--- examples/lib/lib_test/structs.h | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/lib/lib_test/README.md b/examples/lib/lib_test/README.md index 8256e81..74fb330 100644 --- a/examples/lib/lib_test/README.md +++ b/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. 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 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. -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. Therefore, no functions have been defined. 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 X = Anonymous (enums onnly) -> enums.h 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__args_ = Function -> functions.h -> functions.h var_ = Variable -> vars.h diff --git a/examples/lib/lib_test/structs.h b/examples/lib/lib_test/structs.h index 77d5e72..e205bf2 100644 --- a/examples/lib/lib_test/structs.h +++ b/examples/lib/lib_test/structs.h @@ -103,6 +103,7 @@ typedef struct IS AIS; struct _PS { int field__P_1; int field__P_2; + void(*field__pF_3)(void); }; // PS = primitive struct @@ -110,6 +111,7 @@ struct _PS { typedef struct PS { int field__P_1; int field__P_2; + void(*field__pF_3)(void); } APS; // _PSa = primitive struct containing an array without an alias