Main Page | Data Structures | File List | Globals | Related Pages

id.h

Go to the documentation of this file.
00001 
00011 #ifndef __KERN_ID_H__
00012 #define __KERN_ID_H__
00013 
00014 /* a mapping from an individual id to assocated data */
00015 typedef struct IdEntry
00016 {
00017         /* the thread id */
00018         int id;
00019         /* the associated data */
00020         void * data;
00021 } IdEntry;
00022 
00023 /* a hash table of ids mapping to thread data */
00024 typedef struct
00025 {
00026         /* the next id to be assigned */
00027         int nextId;
00028         /* the number of entries in the table */
00029         unsigned int entryCount;
00030         /* the entries of the table */
00031         IdEntry * entries;
00032 } IdTable;
00033 
00044 extern int id_table_create (IdTable * table, unsigned int size);
00053 extern void id_table_destroy (IdTable * table);
00054 
00065 extern int id_table_insert (IdTable * table, void * data);
00076 extern void * id_table_remove (IdTable * table, int id);
00077 
00088 extern void * id_table_find (IdTable * table, int id);
00089 
00090 #endif /* __KERN_ID_H__ */
00091 

Generated on Fri Apr 9 21:59:16 2004 for 15-410 Project 3 by doxygen 1.3.2