Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: bitmsk.h
- Revision:
- 0:b3a2e39a13ad
- Child:
- 1:a4c87bc5b008
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bitmsk.h	Wed Nov 28 18:52:43 2012 +0000
@@ -0,0 +1,52 @@
+/*
+ * bitmsk.h
+ */
+
+#ifndef bitmsk_H
+#define bitmsk_H
+
+#include <string.h>
+
+#define MAX_TACHES  32          // Maxi arbitraire
+#define BITMSK_SIZE MAX_TACHES / 8
+#define BITMSK_RIEN 0
+typedef unsigned char BITMSK;
+
+typedef enum          { ADD,
+                        REM,
+                        SETF,
+                        SETB,
+                        SETA,
+                        IS
+                      } TMODE;          // cf Win::seta()
+
+// #define NOPID   -1    // DOS
+
+#define NOPIDUNIX   -1
+typedef int     PID;            // De NOPID a MAX_TACHES
+
+#define BITMODE TMODE           // cf. video.h
+
+class Bitmsk
+{
+    // Membres
+private:
+    BITMSK    bits[ BITMSK_SIZE ];
+
+    // Methodes
+public:
+    bool     requete( BITMODE mode,PID pid );
+    void     raz(     void );
+
+    // Constructeurs
+public:
+    Bitmsk(  PID nb = 0,... );
+    Bitmsk(  Bitmsk &modele );
+};
+
+/*****************************************************************************
+ * Prototypes des fonctions d'interface                                      *
+ *****************************************************************************/
+BITMSK setmsk( BITMSK *bitmsk,BITMODE mode,BITMSK new_msk );
+
+#endif