/* return the methods for this mangling implementation */ const struct mangle_fns *mangle_hash_init(void) { mangle_reset(); /* Create the in-memory tdb using our custom hash function. */ tdb_mangled_cache = tdb_open_ex("mangled_cache", 1031, TDB_INTERNAL, (O_RDWR|O_CREAT), 0644, NULL, fast_string_hash); return &mangle_hash_fns; }
/* return the methods for this mangling implementation */ const struct mangle_fns *mangle_hash_init(void) { mangle_reset(); /* Create the in-memory tdb using our custom hash function. */ #ifndef BUILD_TDB2 tdb_mangled_cache = tdb_open_ex("mangled_cache", 1031, TDB_INTERNAL, (O_RDWR|O_CREAT), 0644, NULL, fast_string_hash); #else /* FIXME: We should *never* open a tdb without logging! */ tdb_mangled_cache = tdb_open("mangled_cache", TDB_INTERNAL, 0, 0, NULL); #endif return &mangle_hash_fns; }
/* return the methods for this mangling implementation */ const struct mangle_fns *mangle_hash2_init(void) { /* the mangle prefix can only be in the mange 1 to 6 */ mangle_prefix = lp_mangle_prefix(); if (mangle_prefix > 6) { mangle_prefix = 6; } if (mangle_prefix < 1) { mangle_prefix = 1; } #if DYNAMIC_MANGLE_TABLES init_tables(); #endif mangle_reset(); return &mangle_hash2_fns; }
/* return the methods for this mangling implementation */ struct mangle_fns *mangle_hash2_init(void) { /* the mangle prefix can only be in the mange 1 to 6 */ mangle_prefix = lp_mangle_prefix(); if (mangle_prefix > 6) { mangle_prefix = 6; } if (mangle_prefix < 1) { mangle_prefix = 1; } init_tables(); mangle_reset(); if (!cache_init()) { return NULL; } return &mangle_fns; }