Changes in obarray.c [4d86e06:b1d5517]
Legend:
- Unmodified
- Added
- Removed
-
obarray.c
r4d86e06 rb1d5517 14 14 * the index it should be inserted at. 15 15 */ 16 int owl_obarray_lookup( owl_obarray *oa, char * key,char ** val) /*noproto*/16 int owl_obarray_lookup(const owl_obarray *oa, const char * key, const char ** val) /*noproto*/ 17 17 { 18 18 int first, last, mid; 19 c har * str;19 const char * str; 20 20 int cmp; 21 21 … … 41 41 42 42 /* Returns NULL if the string doesn't exist in the obarray */ 43 c har * owl_obarray_find(owl_obarray *oa,char * string)43 const char * owl_obarray_find(const owl_obarray *oa, const char * string) 44 44 { 45 c har *v;45 const char *v; 46 46 owl_obarray_lookup(oa, string, &v); 47 47 return v; … … 49 49 50 50 /* Inserts the string into the obarray if it doesn't exist */ 51 c har * owl_obarray_insert(owl_obarray *oa,char * string)51 const char * owl_obarray_insert(owl_obarray *oa, const char * string) 52 52 { 53 c har *v;53 const char *v; 54 54 int i; 55 55 i = owl_obarray_lookup(oa, string, &v); 56 56 if(!v) { 57 v = owl_strdup(string); 58 owl_list_insert_element(&(oa->strings), i, v); 57 char *v2 = owl_strdup(string); 58 owl_list_insert_element(&(oa->strings), i, v2); 59 return v2; 59 60 } 60 61 return v; … … 76 77 int owl_obarray_regtest(void) { 77 78 int numfailed = 0; 78 c har *p,*p2;79 const char *p,*p2; 79 80 80 81 owl_obarray oa;
Note: See TracChangeset
for help on using the changeset viewer.