Changeset 440
- Timestamp:
- 2004-07-12 22:59:14 (4 years ago)
- Files:
-
- liboggz/trunk/include/oggz/oggz_table.h (modified) (2 diffs)
- liboggz/trunk/src/liboggz/Version_script.in (modified) (1 diff)
- liboggz/trunk/src/liboggz/oggz_table.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
liboggz/trunk/include/oggz/oggz_table.h
r350 r440 72 72 73 73 /** 74 * Remove the element of an OggzTable indexed by a given key 75 * \param table An OggzTable 76 * \param key a key 77 * \retval 0 Success 78 * \retval -1 Not found 79 */ 80 int 81 oggz_table_remove (OggzTable * table, long key); 82 83 /** 74 84 * Retrieve the element of an OggzTable indexed by a given key 75 85 * \param table An OggzTable … … 90 100 91 101 /** 92 * Retrieve the nth element of an OggzTable 102 * Retrieve the nth element of an OggzTable, and optionally its key 93 103 * \param table An OggzTable 94 104 * \param n An index into the \a table 95 * \param key Return valuefor key corresponding to nth data element96 * of \a table 105 * \param key Return pointer for key corresponding to nth data element 106 * of \a table. Ignored if NULL. 97 107 * \returns The nth data element of \a table 98 108 * \retval NULL \a table is undefined, or \a n is out of range liboggz/trunk/src/liboggz/Version_script.in
r406 r440 48 48 oggz_table_delete; 49 49 oggz_table_insert; 50 oggz_table_remove; 50 51 oggz_table_lookup; 51 52 oggz_table_size; liboggz/trunk/src/liboggz/oggz_table.c
r347 r440 108 108 109 109 int 110 oggz_table_remove (OggzTable * table, long key) 111 { 112 void * old_data; 113 114 if ((old_data = oggz_table_lookup (table, key)) != NULL) { 115 if (oggz_vector_remove_l (table->keys, key) == NULL) 116 return -1; 117 118 if (oggz_vector_remove_p (table->data, old_data) == NULL) { 119 /* XXX: This error condition can only happen if the previous 120 * removal succeeded, and this removal failed, ie. there was 121 * an error reallocing table->data->data downwards. */ 122 return -1; 123 } 124 } 125 126 return 0; 127 } 128 129 int 110 130 oggz_table_size (OggzTable * table) 111 131 {