version 1.77, 2017/07/02 22:28:20
|
version 1.84, 2017/07/12 15:42:43
|
Line 45
|
Line 45
|
*/ |
*/ |
|
|
#define __RPL__ struct_rpl_arguments *rpl_arguments; \ |
#define __RPL__ struct_rpl_arguments *rpl_arguments; \ |
rpl_arguments = &__static_rpl_arguments; |
rpl_arguments = &__static_rpl_arguments; \ |
|
|
#define __CATCH_SYSTEM_ERROR__ \ |
#define __CATCH_SYSTEM_ERROR__ \ |
do { if (((*rpl_arguments).erreur != 0) && \ |
do { if (((*rpl_arguments).erreur != 0) && \ |
Line 59
|
Line 59
|
|
|
#ifdef __RPLC_MAIN |
#ifdef __RPLC_MAIN |
struct_rpl_arguments __static_rpl_arguments; |
struct_rpl_arguments __static_rpl_arguments; |
|
void *__static_library_descriptor; |
# define global |
# define global |
# define initialize(a, b) a = b |
# define initialize(a, b) a = b |
# define declarePersistantObject(rpl_object) declareObject(rpl_object) |
# define declarePersistantObject(rpl_object) declareObject(rpl_object) |
#else |
#else |
extern struct_rpl_arguments __static_rpl_arguments; |
extern struct_rpl_arguments __static_rpl_arguments; |
|
extern void *__static_library_descriptor; |
# define global extern |
# define global extern |
# define initialize(a, b) a; |
# define initialize(a, b) a; |
# define declarePersistantObject(rpl_object) extern struct_objet *rpl_object |
# define declarePersistantObject(rpl_object) extern struct_objet *rpl_object |
Line 99
|
Line 101
|
if (((*s_etat_processus).erreur_execution != d_ex) || \ |
if (((*s_etat_processus).erreur_execution != d_ex) || \ |
((*s_etat_processus).erreur_systeme != d_es)) \ |
((*s_etat_processus).erreur_systeme != d_es)) \ |
{ __VA_ARGS__; return(0); } } while(0) |
{ __VA_ARGS__; return(0); } } while(0) |
|
#define structObject struct_objet |
|
#define initializeObject(a, b) do { \ |
|
(*a).descripteur_bibliotheque = (*b).descripteur_bibliotheque; \ |
|
(*a).extension_type = (*b).extension_type; } while(0) |
|
#define objectContainer(a) ((*a).objet) |
|
#define ifIsExternal(a, b) if (((*a).type == EXT) && ((*a).extension_type == b)) |
|
#define elseIfIsExternal(a, b) } else if (((*a).type == EXT) && \ |
|
((*a).extension_type == b)) |
|
#define subType(a) ((*a).extension_type) |
#define integerFormat(a) formateur_nombre(s_etat_processus, a, 'I') |
#define integerFormat(a) formateur_nombre(s_etat_processus, a, 'I') |
|
#define procStatus(a) (*a).s_etat_processus |
|
|
/* |
/* |
-------------------------------------------------------------------------------- |
-------------------------------------------------------------------------------- |
Line 170
|
Line 182
|
#define declareUnion typedef union { |
#define declareUnion typedef union { |
#define as(name) } name; |
#define as(name) } name; |
|
|
#define target(a) (*a) |
#define target(a) (*(a)) |
#define address(a) (&a) |
#define address(a) (&(a)) |
|
|
#define subroutine(name) int name() |
#define subroutine(name) int name() |
#define beginGroup { __CATCH_SYSTEM_ERROR__; |
#define beginGroup { __CATCH_SYSTEM_ERROR__; |
Line 337
|
Line 349
|
|
|
#define libraryName(name) char __library_name[] = #name; |
#define libraryName(name) char __library_name[] = #name; |
|
|
#define __onLoading int __runOnLoading(struct_rpl_arguments *rpl_arguments) |
#define __onLoading int __runOnLoading(struct_rpl_arguments *rpl_arguments, \ |
#define __onClosing int __runOnClosing(struct_rpl_arguments *rpl_arguments) |
void *descriptor) |
|
#define __onClosing int __runOnClosing(struct_rpl_arguments *rpl_arguments, \ |
|
void *descriptor) |
#define declareSubroutine(when) __##when { \ |
#define declareSubroutine(when) __##when { \ |
char __function_name[] = #when; \ |
char __function_name[] = #when; \ |
__static_rpl_arguments = (*rpl_arguments); \ |
__static_rpl_arguments = (*rpl_arguments); \ |
|
__static_library_descriptor = descriptor; \ |
HEADER \ |
HEADER \ |
declareHelpString(""); \ |
declareHelpString(""); \ |
numberOfArguments(0); \ |
numberOfArguments(0); \ |
Line 580
|
Line 595
|
if ((*rpl_object).type == CHN) __type = 1; \ |
if ((*rpl_object).type == CHN) __type = 1; \ |
if (strstr(#__VA_ARGS__, "list") != NULL) \ |
if (strstr(#__VA_ARGS__, "list") != NULL) \ |
if ((*rpl_object).type == LST) __type = 1; \ |
if ((*rpl_object).type == LST) __type = 1; \ |
|
if (strstr(#__VA_ARGS__, "external") != NULL) \ |
|
if ((*rpl_object).type == EXT) { \ |
|
if ((*rpl_object).descripteur_bibliotheque == \ |
|
__static_library_descriptor) __type = 1; }\ |
if (strstr(#__VA_ARGS__, "unknown") != NULL) \ |
if (strstr(#__VA_ARGS__, "unknown") != NULL) \ |
__type = 1; \ |
__type = 1; \ |
if (__type == 0) \ |
if (__type == 0) \ |
Line 589
|
Line 608
|
} \ |
} \ |
} } while(0) |
} } while(0) |
|
|
|
#define objectSubtype(a) (*a).extension_type |
|
|
/* |
/* |
-------------------------------------------------------------------------------- |
-------------------------------------------------------------------------------- |
Gestion des objets |
Gestion des objets |
Line 1045
|
Line 1066
|
((*rpl_object).type == CHN) |
((*rpl_object).type == CHN) |
|
|
#define ifIsString(rpl_object) if (isString(rpl_object)) |
#define ifIsString(rpl_object) if (isString(rpl_object)) |
#define elseIfIsString(rpl_object) else if (isString(rpl_object)) |
#define elseIfIsString(rpl_object) } else if (isString(rpl_object)) |
|
|
#define setString(rpl_object, string) do { \ |
#define setString(rpl_object, string) do { \ |
struct_processus *s_etat_processus; \ |
struct_processus *s_etat_processus; \ |
Line 1225
|
Line 1246
|
} \ |
} \ |
} } while(0) |
} } while(0) |
|
|
|
// NON |
|
#define createObject(rpl_object) do { \ |
|
if (rpl_object != NULL) \ |
|
systemError("Reallocated object"); \ |
|
if ((rpl_object = _allocation(NON)) == NULL) \ |
|
systemError("Memory allocation error"); \ |
|
(*rpl_object).objet = NULL; \ |
|
} while(0) |
|
|
|
// EXT |
|
#define createExternalObject(rpl_object, subtype) do { \ |
|
if (rpl_object != NULL) \ |
|
systemError("Reallocated object"); \ |
|
if ((rpl_object = _allocation(EXT)) == NULL) \ |
|
systemError("Memory allocation error"); \ |
|
(*rpl_object).objet = NULL; \ |
|
(*rpl_object).extension_type = subtype; \ |
|
(*rpl_object).descripteur_bibliotheque = __static_library_descriptor; \ |
|
} while(0) |
|
|
/* |
/* |
-------------------------------------------------------------------------------- |
-------------------------------------------------------------------------------- |
Allocation mémoire |
Allocation mémoire |
Line 1237
|
Line 1278
|
struct_processus *s_etat_processus; \ |
struct_processus *s_etat_processus; \ |
s_etat_processus = (*rpl_arguments).s_etat_processus; \ |
s_etat_processus = (*rpl_arguments).s_etat_processus; \ |
if ((ptr = malloc(a)) == NULL) \ |
if ((ptr = malloc(a)) == NULL) \ |
systemError("Memory allocation error"); ptr; }) |
{ systemError("Memory allocation error"); \ |
|
__CATCH_SYSTEM_ERROR__; } ptr; }) \ |
|
|
#define reallocate(a, s) ({ void *ptr; \ |
#define reallocate(a, s) ({ void *ptr; \ |
struct_processus *s_etat_processus; \ |
struct_processus *s_etat_processus; \ |
s_etat_processus = (*rpl_arguments).s_etat_processus; \ |
s_etat_processus = (*rpl_arguments).s_etat_processus; \ |
if ((ptr = realloc(a, s)) == NULL) \ |
if ((ptr = realloc(a, s)) == NULL) \ |
systemError("Memory allocation error"); ptr; }) |
{ systemError("Memory allocation error"); \ |
|
__CATCH_SYSTEM_ERROR__; } ptr; }) \ |
|
|
#define deallocate(a) do { \ |
#define deallocate(a) do { \ |
struct_processus *s_etat_processus; \ |
struct_processus *s_etat_processus; \ |