c programming

sehj
table.h

//------------------------------------------------------------------------------ // INCLUDE GUARD //------------------------------------------------------------------------------ #ifndef TABLE_H #define TABLE_H //------------------------------------------------------------------------------ // CONSTANTS AND TYPES //------------------------------------------------------------------------------ typedef enum BOOL { false, true } boolean; //------------------------------------------------------------------------------ // PROTOTYPES //------------------------------------------------------------------------------ //-------------------------------------------------- // Add an element to the table // [item]<IN> Item to insert // [boolean]<OUT> True if the item is successfully inserted or already inserted; otherwise, false //-------------------------------------------------- boolean insertItem( int item ); //-------------------------------------------------- // Removes the int from the table // [item]<IN> Item to remove // [boolean]<OUT> True if the item is successfully removed; otherwise, false //-------------------------------------------------- boolean removeItem( int item ); //-------------------------------------------------- // Empty the table so that we clear all memory and can start a fresh table //-------------------------------------------------- void clearTable( void ); //-------------------------------------------------- // Tells us whether or not the given item is in the table // [item]<IN> Item to search // [boolean]<OUT> True if the item is in the table; otherwise, false //-------------------------------------------------- boolean search( int item ); //-------------------------------------------------- // Table iterators // [item]<OUT> First/Next item // [boolean]<OUT> True if the item was assigned; otherwise, false //-------------------------------------------------- boolean firstItem( int * const item ); boolean nextItem( int * const item ); //------------------------------------------------------------------------------ // END OF INCLUDE GUARD //------------------------------------------------------------------------------ #endif