Lines Matching refs:di

53     struct hdb_dbinfo *di;  in get_dbinfo()  local
62 di = calloc(1, sizeof(*di)); in get_dbinfo()
63 if (di == NULL) { in get_dbinfo()
67 di->label = strdup(label); in get_dbinfo()
68 di->dbname = strdup(p); in get_dbinfo()
72 di->realm = strdup(p); in get_dbinfo()
75 di->mkey_file = strdup(p); in get_dbinfo()
78 di->acl_file = strdup(p); in get_dbinfo()
81 di->log_file = strdup(p); in get_dbinfo()
83 di->binding = db_binding; in get_dbinfo()
85 *db = di; in get_dbinfo()
94 struct hdb_dbinfo *di, **dt, *databases; in hdb_get_dbinfo() local
111 ret = get_dbinfo(context, db_binding, "default", &di); in hdb_get_dbinfo()
112 if (ret == 0 && di) { in hdb_get_dbinfo()
113 databases = di; in hdb_get_dbinfo()
114 dt = &di->next; in hdb_get_dbinfo()
123 db_binding->name, &di); in hdb_get_dbinfo()
127 if (di == NULL) in hdb_get_dbinfo()
131 *dt = di; in hdb_get_dbinfo()
133 databases = di; in hdb_get_dbinfo()
134 dt = &di->next; in hdb_get_dbinfo()
141 di = calloc(1, sizeof(*di)); in hdb_get_dbinfo()
142 databases = di; in hdb_get_dbinfo()
143 di->label = strdup("default"); in hdb_get_dbinfo()
146 for(di = databases; di; di = di->next) { in hdb_get_dbinfo()
147 if(di->dbname == NULL) { in hdb_get_dbinfo()
148 di->dbname = strdup(default_dbname); in hdb_get_dbinfo()
149 if (di->mkey_file == NULL) in hdb_get_dbinfo()
150 di->mkey_file = strdup(default_mkey); in hdb_get_dbinfo()
152 if(di->mkey_file == NULL) { in hdb_get_dbinfo()
153 p = strrchr(di->dbname, '.'); in hdb_get_dbinfo()
156 asprintf(&di->mkey_file, "%s.mkey", di->dbname); in hdb_get_dbinfo()
160 asprintf(&di->mkey_file, "%.*s.mkey", in hdb_get_dbinfo()
161 (int)(p - di->dbname), di->dbname); in hdb_get_dbinfo()
163 if(di->acl_file == NULL) in hdb_get_dbinfo()
164 di->acl_file = strdup(default_acl); in hdb_get_dbinfo()
225 struct hdb_dbinfo *di, *ndi; in hdb_free_dbinfo() local
227 for(di = *dbp; di != NULL; di = ndi) { in hdb_free_dbinfo()
228 ndi = di->next; in hdb_free_dbinfo()
229 free (di->label); in hdb_free_dbinfo()
230 free (di->realm); in hdb_free_dbinfo()
231 free (di->dbname); in hdb_free_dbinfo()
232 free (di->mkey_file); in hdb_free_dbinfo()
233 free (di->acl_file); in hdb_free_dbinfo()
234 free (di->log_file); in hdb_free_dbinfo()
235 free(di); in hdb_free_dbinfo()