Lines Matching refs:key

22 /*	void	dict_put(dict, key, value)
24 /* const char *key;
27 /* const char *dict_get(dict, key)
29 /* const char *key;
31 /* int dict_del(dict, key)
33 /* const char *key;
35 /* void dict_seq(dict, func, key, value)
38 /* const char **key;
91 /* fold the search key to lower case before accessing the
96 /* and lower case, fold the search key to lower case before
147 /* under the given key. A null pointer means the value was not found.
152 /* dict_put() stores the specified key and value into the named
389 * program assumes that the input specifies a lookup key and prints the
421 const char *key;
470 vstream_printf("usage: del key|get key|put key=value|first|next\n");
476 key = *bufp ? vstring_str(unescape(keybuf, mystrtok(&bufp, " ="))) : 0;
478 if (strcmp(cmd, "del") == 0 && key && !value) {
479 if (dict_del(dict, key))
480 vstream_printf("%s: not found\n", key);
482 vstream_printf("%s: deleted\n", key);
483 } else if (strcmp(cmd, "get") == 0 && key && !value) {
484 if ((value = dict_get(dict, key)) == 0) {
485 vstream_printf("%s: %s\n", key,
489 vstream_printf("%s=%s\n", key, value);
491 } else if (strcmp(cmd, "put") == 0 && key && value) {
492 dict_put(dict, key, value);
493 vstream_printf("%s=%s\n", key, value);
494 } else if (strcmp(cmd, "first") == 0 && !key && !value) {
495 if (dict_seq(dict, DICT_SEQ_FUN_FIRST, &key, &value) == 0)
496 vstream_printf("%s=%s\n", key, value);
501 } else if (strcmp(cmd, "next") == 0 && !key && !value) {
502 if (dict_seq(dict, DICT_SEQ_FUN_NEXT, &key, &value) == 0)
503 vstream_printf("%s=%s\n", key, value);
509 vstream_printf("usage: del key|get key|put key=value|first|next\n");