summaryrefslogtreecommitdiff
path: root/src/common/bits.h
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2017-03-30 17:20:58 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2017-03-30 17:20:58 (GMT)
commitdda68634391bea512a7861468fcf45f8292300bb (patch)
treec56c9b1c0bb4500973247eef12ccadaf4ebe346d /src/common/bits.h
parentb8d5a539b1e6837f7395598a3fa25ef69650e885 (diff)
Discriminated between tests for set and unset ranges of bits.
Diffstat (limited to 'src/common/bits.h')
-rw-r--r--src/common/bits.h42
1 files changed, 7 insertions, 35 deletions
diff --git a/src/common/bits.h b/src/common/bits.h
index 1396789..4a2937f 100644
--- a/src/common/bits.h
+++ b/src/common/bits.h
@@ -29,9 +29,6 @@
-/* ----------------------------- CHAMPS DE BITS SIMPLES ----------------------------- */
-
-
/* Champ de bits simple */
typedef struct _bitfield_t bitfield_t;
@@ -70,7 +67,13 @@ void and_bit_field(bitfield_t *, const bitfield_t *);
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(const bitfield_t *, size_t, size_t);
+bool test_in_bit_field(const bitfield_t *, size_t);
+
+/* Détermine si un ensemble de bits est à 0 dans un champ. */
+bool test_none_in_bit_field(const bitfield_t *, size_t, size_t);
+
+/* Détermine si un ensemble de bits est à 1 dans un champ. */
+bool test_all_in_bit_field(const 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 *);
@@ -80,37 +83,6 @@ bool is_bit_field_equal_to(const bitfield_t *, const bitfield_t *);
unsigned long gfw(const bitfield_t *);
-#if 0
-/* ------------------------- CHAMPS LIES À UNE ZONE MEMOIRE ------------------------- */
-
-
-/* Champ de bits couvrant une mémoire */
-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 *, bool);
-
-/* Crée une copie de champ de bits couvrant une zone mémoire. */
-memfield_t *create_mem_field_from(const memfield_t *);
-
-/* Supprime de la mémoire un champ de bits donné. */
-void delete_mem_field(memfield_t *);
-
-/* Crée une copie d'un champ de bits couvrant une zone mémoire. */
-memfield_t *dup_mem_field(const memfield_t *);
-
-/* Bascule à 1 un bit d'un champ de bits. */
-void set_in_mem_field(memfield_t *, const vmpa2t *);
-
-/* Détermine si un bit est à 1 dans un champ de bits. */
-bool test_in_mem_field(memfield_t *, const vmpa2t *);
-
-
-
-#define set_atomic_in_mem_field(f, range) false
-
-#endif
#endif /* _COMMON_BITS_H */