Add alternative macro M_TEST_METHOD_ALTER_P
This commit is contained in:
1 parent
bc7552f4a8
commit
b2d3d86e0c
2 files changed
+9
-1
No files matched your search
@@ -6378,8 +6378,11 @@ Theses new operators will have higher priority than the ones
|
|||||||
in the given oplist.
|
in the given oplist.
|
||||||
|
|
||||||
##### M\_TEST\_METHOD\_P(method, oplist)
|
##### M\_TEST\_METHOD\_P(method, oplist)
|
||||||
|
##### M\_TEST\_METHOD\_ALTER\_P(method, oplist)
|
||||||
|
|
||||||
Test if a method is present in an oplist. Return 0 or 1.
|
Test if a method is present in an oplist. Return 0 or 1.
|
||||||
|
M\_TEST\_METHOD\_P does not work if the returned method is something within parenthesis (like OPLIST*)
|
||||||
|
If this case is possible, you shall use the M_TEST_METHOD_ALTER_P macro (safer but slower).
|
||||||
|
|
||||||
##### M\_IF\_METHOD(method, oplist)
|
##### M\_IF\_METHOD(method, oplist)
|
||||||
|
|
||||||
|
|||||||
@@ -3336,11 +3336,16 @@ m_core_parse2_enum (const char str[], const char **endptr)
|
|||||||
|
|
||||||
/* Test if a method is present in an oplist.
|
/* Test if a method is present in an oplist.
|
||||||
Return 0 (method is absent or disabled) or 1 (method is present and not disabled).
|
Return 0 (method is absent or disabled) or 1 (method is present and not disabled).
|
||||||
NOTE: Does not work if method is OPLIST, KEY_OPLIST or VALUE_OPLIST.
|
NOTE: M_TEST_METHOD_P does not work if method is something within parenthesis (like OPLIST*)
|
||||||
|
In this case, you shall use the M_TEST_METHOD_ALTER_P macro (safer but slower).
|
||||||
*/
|
*/
|
||||||
#define M_TEST_METHOD_P(method, oplist) \
|
#define M_TEST_METHOD_P(method, oplist) \
|
||||||
M_BOOL(M_GET_METHOD (method, 0, M_OPFLAT oplist))
|
M_BOOL(M_GET_METHOD (method, 0, M_OPFLAT oplist))
|
||||||
|
|
||||||
|
#define M_TEST_METHOD_ALTER_P(method, oplist) \
|
||||||
|
M_INV(M_EMPTY_P(M_GET_METHOD (method, , M_OPFLAT oplist)))
|
||||||
|
|
||||||
|
|
||||||
/* Test if a method is disabled in an oplist.
|
/* Test if a method is disabled in an oplist.
|
||||||
To disable an oplist, just put '0' in the method like this:
|
To disable an oplist, just put '0' in the method like this:
|
||||||
Example: (INIT(0), CLEAR(clear))
|
Example: (INIT(0), CLEAR(clear))
|
||||||
|
|||||||
Reference in new issue
Block a user