diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2015-10-15 19:18:31 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2015-10-15 19:18:31 (GMT) |
commit | 83dccba3a9b6c18d6fe7b6f30794a16336803962 (patch) | |
tree | 982e6ec5d7eae20020315936cbfbd9494bc9111e /src/common/bits.h | |
parent | c9449c389834c580196527c4e1cb010a701e7a32 (diff) |
Detected loops as introduced in the book "Compilers: Principles, Techniques, and Tools".
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@596 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/common/bits.h')
-rw-r--r-- | src/common/bits.h | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/src/common/bits.h b/src/common/bits.h index 6eeb19c..0e8ef65 100644 --- a/src/common/bits.h +++ b/src/common/bits.h @@ -37,7 +37,7 @@ typedef struct _bitfield_t bitfield_t; /* Crée un champ de bits initialisé à zéro. */ -bitfield_t *create_bit_field(size_t); +bitfield_t *create_bit_field(size_t, bool); /* Crée une copie de champ de bits initialisé à zéro. */ bitfield_t *create_bit_field_from(const bitfield_t *); @@ -45,15 +45,36 @@ bitfield_t *create_bit_field_from(const bitfield_t *); /* Supprime de la mémoire un champ de bits donné. */ void delete_bit_field(bitfield_t *); +/* Copie un champ de bits dans un autre. */ +void copy_bit_field(bitfield_t *, const bitfield_t *); + /* Crée une copie d'un champ de bits classique. */ bitfield_t *dup_bit_field(const bitfield_t *); +/* Bascule à 0 un champ de bits dans son intégralité. */ +void reset_all_in_bit_field(bitfield_t *); + +/* Bascule à 1 un champ de bits dans son intégralité. */ +void set_all_in_bit_field(bitfield_t *); + /* Bascule à 1 une partie d'un champ de bits. */ void set_in_bit_field(bitfield_t *, size_t, size_t); +/* Réalise une opération ET logique entre deux champs de bits. */ +void and_bit_field(bitfield_t *, const bitfield_t *); + +/* Réalise une opération OU logique entre deux champs de bits. */ +void or_bit_field(bitfield_t *, const bitfield_t *); + /* Détermine si un bit est à 1 dans un champ de bits. */ bool test_in_bit_field(bitfield_t *, size_t, size_t); +/* Indique si deux champs de bits sont identiques ou non. */ +bool is_bit_field_equal_to(const bitfield_t *, const bitfield_t *); + + + +unsigned long gfw(const bitfield_t *); /* ------------------------- CHAMPS LIES À UNE ZONE MEMOIRE ------------------------- */ @@ -64,7 +85,7 @@ typedef struct _bitfield_t memfield_t; /* Crée un champ de bits couvrant une zone mémoire. */ -memfield_t *create_mem_field(const mrange_t *); +memfield_t *create_mem_field(const mrange_t *, bool); /* Crée une copie de champ de bits couvrant une zone mémoire. */ memfield_t *create_mem_field_from(const memfield_t *); |