|
|
| version 1.1.1.1, 2012/02/21 16:57:34 | version 1.1.1.2, 2016/10/18 14:04:50 |
|---|---|
| Line 53 void stringmap_delete_free(stringmap S) { | Line 53 void stringmap_delete_free(stringmap S) { |
| } | } |
| /* stringmap_insert: | /* stringmap_insert: |
| * Insert into S an item having key k and value d. Returns an existing key | * Insert into S an item having key k and value d. Returns a pointer to |
| * or NULL if it was inserted. | * the existing item value, or NULL if a new item was created. |
| */ | */ |
| item *stringmap_insert(stringmap S, const char *k, const item d) { | item *stringmap_insert(stringmap S, const char *k, const item d) { |
| if (!S) return 0; | if (!S) return NULL; |
| if (S->key == NULL) { | if (S->key == NULL) { |
| S->key = xstrdup(k); | S->key = xstrdup(k); |
| S->d = d; | S->d = d; |