diff options
Diffstat (limited to 'src/format/symbol-int.h')
| -rw-r--r-- | src/format/symbol-int.h | 60 | 
1 files changed, 30 insertions, 30 deletions
diff --git a/src/format/symbol-int.h b/src/format/symbol-int.h index 99cee88..7f5807c 100644 --- a/src/format/symbol-int.h +++ b/src/format/symbol-int.h @@ -35,32 +35,31 @@ typedef char * (* get_symbol_label_fc) (const GBinSymbol *);  /* Informations glissées dans la structure GObject de GBinSymbol */ -typedef union _sym_obj_extra +typedef struct _sym_extra_data_t  { -    struct -    { -        SymbolType stype;                   /* Type du symbole             */ -        SymbolStatus status;                /* Visibilité du symbole       */ +    SymbolType stype;                       /* Type du symbole             */ +    SymbolStatus status;                    /* Visibilité du symbole       */ -        char nm_prefix;                     /* Eventuel préfixe "nm"       */ +    char nm_prefix;                         /* Eventuel préfixe "nm"       */ -        SymbolFlag flags;                   /* Informations complémentaires*/ +    SymbolFlag flags;                       /* Informations complémentaires*/ -    }; +} sym_extra_data_t; -    gint lock;                              /* Gestion d'accès aux fanions */ +/* Encapsulation avec un verrou d'accès */ +typedef union _symbol_obj_extra_t +{ +    sym_extra_data_t data;                  /* Données embarquées          */ +    lockable_obj_extra_t lockable;          /* Gestion d'accès aux fanions */ + +} symbol_obj_extra_t; -} sym_obj_extra;  /* Symbole d'exécutable (instance) */  struct _GBinSymbol  {      GObject parent;                         /* A laisser en premier        */ -    mrange_t range;                         /* Couverture mémoire          */ - -    char *alt;                              /* Nom alternatif              */ -  #if __SIZEOF_INT__ == __SIZEOF_LONG__      /** @@ -70,39 +69,40 @@ struct _GBinSymbol       * ce dernier.       */ -    sym_obj_extra extra;                    /* Externalisation embarquée   */ +    symbol_obj_extra_t extra;               /* Externalisation embarquée   */  #endif +    mrange_t range;                         /* Couverture mémoire          */ + +    char *alt;                              /* Nom alternatif              */ +  }; +/* Symbole d'exécutable (classe) */ +struct _GBinSymbolClass +{ +    GObjectClass parent;                    /* A laisser en premier        */ + +    get_symbol_label_fc get_label;          /* Obtention d'une étiquette   */ + +}; + +  /**   * Accès aux informations éventuellement déportées.   */  #if __SIZEOF_INT__ == __SIZEOF_LONG__ -#   define INIT_BIN_SYMBOL_EXTRA(sym) sym->extra.lock = 0 - -#   define GET_BIN_SYMBOL_EXTRA(sym) &sym->extra +#   define GET_BIN_SYMBOL_EXTRA(sym) (sym_extra_data_t *)&sym->extra  #else -#   define INIT_BIN_SYMBOL_EXTRA(sym) INIT_GOBJECT_EXTRA(G_OBJECT(sym)) - -#   define GET_BIN_SYMBOL_EXTRA(sym) GET_GOBJECT_EXTRA(G_OBJECT(sym), sym_obj_extra) +#   define GET_BIN_SYMBOL_EXTRA(sym) GET_GOBJECT_EXTRA(G_OBJECT(sym), sym_extra_data_t)  #endif -/* Symbole d'exécutable (classe) */ -struct _GBinSymbolClass -{ -    GObjectClass parent;                    /* A laisser en premier        */ - -    get_symbol_label_fc get_label;          /* Obtention d'une étiquette   */ - -}; -  #endif  /* _FORMAT_SYMBOL_INT_H */  | 
