version 1.49, 2013/04/01 15:29:39
|
version 1.51, 2013/04/03 09:40:31
|
Line 228
|
Line 228
|
-------------------------------------------------------------------------------- |
-------------------------------------------------------------------------------- |
*/ |
*/ |
|
|
#define declareInternalFunction(type, name, ...) \ |
#define CONCAT(a, b) __CONCAT(a, b) |
type __internal_##name(struct_rpl_arguments *rpl_arguments, __VA_ARGS__) { \ |
#define __CONCAT(a, b) a##b |
|
#define FIRST(...) FIRST_HELPER(__VA_ARGS__, throwaway) |
|
#define FIRST_HELPER(first, ...) first |
|
#define REST(...) REST_HELPER(NUM(__VA_ARGS__), __VA_ARGS__) |
|
#define REST_HELPER(qty, ...) REST_HELPER2(qty, __VA_ARGS__) |
|
#define REST_HELPER2(qty, ...) REST_HELPER_##qty(__VA_ARGS__) |
|
#define REST_HELPER_ONE(first) |
|
#define REST_HELPER_TWOORMORE(first, ...) , __VA_ARGS__ |
|
#define NUM(...) \ |
|
SELECT_10TH(__VA_ARGS__, TWOORMORE, TWOORMORE, TWOORMORE, TWOORMORE,\ |
|
TWOORMORE, TWOORMORE, TWOORMORE, TWOORMORE, ONE, throwaway) |
|
#define SELECT_10TH(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, ...) a10 |
|
|
|
#define declareInternalFunction(type, ...) \ |
|
type CONCAT(__internal_, FIRST(__VA_ARGS__)) \ |
|
(struct_rpl_arguments *rpl_arguments REST(__VA_ARGS__)) { \ |
|
type __internal_return; __internal_return = 0; int __type; \ |
|
DISABLE_SET_BUT_NOT_USED_WARNING(__type); |
|
|
|
#define endInternalFunction return(__internal_return); } |
|
|
|
#define useInternalFunction(type, ...) \ |
|
type CONCAT(__internal_, FIRST(__VA_ARGS__)) \ |
|
(struct_rpl_arguments *rpl_arguments REST(__VA_ARGS__)) |
|
|
#define endInternalFunction leave; } |
#define callInternalFunction(...) \ |
|
CONCAT(__internal_, FIRST(__VA_ARGS__))(rpl_arguments REST(__VA_ARGS__)) |
#define useInternalFunction(type, name, ...) \ |
|
type __internal_##name(struct_rpl_arguments *rpl_arguments, __VA_ARGS__) |
|
|
|
#define callInternalFunction(name, ...) \ |
|
__internal_##name(rpl_arguments, __VA_ARGS__) |
|
|
|
/* |
/* |
-------------------------------------------------------------------------------- |
-------------------------------------------------------------------------------- |
Line 246
|
Line 264
|
*/ |
*/ |
|
|
#define declareCFunction(type, name, ...) \ |
#define declareCFunction(type, name, ...) \ |
type name(__VA_ARGS__) { __RPL__ |
type name(__VA_ARGS__) { __RPL__ type __c_return; |
#define endCFunction leave; } |
#define endCFunction return(__c_return); } |
|
|
/* |
/* |
-------------------------------------------------------------------------------- |
-------------------------------------------------------------------------------- |
Line 1074
|
Line 1092
|
#define removeObjectFromList(list, object) do { \ |
#define removeObjectFromList(list, object) do { \ |
ifIsList(list) \ |
ifIsList(list) \ |
{ \ |
{ \ |
if ((*object).objet == NULL) \ |
if ((*list).objet != NULL) \ |
{ \ |
{ \ |
struct_objet *__tmp_object; \ |
struct_liste_chainee *__current; \ |
if ((__tmp_object = copie_objet(list, 'N')) == NULL) \ |
struct_liste_chainee *__previous; \ |
systemError("Memory allocation error"); \ |
__current = (*list).objet; \ |
liberation(object); \ |
__previous = NULL; \ |
object = __tmp_object; \ |
if ((*__current).donnee == object) \ |
\ |
{ \ |
\ |
(*list).objet = (*__current).suivant; \ |
\ |
} \ |
\ |
else \ |
} \ |
{ \ |
|
while(__current != NULL) \ |
|
{ \ |
|
if ((*__current).donnee == object) \ |
|
{ \ |
|
(*__previous).suivant = (*__current).suivant; \ |
|
break; \ |
|
} \ |
|
__previous = __current; \ |
|
__current = (*__current).suivant; \ |
|
} \ |
|
} \ |
|
liberation((*__current).donnee); \ |
|
free(__current); \ |
|
} \ |
} \ |
} \ |
else executionError("Type mistmatch error"); } while(0) |
else executionError("Type mistmatch error"); } while(0) |
|
|