Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • obarray.c

    r4d86e06 rb1d5517  
    1414 * the index it should be inserted at.
    1515 */
    16 int owl_obarray_lookup(owl_obarray *oa, char * key, char ** val) /*noproto*/
     16int owl_obarray_lookup(const owl_obarray *oa, const char * key, const char ** val) /*noproto*/
    1717{
    1818  int first, last, mid;
    19   char * str;
     19  const char * str;
    2020  int cmp;
    2121
     
    4141
    4242/* Returns NULL if the string doesn't exist in the obarray */
    43 char * owl_obarray_find(owl_obarray *oa, char * string)
     43const char * owl_obarray_find(const owl_obarray *oa, const char * string)
    4444{
    45   char *v;
     45  const char *v;
    4646  owl_obarray_lookup(oa, string, &v);
    4747  return v;
     
    4949
    5050/* Inserts the string into the obarray if it doesn't exist */
    51 char * owl_obarray_insert(owl_obarray *oa, char * string)
     51const char * owl_obarray_insert(owl_obarray *oa, const char * string)
    5252{
    53   char *v;
     53  const char *v;
    5454  int i;
    5555  i = owl_obarray_lookup(oa, string, &v);
    5656  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;
    5960  }
    6061  return v;
     
    7677int owl_obarray_regtest(void) {
    7778  int numfailed = 0;
    78   char *p,*p2;
     79  const char *p,*p2;
    7980
    8081  owl_obarray oa;
Note: See TracChangeset for help on using the changeset viewer.