Diff for /rpl/src/rplexternals.h between versions 1.50 and 1.87

version 1.50, 2013/04/02 11:56:33 version 1.87, 2017/07/30 21:59:41
Line 1 Line 1
 /*  /*
 ================================================================================  ================================================================================
   RPL/2 (R) version 4.1.14    RPL/2 (R) version 4.1.27
   Copyright (C) 1989-2013 Dr. BERTRAND Joël    Copyright (C) 1989-2017 Dr. BERTRAND Joël
   
   This file is part of RPL/2.    This file is part of RPL/2.
   
Line 29 Line 29
 ================================================================================  ================================================================================
 */  */
   
 #   define RPLARGS  // Si TYPE_DECLARATION est défini, toutes les structures internes du RPL/2
 #   define struct_processus void  // sont exposés pour travailler sur des nouveaux types de données.
   #   ifndef TYPE_DECLARATION
   #       define RPLARGS
   #       define struct_processus void
   #   endif
   
 #   include "rpl.h"  #   include "rpl.h"
   
 /*  /*
Line 39 Line 44
 ================================================================================  ================================================================================
 */  */
   
   #define __RPL__ struct_rpl_arguments *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) && \
                 ((*rpl_arguments).type_erreur == 'S')) \                  ((*rpl_arguments).type_erreur == 'S')) \
             return 0; } while(0)              return 0; } while(0)
 #define leave do { return(0); } while(0)  #define leave do { return(0); } while(0)
 #define allocation(a) librpl_allocation((*rpl_arguments).s_etat_processus, a)  #define _allocation(a) librpl_allocation((*rpl_arguments).s_etat_processus, a)
 #define copie_objet(a, b) librpl_copie_objet( \  #define _copie_objet(a, b) librpl_copie_objet( \
             (*rpl_arguments).s_etat_processus, a, b)              (*rpl_arguments).s_etat_processus, a, b)
 #define liberation(a) librpl_liberation((*rpl_arguments).s_etat_processus, a)  #define _liberation(a) librpl_liberation((*rpl_arguments).s_etat_processus, a)
   
   #ifdef __RPLC_MAIN
       struct_rpl_arguments __static_rpl_arguments;
       void *__static_library_descriptor;
   #   define global
   #   define initialize(a, b) a = b
   #   define declarePersistantObject(rpl_object) declareObject(rpl_object)
   #else
       extern struct_rpl_arguments __static_rpl_arguments;
       extern void *__static_library_descriptor;
   #   define global extern
   #   define initialize(a, b) a;
   #   define declarePersistantObject(rpl_object) extern struct_objet *rpl_object
   #endif
   
   #define empty int
   
   /*
   --------------------------------------------------------------------------------
     Gestion des objets
   --------------------------------------------------------------------------------
   */
   
   // new, dup, drop, disp, parse
   // __type_new(struct_rpl_arguments *rpl_arguments)
   #define declareTypeExtension(fct) \
           int __type_##fct(struct_processus *s_etat_processus, void **arg) { \
               char *rptr, *ptr, *iptr; \
               rptr = (char *) ((*s_etat_processus).definitions_chainees + \
                       (*s_etat_processus).position_courante); \
               ptr = rptr; \
               iptr = (char *) (*s_etat_processus).instruction_courante; \
               if ((ptr != rptr) && (iptr)) goto __parse_error;
   #define parseError  { goto __parse_error; } while(0)
   #define typeError { return(0); } while(0)
   #define typeSystemError { (*s_etat_processus).erreur_systeme = \
           d_es_execution_bibliotheque; return(0); } while(0)
   #define typeSuccess { return(1); } while(0)
   #define typeFound(a) { return(a); } while(0)
   #define endTypeExtension __parse_error: return(0); }
   #define sizeOfParse (rptr - ptr)
   #define searchType(...) { recherche_type(s_etat_processus); \
               if (((*s_etat_processus).erreur_execution != d_ex) || \
                       ((*s_etat_processus).erreur_systeme != d_es)) \
                   { __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(type, a) ((type *) ((*a).objet))
   #define objectOf(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 procStatus(a) (*a).s_etat_processus
   
 /*  /*
 --------------------------------------------------------------------------------  --------------------------------------------------------------------------------
Line 55 Line 120
 --------------------------------------------------------------------------------  --------------------------------------------------------------------------------
 */  */
   
 #define declareObject(object) struct_objet *object = NULL  #define declareObject(rpl_object) struct_objet *rpl_object = NULL
 #define declareInteger(integer) integer8 integer  #define declareInteger(integer) integer8 integer
 #define declareReal(real) real8 real  #define declareReal(real) real8 real
 #define declareComplex(complex) complex16 complex  #define declareComplex(complex) complex16 complex
Line 85 Line 150
     ({ __CATCH_SYSTEM_ERROR__; typeof(daisyChain) __daisyChain = daisyChain; \      ({ __CATCH_SYSTEM_ERROR__; typeof(daisyChain) __daisyChain = daisyChain; \
     if (__daisyChain == NULL) executionError("End of daisy chain"); \      if (__daisyChain == NULL) executionError("End of daisy chain"); \
     (__daisyChain == NULL) ? NULL : (*__daisyChain).suivant; })      (__daisyChain == NULL) ? NULL : (*__daisyChain).suivant; })
   
   #define next        suivant
   #define data        donnee
   #define daisyChain  struct_liste_chainee
           
 #define null NULL  #define null NULL
 #define nullify(ptr) __CATCH_SYSTEM_ERROR__; do { ptr = NULL; } while(0)  #define nullify(ptr) __CATCH_SYSTEM_ERROR__; do { ptr = NULL; } while(0)
Line 113 Line 182
 #define logical int  #define logical int
 #define string char *  #define string char *
 #define integer int  #define integer int
 #define object struct_objet *  
   
 #define declareStructure typedef struct {  #define declareStructure typedef struct {
 #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 beginGroup { __CATCH_SYSTEM_ERROR__;  #define beginGroup { __CATCH_SYSTEM_ERROR__;
 #define endGroup __CATCH_SYSTEM_ERROR__; }  #define endGroup __CATCH_SYSTEM_ERROR__; }
 #define beginMacro do beginGroup  #define beginMacro do beginGroup
 #define endMacro endGroup while(0)  #define endMacro endGroup while(0)
 #define stopRequest __CATCH_SYSTEM_ERROR__; \  #define stopRequest ({ __CATCH_SYSTEM_ERROR__; \
         test_arret((*rpl_arguments).s_etat_processus)          test_arret((*rpl_arguments).s_etat_processus); })
   
 /*  /*
 --------------------------------------------------------------------------------  --------------------------------------------------------------------------------
Line 159 Line 228
     unsigned char   __taille_bloc; \      unsigned char   __taille_bloc; \
     unsigned char   __type; \      unsigned char   __type; \
     t_8_bits        __masque; \      t_8_bits        __masque; \
       void *s_etat_processus = (*rpl_arguments).s_etat_processus; \
       DISABLE_SET_BUT_NOT_USED_WARNING(s_etat_processus); \
     { \      { \
         (*rpl_arguments).instruction_valide = 'Y'; \          (*rpl_arguments).instruction_valide = 'Y'; \
         (*rpl_arguments).erreur = 0; \          (*rpl_arguments).erreur = 0; \
Line 202 Line 273
 --------------------------------------------------------------------------------  --------------------------------------------------------------------------------
 */  */
   
 #define freeObject(object) \  #define freeObject(rpl_object) \
     __CATCH_SYSTEM_ERROR__; \      __CATCH_SYSTEM_ERROR__; \
     do { \      do { \
         if (object == NULL) \          if (rpl_object == NULL) \
             systemError("Nullified object"); \              systemError("Nullified object"); \
         liberation(object); \          _liberation(rpl_object); \
         object = NULL; \          rpl_object = NULL; \
     } while(0)      } while(0)
   
 /*  /*
Line 217 Line 288
 --------------------------------------------------------------------------------  --------------------------------------------------------------------------------
 */  */
   
 #define dupObject(object) \  #define dupObject(rpl_object) \
     __CATCH_SYSTEM_ERROR__; \      __CATCH_SYSTEM_ERROR__; \
     do { if (copie_objet(object, 'P') != object) \      do { if (_copie_objet(rpl_object, 'P') != rpl_object) \
         systemError("Memory allocation error"); } while(0)          systemError("Memory allocation error"); } while(0)
   
 /*  /*
Line 228 Line 299
 --------------------------------------------------------------------------------  --------------------------------------------------------------------------------
 */  */
   
 #define declareInternalFunction(type, name, ...) \  #define CONCAT(a, b) __RPL_CONCAT(a, b)
     type __internal_##name(struct_rpl_arguments *rpl_arguments, __VA_ARGS__) { \  #define __RPL_CONCAT(a, b) a##b
   #define FIRST(...) FIRST_HELPER(__VA_ARGS__, throwaway)
 #define endInternalFunction leave; }  #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 useInternalFunction(type, name, ...) \  #define callInternalFunction(...) \
     type __internal_##name(struct_rpl_arguments *rpl_arguments, __VA_ARGS__)      CONCAT(__internal_, FIRST(__VA_ARGS__))(rpl_arguments REST(__VA_ARGS__))
   
 #define callInternalFunction(name, ...) \  
     __internal_##name(rpl_arguments, __VA_ARGS__)  
   
 /*  /*
 --------------------------------------------------------------------------------  --------------------------------------------------------------------------------
Line 246 Line 335
 */  */
   
 #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); }
   
   #define useCFunction(type, name, ...) type name(__VA_ARGS__)
   
 /*  /*
 --------------------------------------------------------------------------------  --------------------------------------------------------------------------------
Line 265 Line 356
   
 #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 282 Line 376
         do { syslog(LOG_NOTICE, __VA_ARGS__); } while(0)           do { syslog(LOG_NOTICE, __VA_ARGS__); } while(0) 
   
 #define exportExternalFunctions(...) \  #define exportExternalFunctions(...) \
     char **__external_symbols(struct_rpl_arguments *rpl_arguments, \      char **___external_symbols(struct_rpl_arguments *rpl_arguments, \
             integer8 *nb_symbols, \              integer8 *nb_symbols, \
             const char *version) { \              const char *version) { \
         char arguments[] = #__VA_ARGS__; \          char arguments[] = #__VA_ARGS__; \
Line 290 Line 384
         char *ptr1, *ptr2; \          char *ptr1, *ptr2; \
         int drapeau; \          int drapeau; \
         unsigned long i; \          unsigned long i; \
           struct_processus *s_etat_processus; \
           s_etat_processus = (*rpl_arguments).s_etat_processus; \
         if (strcmp(version, _d_version_rpl) != 0) \          if (strcmp(version, _d_version_rpl) != 0) \
         { \          { \
             notice(stdout, "Versions mismatch : library %s, expected %s\n", \              notice(stdout, "Versions mismatch : library %s, expected %s\n", \
Line 471 Line 567
 --------------------------------------------------------------------------------  --------------------------------------------------------------------------------
 */  */
   
 #define pushOnStack(object) do { \  #define pushOnStack(rpl_object) do { \
     __CATCH_SYSTEM_ERROR__; \      __CATCH_SYSTEM_ERROR__; \
     if (((*rpl_arguments).l_base_pile = \      if (((*rpl_arguments).l_base_pile = \
             empilement_pile_operationnelle(rpl_arguments, object)) == NULL) \              empilement_pile_operationnelle(rpl_arguments, rpl_object)) \
                       == NULL) \
         systemError("Memory allocation error"); \          systemError("Memory allocation error"); \
     if ((*object).nombre_occurrences == 1) object = NULL; } while(0)      if ((*rpl_object).nombre_occurrences == 1) rpl_object = NULL; } while(0)
   
 #define pullFromStack(object, ...) do { \  #define pullFromStack(rpl_object, ...) do { \
     __CATCH_SYSTEM_ERROR__; \      __CATCH_SYSTEM_ERROR__; \
     (*rpl_arguments).l_base_pile = \      (*rpl_arguments).l_base_pile = \
             depilement_pile_operationnelle(rpl_arguments, &object); \              depilement_pile_operationnelle(rpl_arguments, &rpl_object); \
     if (object == NULL) \      if (rpl_object == NULL) \
     { \      { \
         executionError("Too few arguments"); \          executionError("Too few arguments"); \
     } \      } \
Line 496 Line 593
         { \          { \
             __type = 0; \              __type = 0; \
             if (strstr(#__VA_ARGS__, "integer") != NULL) \              if (strstr(#__VA_ARGS__, "integer") != NULL) \
                 if ((*object).type == INT) __type = 1; \                  if ((*rpl_object).type == INT) __type = 1; \
             if (strstr(#__VA_ARGS__, "real") != NULL) \              if (strstr(#__VA_ARGS__, "real") != NULL) \
                 if ((*object).type == REL) __type = 1; \                  if ((*rpl_object).type == REL) __type = 1; \
             if (strstr(#__VA_ARGS__, "complex") != NULL) \              if (strstr(#__VA_ARGS__, "complex") != NULL) \
                 if ((*object).type == CPL) __type = 1; \                  if ((*rpl_object).type == CPL) __type = 1; \
             if (strstr(#__VA_ARGS__, "string") != NULL) \              if (strstr(#__VA_ARGS__, "string") != NULL) \
                 if ((*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 ((*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 514 Line 615
         } \          } \
     } } while(0)      } } while(0)
   
   #define objectSubtype(a) (*a).extension_type
   
 /*  /*
 --------------------------------------------------------------------------------  --------------------------------------------------------------------------------
   Gestion des objets    Gestion des objets
Line 527 Line 630
   
 //  Constantes symboliques  //  Constantes symboliques
   
 #define createSymbolicConstant(object, type, value) do { \  #define createSymbolicConstant(rpl_object, type, value) do { \
       struct_processus *s_etat_processus; \
       s_etat_processus = (*rpl_arguments).s_etat_processus; \
     if ((strcmp(#type, "integer") != 0) && (strcmp(#type, "real") != 0)) \      if ((strcmp(#type, "integer") != 0) && (strcmp(#type, "real") != 0)) \
         systemError("Type not allowed for symbolic constant"); \          systemError("Type not allowed for symbolic constant"); \
     __taille_bloc = sizeof(t_8_bits) * 8; \      __taille_bloc = sizeof(t_8_bits) * 8; \
Line 536 Line 641
     __masque = ((t_8_bits) 1) << (__taille_bloc - __indice_bit - 1); \      __masque = ((t_8_bits) 1) << (__taille_bloc - __indice_bit - 1); \
     if (((*rpl_arguments).drapeaux_etat[__indice_bloc] & __masque) != 0) \      if (((*rpl_arguments).drapeaux_etat[__indice_bloc] & __masque) != 0) \
     { \      { \
         createNameObject(object); \          createNameObject(rpl_object); \
         __CATCH_SYSTEM_ERROR__; \          __CATCH_SYSTEM_ERROR__; \
         { \          { \
             char *__constant_name; \              char *__constant_name; \
Line 545 Line 650
                 systemError("Memory allocation error"); \                  systemError("Memory allocation error"); \
             sprintf(__constant_name, "%s$%s", __library_name, \              sprintf(__constant_name, "%s$%s", __library_name, \
                     &(__function_name[11])); \                      &(__function_name[11])); \
             setName(object, __constant_name); \              setName(rpl_object, __constant_name); \
             free(__constant_name); \              free(__constant_name); \
         } \          } \
     } \      } \
Line 553 Line 658
     { \      { \
         if (strcmp(#type, "integer") == 0) \          if (strcmp(#type, "integer") == 0) \
         { \          { \
             createIntegerObject(object); \              createIntegerObject(rpl_object); \
             __CATCH_SYSTEM_ERROR__; \              __CATCH_SYSTEM_ERROR__; \
             setInteger(object, value); \              setInteger(rpl_object, value); \
         } \          } \
         else if (strcmp(#type, "real") == 0) \          else if (strcmp(#type, "real") == 0) \
         { \          { \
             createRealObject(object); \              createRealObject(rpl_object); \
             __CATCH_SYSTEM_ERROR__; \              __CATCH_SYSTEM_ERROR__; \
             setReal(object, value); \              setReal(rpl_object, value); \
         } \          } \
     } \      } \
     __CATCH_SYSTEM_ERROR__; \      __CATCH_SYSTEM_ERROR__; \
     __constante--; } while(0)      __constante--; } while(0)
   
 #define createSymbolicComplexConstant(object, rp, ip) do { \  #define createSymbolicComplexConstant(rpl_object, rp, ip) do { \
       struct_processus *s_etat_processus; \
       s_etat_processus = (*rpl_arguments).s_etat_processus; \
     __taille_bloc = sizeof(t_8_bits) * 8; \      __taille_bloc = sizeof(t_8_bits) * 8; \
     __indice_bloc = (35 - 1) / __taille_bloc; \      __indice_bloc = (35 - 1) / __taille_bloc; \
     __indice_bit = (35 - 1) % __taille_bloc; \      __indice_bit = (35 - 1) % __taille_bloc; \
     __masque = ((t_8_bits) 1) << (__taille_bloc - __indice_bit - 1); \      __masque = ((t_8_bits) 1) << (__taille_bloc - __indice_bit - 1); \
     if (((*rpl_arguments).drapeaux_etat[__indice_bloc] & __masque) != 0) \      if (((*rpl_arguments).drapeaux_etat[__indice_bloc] & __masque) != 0) \
     { \      { \
         createNameObject(object); \          createNameObject(rpl_object); \
         __CATCH_SYSTEM_ERROR__; \          __CATCH_SYSTEM_ERROR__; \
         { \          { \
             char *__constant_name; \              char *__constant_name; \
Line 583 Line 690
                 systemError("Memory allocation error"); \                  systemError("Memory allocation error"); \
             sprintf(__constant_name, "%s$%s", __library_name, \              sprintf(__constant_name, "%s$%s", __library_name, \
                     __function_name); \                      __function_name); \
             setName(object, __constant_name); \              setName(rpl_object, __constant_name); \
             free(__constant_name); \              free(__constant_name); \
         } \          } \
     } \      } \
     else \      else \
     { \      { \
         createComplexObject(object); \          createComplexObject(rpl_object); \
         __CATCH_SYSTEM_ERROR__; \          __CATCH_SYSTEM_ERROR__; \
         setComplex(object, rp, im); \          setComplex(rpl_object, rp, im); \
     } \      } \
     __CATCH_SYSTEM_ERROR__; \      __CATCH_SYSTEM_ERROR__; \
     __constante--; } while(0)      __constante--; } while(0)
   
 // Integer  // Integer
   
 #define setInteger(object, value) do { \  #define setInteger(rpl_object, value) do { \
     ifIsInteger(object) \      ifIsInteger(rpl_object) \
     { \      { \
         if ((*object).nombre_occurrences > 1) \          if ((*rpl_object).nombre_occurrences > 1) \
         { \          { \
             struct_objet *__tmp_object; \              struct_objet *__tmp_rpl_object; \
             if ((__tmp_object = copie_objet(object, 'O')) == NULL) \              if ((__tmp_rpl_object = _copie_objet(rpl_object, 'O')) == NULL) \
                 systemError("Memory allocation error"); \                  systemError("Memory allocation error"); \
             liberation(object); \              _liberation(rpl_object); \
             object = __tmp_object; \              rpl_object = __tmp_rpl_object; \
         } \          } \
         (*((integer8 *) (*object).objet)) = (integer8) value; \          (*((integer8 *) (*rpl_object).objet)) = (integer8) value; \
     } \      } \
     else executionError("Type mistmatch error"); } while(0)      else executionError("Type mistmatch error"); } while(0)
   
 #define isInteger(object) \  #define isInteger(rpl_object) \
     ((*object).type == INT)      ((*rpl_object).type == INT)
   
 #define ifIsInteger(object) if (isInteger(object))  #define ifIsInteger(rpl_object) if (isInteger(rpl_object))
 #define elseIfIsInteger(object) } else ifIsInteger(object)  #define elseIfIsInteger(rpl_object) } else ifIsInteger(rpl_object)
   
 #define getInteger(object, value) do { \  #define getInteger(rpl_object, value) do { \
     value = 0; \      value = 0; \
     ifIsInteger(object) value = (*((integer8 *) (*object).objet)); \      ifIsInteger(rpl_object) value = (*((integer8 *) (*rpl_object).objet)); \
     else executionError("Type mismatch error"); } while(0)      else executionError("Type mismatch error"); } while(0)
   
 #define createIntegerObject(object) do { \  #define createIntegerObject(rpl_object) do { \
     if (object != NULL) \      if (rpl_object != NULL) \
         systemError("Reallocated object"); \          systemError("Reallocated object"); \
     if ((object = allocation(INT)) == NULL) \      if ((rpl_object = _allocation(INT)) == NULL) \
         systemError("Memory allocation error"); \          systemError("Memory allocation error"); \
     setInteger(object, 0); } while(0)      setInteger(rpl_object, 0); } while(0)
   
 // Real  // Real
   
 #define setReal(object, value) do { \  #define setReal(rpl_object, value) do { \
     ifIsReal(object) \      ifIsReal(rpl_object) \
     { \      { \
         if ((*object).nombre_occurrences > 1) \          if ((*rpl_object).nombre_occurrences > 1) \
         { \          { \
             struct_objet *__tmp_object; \              struct_objet *__tmp_rpl_object; \
             if ((__tmp_object = copie_objet(object, 'O')) == NULL) \              if ((__tmp_rpl_object = _copie_objet(rpl_object, 'O')) == NULL) \
                 systemError("Memory allocation error"); \                  systemError("Memory allocation error"); \
             liberation(object); \              _liberation(rpl_object); \
             object = __tmp_object; \              rpl_object = __tmp_rpl_object; \
         } \          } \
         (*((real8 *) (*object).objet)) = (real8) value; \          (*((real8 *) (*rpl_object).objet)) = (real8) value; \
     } \      } \
     else executionError("Type mistmatch error"); } while(0)      else executionError("Type mistmatch error"); } while(0)
   
 #define isReal(object) \  #define isReal(rpl_object) \
     ((*object).type == REL)      ((*rpl_object).type == REL)
   
 #define ifIsReal(object) if (isReal(object))  #define ifIsReal(rpl_object) if (isReal(rpl_object))
 #define elseIfIsReal(object) } else ifIsReal(object)  #define elseIfIsReal(rpl_object) } else ifIsReal(rpl_object)
   
 #define getReal(object, value) do { \  #define getReal(rpl_object, value) do { \
     value = 0; \      value = 0; \
     ifIsReal(object) value = (*((real8 *) (*object).objet)); \      ifIsReal(rpl_object) value = (*((real8 *) (*rpl_object).objet)); \
     else executionError("Type mismatch error"); } while(0)      else executionError("Type mismatch error"); } while(0)
   
 #define createRealObject(object) do { \  #define createRealObject(rpl_object) do { \
     if (object != NULL) \      if (rpl_object != NULL) \
         systemError("Reallocated object"); \          systemError("Reallocated object"); \
     if ((object = allocation(REL)) == NULL) \      if ((rpl_object = _allocation(REL)) == NULL) \
         systemError("Memory allocation error"); \          systemError("Memory allocation error"); \
     setReal(object, 0); } while(0)      setReal(rpl_object, 0); } while(0)
   
 // Complex  // Complex
   
 #define setComplex(object, rp, ip) do { \  #define setComplex(rpl_object, rp, ip) do { \
     typeof(rp) __rp = rp; \      typeof(rp) __rp = rp; \
     typeof(ip) __ip = ip; \      typeof(ip) __ip = ip; \
     ifIsComplex(object) \      ifIsComplex(rpl_object) \
     { \      { \
         if ((*object).nombre_occurrences > 1) \          if ((*rpl_object).nombre_occurrences > 1) \
         { \          { \
             struct_objet *__tmp_object; \              struct_objet *__tmp_rpl_object; \
             if ((__tmp_object = copie_objet(object, 'O')) == NULL) \              if ((__tmp_rpl_object = _copie_objet(rpl_object, 'O')) == NULL) \
                 systemError("Memory allocation error"); \                  systemError("Memory allocation error"); \
             liberation(object); \              _liberation(rpl_object); \
             object = __tmp_object; \              rpl_object = __tmp_rpl_object; \
         } \          } \
         setRealPartOfComplex(object, __rp); \          setRealPartOfComplex(rpl_object, __rp); \
         setImaginaryPartOfComplex(object, __ip); \          setImaginaryPartOfComplex(rpl_object, __ip); \
     } \      } \
     else executionError("Type mismatch error"); } while(0)      else executionError("Type mismatch error"); } while(0)
   
 #define setRealPartOfComplex(object, value) do { \  #define setRealPartOfComplex(rpl_object, value) do { \
     if ((*object).nombre_occurrences > 1) \      if ((*rpl_object).nombre_occurrences > 1) \
     { \      { \
         struct_objet *__tmp_object; \          struct_objet *__tmp_rpl_object; \
         if ((__tmp_object = copie_objet(object, 'O')) == NULL) \          if ((__tmp_rpl_object = _copie_objet(rpl_object, 'O')) == NULL) \
             systemError("Memory allocation error"); \              systemError("Memory allocation error"); \
         liberation(object); \          _liberation(rpl_object); \
         object = __tmp_object; \          rpl_object = __tmp_rpl_object; \
     } \      } \
     ifIsComplex(object) (*((complex16 *) (*object).objet)).partie_reelle = \      ifIsComplex(rpl_object) (*((complex16 *) (*rpl_object).objet)) \
             value; \              .partie_reelle = value; \
     else executionError("Type mismatch error"); } while(0)      else executionError("Type mismatch error"); } while(0)
   
 #define setImaginaryPartOfComplex(object, value) do { \  #define setImaginaryPartOfComplex(rpl_object, value) do { \
     if ((*object).nombre_occurrences > 1) \      if ((*rpl_object).nombre_occurrences > 1) \
     { \      { \
         struct_objet *__tmp_object; \          struct_objet *__tmp_rpl_object; \
         if ((__tmp_object = copie_objet(object, 'O')) == NULL) \          if ((__tmp_rpl_object = _copie_objet(rpl_object, 'O')) == NULL) \
             systemError("Memory allocation error"); \              systemError("Memory allocation error"); \
         liberation(object); \          _liberation(rpl_object); \
         object = __tmp_object; \          rpl_object = __tmp_rpl_object; \
     } \      } \
     (*((complex16 *) (*object).objet)).partie_imaginaire = value; \      (*((complex16 *) (*rpl_object).objet)).partie_imaginaire = value; \
     else executionError("Type mismatch error"); } while(0)      else executionError("Type mismatch error"); } while(0)
   
 #define getRealPartOfComplex(object, value) \  #define getRealPartOfComplex(rpl_object, value) \
     value = (*((complex16 *) (*object).objet)).partie_reelle      value = (*((complex16 *) (*rpl_object).objet)).partie_reelle
   
 #define getImaginaryPartOfComplex(object, value) \  #define getImaginaryPartOfComplex(rpl_object, value) \
     value = (*((complex16 *) (*object).objet)).partie_imaginaire      value = (*((complex16 *) (*rpl_object).objet)).partie_imaginaire
   
 #define isComplex(object) \  #define isComplex(rpl_object) \
     ((*object).type == CPL)      ((*rpl_object).type == CPL)
   
 #define ifIsComplex(object) if (isComplex(object))  #define ifIsComplex(rpl_object) if (isComplex(rpl_object))
 #define elseIfIsComplex(object) } else ifIsComplex(object)  #define elseIfIsComplex(rpl_object) } else ifIsComplex(rpl_object)
   
 #define getComplex(object, value) do { \  #define getComplex(rpl_object, value) do { \
     value.partie_reelle = 0; \      value.partie_reelle = 0; \
     value.partie_imaginaire = 0; \      value.partie_imaginaire = 0; \
     ifIsComplex(object) value = (*((complex16 *) (*object).objet)); \      ifIsComplex(rpl_object) value = (*((complex16 *) (*rpl_object).objet)); \
     else systemError("Not a complex"); } while(0)      else systemError("Not a complex"); } while(0)
   
 #define createComplexObject(object) do { \  #define createComplexObject(rpl_object) do { \
     if (object != NULL) \      if (rpl_object != NULL) \
         systemError("Reallocated object"); \          systemError("Reallocated object"); \
     if ((object = allocation(CPL)) == NULL) \      if ((rpl_object = _allocation(CPL)) == NULL) \
         systemError("Memory allocation error"); \          systemError("Memory allocation error"); \
     setComplex(object, 0, 0); } while(0)      setComplex(rpl_object, 0, 0); } while(0)
   
 // Generalized vectors  // Generalized vectors
   
 #define createVectorObject(object, size, otype, structure, cat) do { \  #define createVectorObject(rpl_object, size, otype, structure, cat) do { \
     integer8 i; \      integer8 i; \
     if (object != NULL) \      struct_processus *s_etat_processus; \
       s_etat_processus = (*rpl_arguments).s_etat_processus; \
       if (rpl_object != NULL) \
         systemError("Reallocated object"); \          systemError("Reallocated object"); \
     if ((object = allocation(cat)) == NULL) \      if ((rpl_object = _allocation(cat)) == NULL) \
         systemError("Memory allocation error"); \          systemError("Memory allocation error"); \
     (*((structure *) (*object).objet)).taille = size; \      (*((structure *) (*rpl_object).objet)).taille = size; \
     if (((*((structure *) (*object).objet)).tableau = \      if (((*((structure *) (*rpl_object).objet)).tableau = \
             malloc(size * sizeof(otype))) == NULL) \              malloc(size * sizeof(otype))) == NULL) \
         systemError("Memory allocation error"); \          systemError("Memory allocation error"); \
     if (cat != VCX) \      if (cat != VCX) \
     { \      { \
         if (cat == VIN) \          if (cat == VIN) \
             (*((structure *) (*object).objet)).type = 'I'; \              (*((structure *) (*rpl_object).objet)).type = 'I'; \
         else \          else \
             (*((structure *) (*object).objet)).type = 'R'; \              (*((structure *) (*rpl_object).objet)).type = 'R'; \
         for(i = 0; i < size; ((otype *) (*((structure *) (*object).objet)) \          for(i = 0; i < size; ((otype *) (*((structure *) (*rpl_object).objet)) \
                 .tableau)[i++] = (otype) 0); \                  .tableau)[i++] = (otype) 0); \
     } \      } \
     else \      else \
     { \      { \
         (*((structure *) (*object).objet)).type = 'C'; \          (*((structure *) (*rpl_object).objet)).type = 'C'; \
         for(i = 0; i < size; i++) \          for(i = 0; i < size; i++) \
         { \          { \
             ((complex16 *) (*((structure *) (*object).objet)).tableau)[i] \              ((complex16 *) (*((structure *) (*rpl_object).objet)).tableau)[i] \
                     .partie_reelle = 0; \                      .partie_reelle = 0; \
             ((complex16 *) (*((structure *) (*object).objet)).tableau)[i] \              ((complex16 *) (*((structure *) (*rpl_object).objet)).tableau)[i] \
                     .partie_imaginaire = 0; \                      .partie_imaginaire = 0; \
         } \          } \
     } } while(0)      } } while(0)
   
 // Integer vector  // Integer vector
   
 #define setIntegerIntoVector(object, value, position) do { \  #define setIntegerIntoVector(rpl_object, value, position) do { \
     typeof(position) __position = position; \      typeof(position) __position = position; \
     ifIsIntegerVector(object) \      ifIsIntegerVector(rpl_object) \
     { \      { \
         if ((*object).nombre_occurrences > 1) \          if ((*rpl_object).nombre_occurrences > 1) \
         { \          { \
             struct_objet *__tmp_object; \              struct_objet *__tmp_rpl_object; \
             if ((__tmp_object = copie_objet(object, 'O')) == NULL) \              if ((__tmp_rpl_object = _copie_objet(rpl_object, 'O')) == NULL) \
                 systemError("Memory allocation error"); \                  systemError("Memory allocation error"); \
             liberation(object); \              _liberation(rpl_object); \
             object = __tmp_object; \              rpl_object = __tmp_rpl_object; \
         } \          } \
         __position--; \          __position--; \
         if ((__position < 0) || (__position >= (*((struct_vecteur *) \          if ((__position < 0) || (__position >= (*((struct_vecteur *) \
                 (*object).objet)).taille)) \                  (*rpl_object).objet)).taille)) \
             { executionError("Element out of range"); } \              { executionError("Element out of range"); } \
         else \          else \
             ((integer8 *) (*((struct_vecteur *) (*object).objet)).tableau) \              ((integer8 *) (*((struct_vecteur *) (*rpl_object).objet)).tableau) \
                     [__position] = (integer8) value; \                      [__position] = (integer8) value; \
     } \      } \
     else executionError("Type mistmatch error"); } while(0)      else executionError("Type mistmatch error"); } while(0)
   
 #define isIntegerVector(object) \  #define isIntegerVector(rpl_object) \
     ((*object).type == VIN)      ((*rpl_object).type == VIN)
   
 #define ifIsIntegerVector(object) if (isIntegerVector(object))  #define ifIsIntegerVector(rpl_object) if (isIntegerVector(rpl_object))
 #define elseIfIsIntegerVector(object) } else ifIsIntegerVector(object)  #define elseIfIsIntegerVector(rpl_object) } else ifIsIntegerVector(rpl_object)
   
 #define getIntegerFromVector(object, value, position) do { \  #define getIntegerFromVector(rpl_object, value, position) do { \
     typeof(position) __position = position; \      typeof(position) __position = position; \
     value = 0; \      value = 0; \
     ifIsIntegerVector(object) \      ifIsIntegerVector(rpl_object) \
     { \      { \
         __position--; \          __position--; \
         if ((__position < 0) || (__position >= (*((struct_vecteur *) \          if ((__position < 0) || (__position >= (*((struct_vecteur *) \
                 (*object).objet)).taille)) \                  (*rpl_object).objet)).taille)) \
             executionError("Element out of range"); \              executionError("Element out of range"); \
         else \          else \
             value = ((integer8 *) (*((struct_vecteur *) (*object).objet)) \              value = ((integer8 *) (*((struct_vecteur *) (*rpl_object).objet)) \
                 .tableau)[__position]; \                  .tableau)[__position]; \
     } \      } \
     else executionError("Type mismatch error"); } while(0)      else executionError("Type mismatch error"); } while(0)
   
 #define createIntegerVectorObject(object, size) \  #define createIntegerVectorObject(rpl_object, size) \
     createVectorObject(object, size, integer8, struct_vecteur, VIN)      createVectorObject(rpl_object, size, integer8, struct_vecteur, VIN)
   
 // Real vector  // Real vector
   
 #define setRealIntoVector(object, value, position) do { \  #define setRealIntoVector(rpl_object, value, position) do { \
     typeof(position) __position = position; \      typeof(position) __position = position; \
     ifIsRealVector(object) \      ifIsRealVector(rpl_object) \
     { \      { \
         if ((*object).nombre_occurrences > 1) \          if ((*rpl_object).nombre_occurrences > 1) \
         { \          { \
             struct_objet *__tmp_object; \              struct_objet *__tmp_rpl_object; \
             if ((__tmp_object = copie_objet(object, 'O')) == NULL) \              if ((__tmp_rpl_object = _copie_objet(rpl_object, 'O')) == NULL) \
                 systemError("Memory allocation error"); \                  systemError("Memory allocation error"); \
             liberation(object); \              _liberation(rpl_object); \
             object = __tmp_object; \              rpl_object = __tmp_rpl_object; \
         } \          } \
         __position--; \          __position--; \
         if ((__position < 0) || (__position >= (*((struct_vecteur *) \          if ((__position < 0) || (__position >= (*((struct_vecteur *) \
                 (*object).objet)).taille)) \                  (*rpl_object).objet)).taille)) \
             { executionError("Element out of range"); } \              { executionError("Element out of range"); } \
         else \          else \
             ((real8 *) (*((struct_vecteur *) (*object).objet)).tableau) \              ((real8 *) (*((struct_vecteur *) (*rpl_object).objet)).tableau) \
                     [__position] = (real8) value; \                      [__position] = (real8) value; \
     } \      } \
     else executionError("Type mistmatch error"); } while(0)      else executionError("Type mistmatch error"); } while(0)
   
 #define isRealVector(object) \  #define isRealVector(rpl_object) \
     ((*object).type == VRL)      ((*rpl_object).type == VRL)
   
 #define ifIsRealVector(object) if (isRealVector(object))  #define ifIsRealVector(rpl_object) if (isRealVector(rpl_object))
 #define elseIfIsRealVector(object) } else ifIsRealVector(object)  #define elseIfIsRealVector(rpl_object) } else ifIsRealVector(rpl_object)
   
 #define getRealFromVector(object, value, position) do { \  #define getRealFromVector(rpl_object, value, position) do { \
     typeof(position) __position = position; \      typeof(position) __position = position; \
     value = 0; \      value = 0; \
     ifIsRealVector(object) \      ifIsRealVector(rpl_object) \
     { \      { \
         __position--; \          __position--; \
         if ((__position < 0) || (__position >= (*((struct_vecteur *) \          if ((__position < 0) || (__position >= (*((struct_vecteur *) \
                 (*object).objet)).taille)) \                  (*rpl_object).objet)).taille)) \
             executionError("Element out of range"); \              executionError("Element out of range"); \
         value = ((real8 *) (*((struct_vecteur *) (*object).objet)).tableau) \          value = ((real8 *) (*((struct_vecteur *) (*rpl_object).objet)) \
                 [__position]; \                  .tableau)[__position]; \
     } \      } \
     else executionError("Type mismatch error"); } while(0)      else executionError("Type mismatch error"); } while(0)
   
 #define createRealVectorObject(object, size) \  #define createRealVectorObject(rpl_object, size) \
     createVectorObject(object, size, real8, struct_vecteur, VRL)      createVectorObject(rpl_object, size, real8, struct_vecteur, VRL)
   
 // A FIXER  // A FIXER
   
Line 876 Line 985
   
 // Binary integer  // Binary integer
   
 #define setBinaryInteger(object, value) do { \  #define setBinaryInteger(rpl_object, value) do { \
     ifIsBinaryInteger(object) \      ifIsBinaryInteger(rpl_object) \
     { \      { \
         if ((*object).nombre_occurrences > 1) \          if ((*rpl_object).nombre_occurrences > 1) \
         { \          { \
             struct_objet *__tmp_object; \              struct_objet *__tmp_rpl_object; \
             if ((__tmp_object = copie_objet(object, 'O')) == NULL) \              if ((__tmp_rpl_object = _copie_objet(rpl_object, 'O')) == NULL) \
                 systemError("Memory allocation error"); \                  systemError("Memory allocation error"); \
             liberation(object); \              _liberation(rpl_object); \
             object = __tmp_object; \              rpl_object = __tmp_rpl_object; \
         } \          } \
         (*((integer8 *) (*object).objet)) = (integer8) value; \          (*((integer8 *) (*rpl_object).objet)) = (integer8) value; \
     } \      } \
     else executionError("Type mistmatch error"); } while(0)      else executionError("Type mistmatch error"); } while(0)
   
 #define isBinaryInteger(object) \  #define isBinaryInteger(rpl_object) \
     ((*object).type == BIN)      ((*rpl_object).type == BIN)
   
 #define ifIsBinaryInteger(object) if (isBinaryInteger(object))  #define ifIsBinaryInteger(rpl_object) if (isBinaryInteger(rpl_object))
 #define elseIfIsBinaryInteger(object) } else ifIsBinaryInteger(object)  #define elseIfIsBinaryInteger(rpl_object) } else ifIsBinaryInteger(rpl_object)
   
 #define getBinaryInteger(object, value) do { \  #define getBinaryInteger(rpl_object, value) do { \
     value = 0; \      value = 0; \
     ifIsBinaryInteger(object) value = (*((integer8 *) (*object).objet)); \      ifIsBinaryInteger(rpl_object) value = \
               (*((integer8 *) (*rpl_object).objet)); \
     else executionError("Type mismatch error"); } while(0)      else executionError("Type mismatch error"); } while(0)
   
 #define createBinaryIntegerObject(object) do { \  #define createBinaryIntegerObject(rpl_object) do { \
     if (object != NULL) \      if (rpl_object != NULL) \
         systemError("Reallocated object"); \          systemError("Reallocated object"); \
     if ((object = allocation(BIN)) == NULL) \      if ((rpl_object = _allocation(BIN)) == NULL) \
         systemError("Memory allocation error"); \          systemError("Memory allocation error"); \
     setBinaryInteger(object, 0); } while(0)      setBinaryInteger(rpl_object, 0); } while(0)
   
 // Name  // Name
   
 #define isName(object) \  #define isName(rpl_object) \
     ((*object).type == NOM)      ((*rpl_object).type == NOM)
   
 #define ifIsName(object) if (isName(object))  #define ifIsName(rpl_object) if (isName(rpl_object))
 #define elseIfIsName(object)  } else if (isName(object))  #define elseIfIsName(rpl_object)  } else if (isName(rpl_object))
   
 #define setName(object, value) do { \  #define setName(rpl_object, value) do { \
     ifIsName(object) \      struct_processus *s_etat_processus; \
       s_etat_processus = (*rpl_arguments).s_etat_processus; \
       ifIsName(rpl_object) \
     { \      { \
         if ((*object).nombre_occurrences > 1) \          if ((*rpl_object).nombre_occurrences > 1) \
         { \          { \
             struct_objet *__tmp_object; \              struct_objet *__tmp_rpl_object; \
             if ((__tmp_object = copie_objet(object, 'O')) == NULL) \              if ((__tmp_rpl_object = _copie_objet(rpl_object, 'O')) == NULL) \
                 systemError("Memory allocation error"); \                  systemError("Memory allocation error"); \
             liberation(object); \              _liberation(rpl_object); \
             object = __tmp_object; \              rpl_object = __tmp_rpl_object; \
         } \          } \
         free((*((struct_nom *) (*object).objet)).nom); \          free((*((struct_nom *) (*rpl_object).objet)).nom); \
         (*((struct_nom *) (*object).objet)).symbole = d_faux; \          (*((struct_nom *) (*rpl_object).objet)).symbole = d_faux; \
         if (((*((struct_nom *) (*object).objet)).nom = malloc( \          if (((*((struct_nom *) (*rpl_object).objet)).nom = malloc( \
                 (strlen(value) + 1) * sizeof(unsigned char))) == NULL) \                  (strlen(value) + 1) * sizeof(unsigned char))) == NULL) \
             systemError("Memory allocation error"); \              systemError("Memory allocation error"); \
         strcpy((char *) (*((struct_nom *) (*object).objet)).nom, \          strcpy((char *) (*((struct_nom *) (*rpl_object).objet)).nom, \
                 (char *) value); \                  (char *) value); \
     } \      } \
     else executionError("Type mistmatch error"); } while(0)      else executionError("Type mistmatch error"); } while(0)
   
 #define createNameObject(object) do { \  #define setSymbolicName(rpl_object, value) do { \
     if (object != NULL) \      setName(rpl_object, value); \
       (*((struct_nom *) (*rpl_object).objet)).symbole = d_vrai; } while(0)
   
   #define createNameObject(rpl_object) do { \
       struct_processus *s_etat_processus; \
       s_etat_processus = (*rpl_arguments).s_etat_processus; \
       if (rpl_object != NULL) \
         systemError("Reallocated object"); \          systemError("Reallocated object"); \
     if ((object = allocation(NOM)) == NULL) \      if ((rpl_object = _allocation(NOM)) == NULL) \
         systemError("Memory allocation error"); \          systemError("Memory allocation error"); \
     (*((struct_nom *) (*object).objet)).symbole = d_faux; \      (*((struct_nom *) (*rpl_object).objet)).symbole = d_faux; \
     if (((*((struct_nom *) (*object).objet)).nom = malloc( \      if (((*((struct_nom *) (*rpl_object).objet)).nom = malloc( \
             sizeof(unsigned char))) == NULL) \              sizeof(unsigned char))) == NULL) \
         systemError("Memory allocation error"); \          systemError("Memory allocation error"); \
     strcpy((char *) (*((struct_nom *) (*object).objet)).nom, ""); } while(0)      strcpy((char *) (*((struct_nom *) (*rpl_object).objet)).nom, ""); } while(0)
   
 // String  // String
   
 #define isString(object) \  #define isString(rpl_object) \
     ((*object).type == CHN)      ((*rpl_object).type == CHN)
   
 #define ifIsString(object) if (isString(object))  #define ifIsString(rpl_object) if (isString(rpl_object))
 #define elseIfIsString(object) else if (isString(objet))  #define elseIfIsString(rpl_object) } else if (isString(rpl_object))
   
 #define setString(object, string) do { \  #define setString(rpl_object, string) do { \
     ifIsString(object) \      struct_processus *s_etat_processus; \
       s_etat_processus = (*rpl_arguments).s_etat_processus; \
       ifIsString(rpl_object) \
     { \      { \
         if (string == NULL) executionError("Nullified string"); else \          if (string == NULL) executionError("Nullified string"); else \
         { \          { \
             if ((*object).nombre_occurrences > 1) \              if ((*rpl_object).nombre_occurrences > 1) \
             { \              { \
                 struct_objet *__tmp_object; \                  struct_objet *__tmp_rpl_object; \
                 if ((__tmp_object = copie_objet(object, 'O')) == NULL) \                  if ((__tmp_rpl_object = _copie_objet(rpl_object, 'O')) \
                           == NULL) \
                     systemError("Memory allocation error"); \                      systemError("Memory allocation error"); \
                 liberation(object); \                  _liberation(rpl_object); \
                 object = __tmp_object; \                  rpl_object = __tmp_rpl_object; \
             } \              } \
             free((unsigned char *) (*object).objet); \              free((unsigned char *) (*rpl_object).objet); \
             if (((*object).objet = malloc((strlen(string) + 1) * \              if (((*rpl_object).objet = malloc((strlen(string) + 1) * \
                     sizeof(unsigned char))) == NULL) \                      sizeof(unsigned char))) == NULL) \
                 systemError("Memory allocation error"); \                  systemError("Memory allocation error"); \
             strcpy((char *) (*object).objet, string); \              strcpy((char *) (*rpl_object).objet, string); \
         } \          } \
     } \      } \
     else executionError("Type mistmatch error"); } while(0)      else executionError("Type mistmatch error"); } while(0)
   
 #define getString(object, string) do { \  #define getString(rpl_object, string) do { \
     string = NULL; \      string = NULL; \
     ifIsString(object) string = (char *) (*object).objet; \      ifIsString(rpl_object) string = (char *) (*rpl_object).objet; \
     else executionError("Type mismatch error"); } while(0)      else executionError("Type mismatch error"); } while(0)
   
 #define createStringObject(object) do { \  #define createStringObject(rpl_object) do { \
     if (object != NULL) \      struct_processus *s_etat_processus; \
       s_etat_processus = (*rpl_arguments).s_etat_processus; \
       if (rpl_object != NULL) \
         systemError("Reallocated object"); \          systemError("Reallocated object"); \
     if ((object = allocation(CHN)) == NULL) \      if ((rpl_object = _allocation(CHN)) == NULL) \
         systemError("Memory allocation error"); \          systemError("Memory allocation error"); \
     if (((*object).objet = malloc(sizeof(unsigned char))) == NULL) \      if (((*rpl_object).objet = malloc(sizeof(unsigned char))) == NULL) \
         systemError("Memory allocation error"); \          systemError("Memory allocation error"); \
     strcpy((char *) (*object).objet, ""); } while(0)      strcpy((char *) (*rpl_object).objet, ""); } while(0)
   
 // List  // List
   
 #define isList(object) \  #define isList(rpl_object) \
     ((*object).type == LST)      ((*rpl_object).type == LST)
   
 #define ifIsList(object) if (isList(object))  #define ifIsList(rpl_object) if (isList(rpl_object))
 #define elseIfIsList(object) else if (isList(object))  #define elseIfIsList(rpl_object) else if (isList(rpl_object))
   
 #define createListObject(object) do { \  #define createListObject(rpl_object) do { \
     if (object != NULL) \      if (rpl_object != NULL) \
         systemError("Reallocated object"); \          systemError("Reallocated object"); \
     if ((object = allocation(LST)) == NULL) \      if ((rpl_object = _allocation(LST)) == NULL) \
         systemError("Memory allocation error"); \          systemError("Memory allocation error"); \
     (*object).objet = NULL; } while(0)      (*rpl_object).objet = NULL; } while(0)
   
 #define addObjectToList(list, object) do { \  #define addObjectToList(list, rpl_object) do { \
       struct_processus *s_etat_processus; \
       s_etat_processus = (*rpl_arguments).s_etat_processus; \
     ifIsList(list) \      ifIsList(list) \
     { \      { \
         struct_objet *__tmp_object; \          struct_objet *__tmp_rpl_object; \
         if ((__tmp_object = copie_objet(list, 'N')) == NULL) \          if ((__tmp_rpl_object = _copie_objet(list, 'N')) == NULL) \
             systemError("Memory allocation error"); \              systemError("Memory allocation error"); \
         liberation(list); \          _liberation(list); \
         list = __tmp_object; \          list = __tmp_rpl_object; \
         if ((*list).objet == NULL) \          if ((*list).objet == NULL) \
         { \          { \
             if (((*list).objet = malloc(sizeof(struct_liste_chainee))) \              if (((*list).objet = malloc(sizeof(struct_liste_chainee))) \
                     == NULL) \                      == NULL) \
                 systemError("Memory allocation error"); \                  systemError("Memory allocation error"); \
             (*((struct_liste_chainee *) (*list).objet)).suivant = NULL; \              (*((struct_liste_chainee *) (*list).objet)).suivant = NULL; \
             (*((struct_liste_chainee *) (*list).objet)).donnee = object; \              (*((struct_liste_chainee *) (*list).objet)).donnee = rpl_object; \
         } \          } \
         else \          else \
         { \          { \
Line 1035 Line 1160
                 systemError("Memory allocation error"); \                  systemError("Memory allocation error"); \
             l_element_courant = (*l_element_courant).suivant; \              l_element_courant = (*l_element_courant).suivant; \
             (*l_element_courant).suivant = NULL; \              (*l_element_courant).suivant = NULL; \
             (*l_element_courant).donnee = object; \              (*l_element_courant).donnee = rpl_object; \
         } \          } \
         object = NULL; \          rpl_object = NULL; \
     } \      } \
     else executionError("Type mistmatch error"); } while(0)      else executionError("Type mistmatch error"); } while(0)
   
 #define insertObjectIntoList(list, object) do { \  #define insertObjectIntoList(list, rpl_object) do { \
       struct_processus *s_etat_processus; \
       s_etat_processus = (*rpl_arguments).s_etat_processus; \
     ifIsList(list) \      ifIsList(list) \
     { \      { \
         struct_objet *__tmp_object; \          struct_objet *__tmp_rpl_object; \
         if ((__tmp_object = copie_objet(list, 'N')) == NULL) \          if ((__tmp_rpl_object = _copie_objet(list, 'N')) == NULL) \
             systemError("Memory allocation error"); \              systemError("Memory allocation error"); \
         liberation(list); \          _liberation(list); \
         list = __tmp_object; \          list = __tmp_rpl_object; \
         if ((*list).objet == NULL) \          if ((*list).objet == NULL) \
         { \          { \
             if (((*list).objet = malloc(sizeof(struct_liste_chainee))) \              if (((*list).objet = malloc(sizeof(struct_liste_chainee))) \
                     == NULL) \                      == NULL) \
                 systemError("Memory allocation error"); \                  systemError("Memory allocation error"); \
             (*((struct_liste_chainee *) (*list).objet)).suivant = NULL; \              (*((struct_liste_chainee *) (*list).objet)).suivant = NULL; \
             (*((struct_liste_chainee *) (*list).objet)).donnee = object; \              (*((struct_liste_chainee *) (*list).objet)).donnee = rpl_object; \
         } \          } \
         else \          else \
         { \          { \
Line 1063 Line 1190
             if ((l_element_courant = \              if ((l_element_courant = \
                     malloc(sizeof(struct_liste_chainee))) == NULL) \                      malloc(sizeof(struct_liste_chainee))) == NULL) \
                 systemError("Memory allocation error"); \                  systemError("Memory allocation error"); \
             (*l_element_courant).donnee = object; \              (*l_element_courant).donnee = rpl_object; \
             (*l_element_courant).suivant = (*list).objet; \              (*l_element_courant).suivant = (*list).objet; \
             (*list).objet = l_element_courant; \              (*list).objet = l_element_courant; \
         } \          } \
         object = NULL; \          rpl_object = NULL; \
     } \      } \
     else executionError("Type mistmatch error"); } while(0)      else executionError("Type mistmatch error"); } while(0)
   
 #define removeObjectFromList(list, object) do { \  #define removeObjectFromList(list, rpl_object) do { \
       struct_processus *s_etat_processus; \
       s_etat_processus = (*rpl_arguments).s_etat_processus; \
     ifIsList(list) \      ifIsList(list) \
     { \      { \
         if ((*list).objet != NULL) \          if ((*list).objet != NULL) \
Line 1080 Line 1209
             struct_liste_chainee    *__previous; \              struct_liste_chainee    *__previous; \
             __current = (*list).objet; \              __current = (*list).objet; \
             __previous = NULL; \              __previous = NULL; \
             if ((*__current).donnee == object) \              if ((*__current).donnee == rpl_object) \
             { \              { \
                 (*list).objet = (*__current).suivant; \                  (*list).objet = (*__current).suivant; \
             } \              } \
Line 1088 Line 1217
             { \              { \
                 while(__current != NULL) \                  while(__current != NULL) \
                 { \                  { \
                     if ((*__current).donnee == object) \                      if ((*__current).donnee == rpl_object) \
                     { \                      { \
                         (*__previous).suivant = (*__current).suivant; \                          (*__previous).suivant = (*__current).suivant; \
                         break; \                          break; \
Line 1097 Line 1226
                     __current = (*__current).suivant; \                      __current = (*__current).suivant; \
                 } \                  } \
             } \              } \
             liberation((*__current).donnee); \              _liberation((*__current).donnee); \
             free(__current); \              free(__current); \
         } \          } \
     } \      } \
     else executionError("Type mistmatch error"); } while(0)      else executionError("Type mistmatch error"); } while(0)
   
 #define getObjectFromList(list, position, object)  #define getObjectFromList(list, position, rpl_object)
   
 #define putObjectIntoList(list, position, object)  #define putObjectIntoList(list, position, rpl_object)
   
 #define getListFromList(list, position1, position2, object)  #define getListFromList(list, position1, position2, rpl_object)
   
 #define listLength(list, length) do { \  #define listLength(list, length) do { \
     if (list == NULL) executionError("Nullified object"); \      if (list == NULL) executionError("Nullified object"); \
Line 1124 Line 1253
         } \          } \
     } } 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 1133 Line 1282
 #define size(a) sizeof(a)  #define size(a) sizeof(a)
   
 #define allocate(a) ({ void *ptr; \  #define allocate(a) ({ void *ptr; \
       struct_processus *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 deallocate(a) free(a)  #define reallocate(a, s) ({ void *ptr; \
       struct_processus *s_etat_processus; \
       s_etat_processus = (*rpl_arguments).s_etat_processus; \
       if ((ptr = realloc(a, s)) == NULL) \
           { systemError("Memory allocation error"); \
           __CATCH_SYSTEM_ERROR__; } ptr; }) \
   
   #define deallocate(a) do { \
       struct_processus *s_etat_processus; \
       s_etat_processus = (*rpl_arguments).s_etat_processus; \
       free(a); } while(0)
   
 /*  /*
 --------------------------------------------------------------------------------  --------------------------------------------------------------------------------
Line 1165 Line 1327
   
 #endif  #endif
   
 static struct_rpl_arguments __static_rpl_arguments;  
 #define __RPL__ struct_rpl_arguments *rpl_arguments; \  
     rpl_arguments = &__static_rpl_arguments;  
   
 // vim: ts=4  // vim: ts=4

Removed from v.1.50  
changed lines
  Added in v.1.87


CVSweb interface <joel.bertrand@systella.fr>