Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • dict.c

    r2b37be2 r636b137  
    2424}
    2525
    26 int owl_dict_get_size(owl_dict *d) {
     26int owl_dict_get_size(const owl_dict *d) {
    2727  return(d->size);
    2828}
     
    3131 * this element would logically go, and stores the index in pos.
    3232 * Returns 1 if found, else 0. */
    33 int _owl_dict_find_pos(owl_dict *d, char *k, int *pos) {
     33int _owl_dict_find_pos(const owl_dict *d, const char *k, int *pos) {
    3434  int lo = 0, hi = d->size;
    3535  while (lo < hi) {
     
    5050
    5151/* returns the value corresponding to key k */
    52 void *owl_dict_find_element(owl_dict *d, char *k) {
     52void *owl_dict_find_element(const owl_dict *d, const char *k) {
    5353  int found, pos;
    5454  found = _owl_dict_find_pos(d, k, &pos);
     
    6161/* creates a list and fills it in with keys.  duplicates the keys,
    6262 * so they will need to be freed by the caller. */
    63 int owl_dict_get_keys(owl_dict *d, owl_list *l) {
     63int owl_dict_get_keys(const owl_dict *d, owl_list *l) {
    6464  int i;
    6565  char *dupk;
     
    8282   Will return -2 if replace=NULL and match was found.
    8383*/
    84 int owl_dict_insert_element(owl_dict *d, char *k, void *v, void (*free_on_replace)(void *old)) {
     84int owl_dict_insert_element(owl_dict *d, const char *k, void *v, void (*free_on_replace)(void *old)) {
    8585  int pos, found;
    8686  char *dupk;
     
    113113/* Doesn't free the value of the element, but does
    114114 * return it so the caller can free it. */
    115 void *owl_dict_remove_element(owl_dict *d, char *k) {
     115void *owl_dict_remove_element(owl_dict *d, const char *k) {
    116116  int i;
    117117  int pos, found;
Note: See TracChangeset for help on using the changeset viewer.