Lines Matching defs:lib
157 char *lib = NULL;
178 &lib);
184 result = strdup(lib);
191 if (lib) {
193 profile_release_string(lib);
199 kdb_setup_opt_functions(db_library lib)
201 if (lib->vftabl.set_master_key == NULL) {
202 lib->vftabl.set_master_key = kdb_def_set_mkey;
205 if (lib->vftabl.get_master_key == NULL) {
206 lib->vftabl.get_master_key = kdb_def_get_mkey;
209 if (lib->vftabl.fetch_master_key == NULL) {
210 lib->vftabl.fetch_master_key = krb5_db_def_fetch_mkey;
213 if (lib->vftabl.verify_master_key == NULL) {
214 lib->vftabl.verify_master_key = krb5_def_verify_master_key;
217 if (lib->vftabl.dbe_search_enctype == NULL) {
218 lib->vftabl.dbe_search_enctype = krb5_dbe_def_search_enctype;
221 if (lib->vftabl.db_change_pwd == NULL) {
222 lib->vftabl.db_change_pwd = krb5_dbe_def_cpw;
225 if (lib->vftabl.store_master_key == NULL) {
226 lib->vftabl.store_master_key = krb5_def_store_mkey;
229 if (lib->vftabl.promote_db == NULL) {
230 lib->vftabl.promote_db = krb5_def_promote_db;
239 kdb_load_library(krb5_context kcontext, char *lib_name, db_library * lib)
250 *lib = calloc((size_t) 1, sizeof(**lib));
251 if (*lib == NULL) {
256 status = kdb_init_lib_lock(*lib);
261 strcpy((*lib)->name, lib_name);
287 memcpy(&(*lib)->vftabl, vftabl_addr, sizeof(kdb_vftabl));
289 kdb_setup_opt_functions(*lib);
291 if ((status = (*lib)->vftabl.init_library())) {
302 free(*lib), *lib = NULL;
313 kdb_load_library(krb5_context kcontext, char *lib_name, db_library * lib)
338 *lib = calloc((size_t) 1, sizeof(**lib));
339 if (*lib == NULL) {
344 status = kdb_init_lib_lock(*lib);
349 strcpy((*lib)->name, lib_name);
373 &(*lib)->dl_dir_handle, &kcontext->err))) {
382 if ((status = krb5int_get_plugin_dir_data (&(*lib)->dl_dir_handle, "kdb_function_table",
401 memcpy(&(*lib)->vftabl, vftabl_addrs[0], sizeof(kdb_vftabl));
402 kdb_setup_opt_functions(*lib);
404 if ((status = (*lib)->vftabl.init_library())) {
415 if (*lib) {
416 kdb_destroy_lib_lock(*lib);
417 if (PLUGIN_DIR_OPEN((&(*lib)->dl_dir_handle))) {
418 krb5int_close_plugin_dirs (&(*lib)->dl_dir_handle);
420 free(*lib);
421 *lib = NULL;
430 kdb_find_library(krb5_context kcontext, char *lib_name, db_library * lib)
445 *lib = curr_elt;
453 status = kdb_load_library(kcontext, lib_name, lib);
460 prev_elt->next = *lib;
461 (*lib)->prev = prev_elt;
463 lib_list = *lib;
467 if (*lib) {
468 (*lib)->reference_cnt++;
479 kdb_free_library(db_library lib)
489 lib->reference_cnt--;
491 if (lib->reference_cnt == 0) {
492 status = lib->vftabl.fini_library();
498 if (PLUGIN_DIR_OPEN((&lib->dl_dir_handle))) {
499 krb5int_close_plugin_dirs (&lib->dl_dir_handle);
502 kdb_destroy_lib_lock(lib);
504 if (lib->prev == NULL) {
506 lib_list = lib->next;
508 lib->prev->next = lib->next;
511 if (lib->next) {
512 lib->next->prev = lib->prev;
514 free(lib);
530 db_library lib = NULL;
545 status = kdb_find_library(kcontext, library, &lib);
550 dal_handle->lib_handle = lib;
558 if (lib) {
559 (void)kdb_free_library(lib);