Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/P-p-H-d/mlib.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Pelissier <patrick.pelissier@gmail.com>2020-05-10 12:15:56 +0300
committerPatrick Pelissier <patrick.pelissier@gmail.com>2020-05-10 12:15:56 +0300
commit7d17223332517e53458fe0544bb8e0e8e5580441 (patch)
tree262151ccdcd15757464f6a19d9de3b48f3078474 /m-funcobj.h
parent12bc65b6a8478d68e900ca569c8b55a909128e54 (diff)
Update comments
Diffstat (limited to 'm-funcobj.h')
-rw-r--r--m-funcobj.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/m-funcobj.h b/m-funcobj.h
index c070e8a..2653121 100644
--- a/m-funcobj.h
+++ b/m-funcobj.h
@@ -70,7 +70,9 @@
/********************************** INTERNAL ************************************/
/********************************************************************************/
-/* To be used by M_IF_FUNCOBJ macro */
+/* To be used by M_IF_FUNCOBJ macro.
+ NOTE: It is reversed (0 instead of 1) so that it can be used in M_IF reliabely.
+*/
#define M_FUNCOBJ_IS_NOT_DEFINED 0
/* Design Constraints:
@@ -78,7 +80,7 @@
*
* Structure definitions are specialized in function of the presence or not
* of parameters and/or attributes
- * FIXME: How to factorize reasonnably well between definition?
+ * FIXME: How to factorize reasonnably well between the definitions?
*/
@@ -102,8 +104,11 @@
*/
#define FUNC_OBJ_ITF_NO_PARAM_DEF(name, retcode) \
typedef retcode M_C(name, _retcode_t); \
+ \
struct M_C(name, _s); \
+ \
typedef retcode(*M_C(name, _callback_t))(struct M_C(name, _s) *); \
+ \
typedef struct M_C(name, _s) { \
M_C(name, _callback_t) callback; \
} M_C(name, _t)[1]; \
@@ -122,9 +127,13 @@
*/
#define FUNC_OBJ_ITF_PARAM_DEF(name, retcode, ...) \
typedef retcode M_C(name, _retcode_t); \
+ \
M_MAP3(FUNC_OBJ_BASE_TYPE, name, __VA_ARGS__) \
+ \
struct M_C(name, _s); \
+ \
typedef retcode(*M_C(name, _callback_t))(struct M_C(name, _s) *, __VA_ARGS__); \
+ \
typedef struct M_C(name, _s) { \
M_C(name, _callback_t) callback; \
} M_C(name, _t)[1]; \