| /netbsd-src/external/ibm-public/postfix/dist/src/util/ |
| H A D | dict_alloc.c | 89 static const char *dict_default_lookup(DICT *dict, const char *unused_key) in dict_default_lookup() argument 92 dict->type, dict->name); in dict_default_lookup() 97 static int dict_default_update(DICT *dict, const char *unused_key, in dict_default_update() argument 101 dict->type, dict->name); in dict_default_update() 106 static int dict_default_delete(DICT *dict, const char *unused_key) in dict_default_delete() argument 109 dict->type, dict->name); in dict_default_delete() 114 static int dict_default_sequence(DICT *dict, int unused_function, in dict_default_sequence() argument 118 dict->type, dict->name); in dict_default_sequence() 123 static int dict_default_lock(DICT *dict, int operation) in dict_default_lock() argument 125 if (dict->lock_fd >= 0) { in dict_default_lock() [all …]
|
| H A D | dict_lmdb.c | 92 DICT dict; /* generic members */ member 135 static const char *dict_lmdb_lookup(DICT *dict, const char *name) in dict_lmdb_lookup() argument 137 DICT_LMDB *dict_lmdb = (DICT_LMDB *) dict; in dict_lmdb_lookup() 144 dict->error = 0; in dict_lmdb_lookup() 150 if ((dict->flags & (DICT_FLAG_TRY1NULL | DICT_FLAG_TRY0NULL)) == 0) in dict_lmdb_lookup() 156 if (dict->flags & DICT_FLAG_FOLD_FIX) { in dict_lmdb_lookup() 157 if (dict->fold_buf == 0) in dict_lmdb_lookup() 158 dict->fold_buf = vstring_alloc(10); in dict_lmdb_lookup() 159 vstring_strcpy(dict->fold_buf, name); in dict_lmdb_lookup() 160 name = lowercase(vstring_str(dict->fold_buf)); in dict_lmdb_lookup() [all …]
|
| H A D | dict_dbm.c | 70 DICT dict; /* generic members */ member 81 static const char *dict_dbm_lookup(DICT *dict, const char *name) in dict_dbm_lookup() argument 83 DICT_DBM *dict_dbm = (DICT_DBM *) dict; in dict_dbm_lookup() 88 dict->error = 0; in dict_dbm_lookup() 93 if ((dict->flags & (DICT_FLAG_TRY1NULL | DICT_FLAG_TRY0NULL)) == 0) in dict_dbm_lookup() 99 if (dict->flags & DICT_FLAG_FOLD_FIX) { in dict_dbm_lookup() 100 if (dict->fold_buf == 0) in dict_dbm_lookup() 101 dict->fold_buf = vstring_alloc(10); in dict_dbm_lookup() 102 vstring_strcpy(dict->fold_buf, name); in dict_dbm_lookup() 103 name = lowercase(vstring_str(dict->fold_buf)); in dict_dbm_lookup() [all …]
|
| H A D | dict_utf8.c | 97 static char *dict_utf8_check_fold(DICT *dict, const char *string, in dict_utf8_check_fold() argument 100 int fold_flag = (dict->flags & DICT_FLAG_FOLD_ANY); in dict_utf8_check_fold() 115 && (fold_flag & ((dict->flags & DICT_FLAG_FIXED) ? in dict_utf8_check_fold() 117 if (dict->fold_buf == 0) in dict_utf8_check_fold() 118 dict->fold_buf = vstring_alloc(10); in dict_utf8_check_fold() 119 return (casefold(dict->fold_buf, string)); in dict_utf8_check_fold() 138 static const char *dict_utf8_lookup(DICT *dict, const char *key) in dict_utf8_lookup() argument 149 if ((fold_res = dict_utf8_check_fold(dict, key, &utf8_err)) == 0) { in dict_utf8_lookup() 151 dict->type, dict->name, key, utf8_err); in dict_utf8_lookup() 152 dict->error = DICT_ERR_NONE; in dict_utf8_lookup() [all …]
|
| H A D | dict_sdbm.c | 64 DICT dict; /* generic members */ member 75 static const char *dict_sdbm_lookup(DICT *dict, const char *name) in dict_sdbm_lookup() argument 77 DICT_SDBM *dict_sdbm = (DICT_SDBM *) dict; in dict_sdbm_lookup() 82 dict->error = 0; in dict_sdbm_lookup() 87 if ((dict->flags & (DICT_FLAG_TRY1NULL | DICT_FLAG_TRY0NULL)) == 0) in dict_sdbm_lookup() 93 if (dict->flags & DICT_FLAG_FOLD_FIX) { in dict_sdbm_lookup() 94 if (dict->fold_buf == 0) in dict_sdbm_lookup() 95 dict->fold_buf = vstring_alloc(10); in dict_sdbm_lookup() 96 vstring_strcpy(dict->fold_buf, name); in dict_sdbm_lookup() 97 name = lowercase(vstring_str(dict->fold_buf)); in dict_sdbm_lookup() [all …]
|
| H A D | dict_file.c | 102 VSTRING *dict_file_to_buf(DICT *dict, const char *pathnames) in dict_file_to_buf() argument 110 if (dict->file_buf == 0) in dict_file_to_buf() 111 dict->file_buf = vstring_alloc(100); in dict_file_to_buf() 121 vstring_sprintf(dict->file_buf, "empty pathname list: >>%s<<'", in dict_file_to_buf() 125 VSTRING_RESET(dict->file_buf); in dict_file_to_buf() 129 vstring_sprintf(dict->file_buf, "open %s: %m", *cpp); in dict_file_to_buf() 132 if (st.st_size > SSIZE_T_MAX - LEN(dict->file_buf)) { in dict_file_to_buf() 133 vstring_sprintf(dict->file_buf, "file too large: %s", pathnames); in dict_file_to_buf() 136 if (vstream_fread_app(fp, dict->file_buf, st.st_size) != st.st_size) { in dict_file_to_buf() 137 vstring_sprintf(dict->file_buf, "read %s: %m", *cpp); in dict_file_to_buf() [all …]
|
| H A D | dict_ht.c | 49 DICT dict; /* generic members */ member 55 static int dict_ht_delete(DICT *dict, const char *name) in dict_ht_delete() argument 57 DICT_HT *dict_ht = (DICT_HT *) dict; in dict_ht_delete() 62 if (dict->flags & DICT_FLAG_FOLD_FIX) { in dict_ht_delete() 63 if (dict->fold_buf == 0) in dict_ht_delete() 64 dict->fold_buf = vstring_alloc(10); in dict_ht_delete() 65 vstring_strcpy(dict->fold_buf, name); in dict_ht_delete() 66 name = lowercase(vstring_str(dict->fold_buf)); in dict_ht_delete() 69 DICT_ERR_VAL_RETURN(dict, DICT_ERR_NONE, DICT_STAT_FAIL); in dict_ht_delete() 72 DICT_ERR_VAL_RETURN(dict, DICT_ERR_NONE, DICT_STAT_SUCCESS); in dict_ht_delete() [all …]
|
| H A D | dict.c | 287 DICT *dict; member 291 #define dict_node(dict) \ argument 292 (dict_table ? (DICT_NODE *) htable_find(dict_table, dict) : 0) 296 #define DICT_FIND_FOR_LOOKUP(dict, dict_name) do { \ argument 299 dict = node->dict; \ 301 dict = 0; \ 306 #define DICT_FIND_FOR_UPDATE(dict, dict_name) do { \ argument 309 dict = dict_ht_open(dict_name, O_CREAT | O_RDWR, 0); \ 310 dict_register(dict_name, dict); \ 312 dict = node->dict; \ [all …]
|
| H A D | dict_debug.c | 52 DICT dict; /* the proxy service */ member 58 static const char *dict_debug_lookup(DICT *dict, const char *key) in dict_debug_lookup() argument 60 DICT_DEBUG *dict_debug = (DICT_DEBUG *) dict; in dict_debug_lookup() 64 real_dict->flags = dict->flags; in dict_debug_lookup() 66 dict->flags = real_dict->flags; in dict_debug_lookup() 67 msg_info("%s:%s lookup: \"%s\" = \"%s\"", dict->type, dict->name, key, in dict_debug_lookup() 69 DICT_ERR_VAL_RETURN(dict, real_dict->error, result); in dict_debug_lookup() 74 static int dict_debug_update(DICT *dict, const char *key, const char *value) in dict_debug_update() argument 76 DICT_DEBUG *dict_debug = (DICT_DEBUG *) dict; in dict_debug_update() 80 real_dict->flags = dict->flags; in dict_debug_update() [all …]
|
| H A D | dict_db.c | 130 DICT dict; /* generic members */ member 181 static const char *dict_db_lookup(DICT *dict, const char *name) in dict_db_lookup() argument 183 DICT_DB *dict_db = (DICT_DB *) dict; in dict_db_lookup() 190 dict->error = 0; in dict_db_lookup() 195 if ((dict->flags & (DICT_FLAG_TRY1NULL | DICT_FLAG_TRY0NULL)) == 0) in dict_db_lookup() 204 if (dict->flags & DICT_FLAG_FOLD_FIX) { in dict_db_lookup() 205 if (dict->fold_buf == 0) in dict_db_lookup() 206 dict->fold_buf = vstring_alloc(10); in dict_db_lookup() 207 vstring_strcpy(dict->fold_buf, name); in dict_db_lookup() 208 name = lowercase(vstring_str(dict->fold_buf)); in dict_db_lookup() [all …]
|
| H A D | dict_cdb.c | 87 DICT dict; /* generic members */ member 92 DICT dict; /* generic members */ member 100 static const char *dict_cdbq_lookup(DICT *dict, const char *name) in dict_cdbq_lookup() argument 102 DICT_CDBQ *dict_cdbq = (DICT_CDBQ *) dict; in dict_cdbq_lookup() 109 dict->error = 0; in dict_cdbq_lookup() 116 if (dict->flags & DICT_FLAG_FOLD_FIX) { in dict_cdbq_lookup() 117 if (dict->fold_buf == 0) in dict_cdbq_lookup() 118 dict->fold_buf = vstring_alloc(10); in dict_cdbq_lookup() 119 vstring_strcpy(dict->fold_buf, name); in dict_cdbq_lookup() 120 name = lowercase(vstring_str(dict->fold_buf)); in dict_cdbq_lookup() [all …]
|
| H A D | dict_env.c | 53 static int dict_env_update(DICT *dict, const char *name, const char *value) in dict_env_update() argument 55 dict->error = 0; in dict_env_update() 60 if (dict->flags & DICT_FLAG_FOLD_FIX) { in dict_env_update() 61 if (dict->fold_buf == 0) in dict_env_update() 62 dict->fold_buf = vstring_alloc(10); in dict_env_update() 63 vstring_strcpy(dict->fold_buf, name); in dict_env_update() 64 name = lowercase(vstring_str(dict->fold_buf)); in dict_env_update() 74 static const char *dict_env_lookup(DICT *dict, const char *name) in dict_env_lookup() argument 76 dict->error = 0; in dict_env_lookup() 81 if (dict->flags & DICT_FLAG_FOLD_FIX) { in dict_env_lookup() [all …]
|
| H A D | dict_surrogate.c | 72 DICT dict; /* generic members */ member 78 static int dict_surrogate_sequence(DICT *dict, int unused_func, in dict_surrogate_sequence() argument 81 DICT_SURROGATE *dp = (DICT_SURROGATE *) dict; in dict_surrogate_sequence() 84 dict->type, dict->name, dp->reason); in dict_surrogate_sequence() 85 DICT_ERR_VAL_RETURN(dict, DICT_ERR_RETRY, DICT_STAT_ERROR); in dict_surrogate_sequence() 90 static int dict_surrogate_update(DICT *dict, const char *unused_name, in dict_surrogate_update() argument 93 DICT_SURROGATE *dp = (DICT_SURROGATE *) dict; in dict_surrogate_update() 96 dict->type, dict->name, dp->reason); in dict_surrogate_update() 97 DICT_ERR_VAL_RETURN(dict, DICT_ERR_RETRY, DICT_STAT_ERROR); in dict_surrogate_update() 102 static const char *dict_surrogate_lookup(DICT *dict, const char *unused_name) in dict_surrogate_lookup() argument [all …]
|
| H A D | dict_nis.c | 68 DICT dict; /* generic members */ member 141 static const char *dict_nis_lookup(DICT *dict, const char *key) in dict_nis_lookup() argument 143 DICT_NIS *dict_nis = (DICT_NIS *) dict; in dict_nis_lookup() 149 dict->error = 0; in dict_nis_lookup() 154 if ((dict->flags & (DICT_FLAG_TRY1NULL | DICT_FLAG_TRY0NULL)) == 0) in dict_nis_lookup() 163 if (dict->flags & DICT_FLAG_FOLD_FIX) { in dict_nis_lookup() 164 if (dict->fold_buf == 0) in dict_nis_lookup() 165 dict->fold_buf = vstring_alloc(10); in dict_nis_lookup() 166 vstring_strcpy(dict->fold_buf, key); in dict_nis_lookup() 167 key = lowercase(vstring_str(dict->fold_buf)); in dict_nis_lookup() [all …]
|
| H A D | dict_fail.c | 46 DICT dict; /* generic members */ member 52 static int dict_fail_sequence(DICT *dict, int unused_func, in dict_fail_sequence() argument 55 DICT_FAIL *dp = (DICT_FAIL *) dict; in dict_fail_sequence() 58 DICT_ERR_VAL_RETURN(dict, dp->dict_errno, DICT_STAT_ERROR); in dict_fail_sequence() 63 static int dict_fail_update(DICT *dict, const char *unused_name, in dict_fail_update() argument 66 DICT_FAIL *dp = (DICT_FAIL *) dict; in dict_fail_update() 69 DICT_ERR_VAL_RETURN(dict, dp->dict_errno, DICT_STAT_ERROR); in dict_fail_update() 74 static const char *dict_fail_lookup(DICT *dict, const char *unused_name) in dict_fail_lookup() argument 76 DICT_FAIL *dp = (DICT_FAIL *) dict; in dict_fail_lookup() 79 DICT_ERR_VAL_RETURN(dict, dp->dict_errno, (char *) 0); in dict_fail_lookup() [all …]
|
| H A D | dict_unix.c | 63 DICT dict; /* generic members */ member 68 static const char *dict_unix_getpwnam(DICT *dict, const char *key) in dict_unix_getpwnam() argument 74 dict->error = 0; in dict_unix_getpwnam() 79 if (dict->flags & DICT_FLAG_FOLD_FIX) { in dict_unix_getpwnam() 80 if (dict->fold_buf == 0) in dict_unix_getpwnam() 81 dict->fold_buf = vstring_alloc(10); in dict_unix_getpwnam() 82 vstring_strcpy(dict->fold_buf, key); in dict_unix_getpwnam() 83 key = lowercase(vstring_str(dict->fold_buf)); in dict_unix_getpwnam() 91 dict->error = DICT_ERR_RETRY; in dict_unix_getpwnam() 109 static const char *dict_unix_getgrnam(DICT *dict, const char *key) in dict_unix_getgrnam() argument [all …]
|
| H A D | dict_sockmap.c | 106 DICT dict; /* parent class */ member 163 static const char *dict_sockmap_lookup(DICT *dict, const char *key) in dict_sockmap_lookup() argument 166 DICT_SOCKMAP *dp = (DICT_SOCKMAP *) dict; in dict_sockmap_lookup() 180 if (dict->flags & DICT_FLAG_FOLD_MUL) { in dict_sockmap_lookup() 181 if (dict->fold_buf == 0) in dict_sockmap_lookup() 182 dict->fold_buf = vstring_alloc(100); in dict_sockmap_lookup() 183 vstring_strcpy(dict->fold_buf, key); in dict_sockmap_lookup() 184 key = lowercase(STR(dict->fold_buf)); in dict_sockmap_lookup() 197 msg_warn("table %s:%s lookup error: %m", dict->type, dict->name); in dict_sockmap_lookup() 198 dict->error = DICT_ERR_RETRY; in dict_sockmap_lookup() [all …]
|
| H A D | dict_nisplus.c | 67 DICT dict; /* generic members */ member 118 static const char *dict_nisplus_lookup(DICT *dict, const char *key) in dict_nisplus_lookup() argument 121 DICT_NISPLUS *dict_nisplus = (DICT_NISPLUS *) dict; in dict_nisplus_lookup() 131 dict->error = 0; in dict_nisplus_lookup() 145 if (dict->flags & DICT_FLAG_FOLD_FIX) { in dict_nisplus_lookup() 146 if (dict->fold_buf == 0) in dict_nisplus_lookup() 147 dict->fold_buf = vstring_alloc(10); in dict_nisplus_lookup() 148 vstring_strcpy(dict->fold_buf, key); in dict_nisplus_lookup() 149 key = lowercase(vstring_str(dict->fold_buf)); in dict_nisplus_lookup() 165 dict->type, dict->name, ch); in dict_nisplus_lookup() [all …]
|
| /netbsd-src/crypto/external/bsd/libsaslc/dist/test/ |
| H A D | t_dict.c | 57 saslc__dict_t *dict; in ATF_TC_BODY() local 58 ATF_REQUIRE(dict = saslc__dict_create()); in ATF_TC_BODY() 59 saslc__dict_destroy(dict); in ATF_TC_BODY() 72 saslc__dict_t *dict; in ATF_TC_BODY() local 73 ATF_REQUIRE(dict = saslc__dict_create()); in ATF_TC_BODY() 74 ATF_CHECK_EQ(saslc__dict_insert(dict, "foo", "bar"), DICT_OK); in ATF_TC_BODY() 75 ATF_CHECK_EQ(saslc__dict_insert(dict, "bar", "blah"), DICT_OK); in ATF_TC_BODY() 76 ATF_CHECK_EQ(saslc__dict_insert(dict, " ", "bar"), DICT_KEYINVALID); in ATF_TC_BODY() 77 ATF_CHECK_EQ(saslc__dict_insert(dict, NULL, NULL), DICT_KEYINVALID); in ATF_TC_BODY() 78 ATF_CHECK_EQ(saslc__dict_insert(dict, "a", NULL), DICT_VALBAD); in ATF_TC_BODY() [all …]
|
| /netbsd-src/external/public-domain/xz/dist/src/liblzma/lz/ |
| H A D | lz_decoder.h | 60 lzma_dict *restrict dict, const uint8_t *restrict in, 103 dict_get(const lzma_dict *const dict, const uint32_t distance) in dict_get() argument 105 return dict->buf[dict->pos - distance - 1 in dict_get() 106 + (distance < dict->pos ? 0 : dict->size)]; in dict_get() 112 dict_is_empty(const lzma_dict *const dict) in dict_is_empty() argument 114 return dict->full == 0; in dict_is_empty() 120 dict_is_distance_valid(const lzma_dict *const dict, const size_t distance) in dict_is_distance_valid() argument 122 return dict->full > distance; in dict_is_distance_valid() 128 dict_repeat(lzma_dict *dict, uint32_t distance, uint32_t *len) in dict_repeat() argument 131 const size_t dict_avail = dict->limit - dict->pos; in dict_repeat() [all …]
|
| /netbsd-src/crypto/external/bsd/heimdal/dist/lib/base/ |
| H A D | dict.c | 55 heim_dict_t dict = ptr; in dict_dealloc() local 58 for (h = dict->tab; h < &dict->tab[dict->size]; ++h) { in dict_dealloc() 66 free(dict->tab); in dict_dealloc() 117 heim_dict_t dict; in heim_dict_create() local 119 dict = _heim_alloc_object(&dict_object, sizeof(*dict)); in heim_dict_create() 121 dict->size = findprime(size); in heim_dict_create() 122 if (dict->size == 0) { in heim_dict_create() 123 heim_release(dict); in heim_dict_create() 127 dict->tab = calloc(dict->size, sizeof(dict->tab[0])); in heim_dict_create() 128 if (dict->tab == NULL) { in heim_dict_create() [all …]
|
| /netbsd-src/external/ibm-public/postfix/dist/src/global/ |
| H A D | dict_proxy.c | 79 DICT dict; /* generic members */ member 110 static int dict_proxy_sequence(DICT *dict, int function, in dict_proxy_sequence() argument 114 DICT_PROXY *dict_proxy = (DICT_PROXY *) dict; in dict_proxy_sequence() 132 | (dict->flags & DICT_FLAG_RQST_MASK); in dict_proxy_sequence() 140 SEND_ATTR_STR(MAIL_ATTR_TABLE, dict->name), in dict_proxy_sequence() 155 myname, dict->name, dict_flags_str(request_flags), in dict_proxy_sequence() 162 dict_proxy->service, dict->name, function); in dict_proxy_sequence() 165 dict_proxy->service, dict->name); in dict_proxy_sequence() 169 DICT_ERR_VAL_RETURN(dict, DICT_ERR_NONE, DICT_STAT_SUCCESS); in dict_proxy_sequence() 172 DICT_ERR_VAL_RETURN(dict, DICT_ERR_NONE, DICT_STAT_FAIL); in dict_proxy_sequence() [all …]
|
| H A D | dict_memcache.c | 77 DICT dict; /* parent class */ member 145 "-- not stored", DICT_TYPE_MEMCACHE, dict_mc->dict.name, in dict_memcache_set() 165 DICT_TYPE_MEMCACHE, dict_mc->dict.name); in dict_memcache_set() 169 DICT_TYPE_MEMCACHE, dict_mc->dict.name, in dict_memcache_set() 198 DICT_TYPE_MEMCACHE, dict_mc->dict.name); in dict_memcache_get() 207 dict_mc->dict.name, STR(dict_mc->clnt_buf)); in dict_memcache_get() 211 dict_mc->dict.name); in dict_memcache_get() 241 DICT_TYPE_MEMCACHE, dict_mc->dict.name); in dict_memcache_del() 251 DICT_TYPE_MEMCACHE, dict_mc->dict.name, in dict_memcache_del() 267 if (dict_mc->dict.flags & DICT_FLAG_FOLD_FIX) { in dict_memcache_prepare_key() [all …]
|
| /netbsd-src/common/lib/libprop/ |
| H A D | prop_dictionary_util.c | 45 prop_dictionary_get_dict(prop_dictionary_t dict, const char *key, in prop_dictionary_get_dict() argument 50 o = prop_dictionary_get(dict, key); in prop_dictionary_get_dict() 59 prop_dictionary_get_bool(prop_dictionary_t dict, const char *key, bool *valp) in prop_dictionary_get_bool() argument 63 b = prop_dictionary_get(dict, key); in prop_dictionary_get_bool() 73 prop_dictionary_set_bool(prop_dictionary_t dict, const char *key, bool val) in prop_dictionary_set_bool() argument 76 return prop_dictionary_set_and_rel(dict, key, prop_bool_create(val)); in prop_dictionary_set_bool() 81 prop_dictionary_get_ ## name (prop_dictionary_t dict, \ 86 prop_dictionary_get(dict, key), valp); \ 113 prop_dictionary_set_signed_number(prop_dictionary_t dict, const char *key, in TEMPLATE() 116 return prop_dictionary_set_and_rel(dict, key, in TEMPLATE() [all …]
|
| /netbsd-src/sys/dev/sysmon/ |
| H A D | sysmon_envsys_util.c | 46 sme_sensor_upbool(prop_dictionary_t dict, const char *key, bool val) in sme_sensor_upbool() argument 50 KASSERT(dict != NULL); in sme_sensor_upbool() 52 obj = prop_dictionary_get(dict, key); in sme_sensor_upbool() 55 if (!prop_dictionary_set_bool(dict, key, val)) { in sme_sensor_upbool() 62 if (!prop_dictionary_set_bool(dict, key, val)) { in sme_sensor_upbool() 73 sme_sensor_upint32(prop_dictionary_t dict, const char *key, int32_t val) in sme_sensor_upint32() argument 77 KASSERT(dict != NULL); in sme_sensor_upint32() 79 obj = prop_dictionary_get(dict, key); in sme_sensor_upint32() 82 if (!prop_dictionary_set_int32(dict, key, val)) { in sme_sensor_upint32() 89 if (!prop_dictionary_set_int32(dict, key, val)) { in sme_sensor_upint32() [all …]
|