- Timestamp:
- Aug 15, 2009, 7:08:18 PM (15 years ago)
- Branches:
- master, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 1077891a
- Parents:
- fa4562c
- git-author:
- Anders Kaseorg <andersk@mit.edu> (08/04/09 02:37:51)
- git-committer:
- Anders Kaseorg <andersk@mit.edu> (08/15/09 19:08:18)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
dict.c
r2b37be2 re19eb97 31 31 * this element would logically go, and stores the index in pos. 32 32 * Returns 1 if found, else 0. */ 33 int _owl_dict_find_pos(owl_dict *d, c har *k, int *pos) {33 int _owl_dict_find_pos(owl_dict *d, const char *k, int *pos) { 34 34 int lo = 0, hi = d->size; 35 35 while (lo < hi) { … … 50 50 51 51 /* returns the value corresponding to key k */ 52 void *owl_dict_find_element(owl_dict *d, c har *k) {52 void *owl_dict_find_element(owl_dict *d, const char *k) { 53 53 int found, pos; 54 54 found = _owl_dict_find_pos(d, k, &pos); … … 82 82 Will return -2 if replace=NULL and match was found. 83 83 */ 84 int owl_dict_insert_element(owl_dict *d, c har *k, void *v, void (*free_on_replace)(void *old)) {84 int owl_dict_insert_element(owl_dict *d, const char *k, void *v, void (*free_on_replace)(void *old)) { 85 85 int pos, found; 86 86 char *dupk; … … 113 113 /* Doesn't free the value of the element, but does 114 114 * return it so the caller can free it. */ 115 void *owl_dict_remove_element(owl_dict *d, c har *k) {115 void *owl_dict_remove_element(owl_dict *d, const char *k) { 116 116 int i; 117 117 int pos, found;
Note: See TracChangeset
for help on using the changeset viewer.