static struct mangle_fns *mangle_fns;
/* this allows us to add more mangling backends */
-static struct {
- char *name;
+static const struct {
+ const char *name;
struct mangle_fns *(*init_fn)(void);
} mangle_backends[] = {
{ "hash", mangle_hash_init },
{ "hash2", mangle_hash2_init },
+ /*{ "tdb", mangle_tdb_init }, */
{ NULL, NULL }
};
int i;
char *method;
- if (mangle_fns) return;
+ if (mangle_fns)
+ return;
method = lp_mangling_method();
- /* find the first mangling method that manages to initialise and
+ /* find the first mangling method that manages to initialise and
matches the "mangling method" parameter */
for (i=0; mangle_backends[i].name && !mangle_fns; i++) {
if (!method || !*method || strcmp(method, mangle_backends[i].name) == 0) {
{
mangle_init();
- return mangle_fns->reset();
+ mangle_fns->reset();
}
/*
*/
BOOL mangle_is_8_3(const char *fname, BOOL check_case)
{
- return mangle_fns->is_8_3(fname, check_case);
+ return mangle_fns->is_8_3(fname, check_case, False);
+}
+
+BOOL mangle_is_8_3_wildcards(const char *fname, BOOL check_case)
+{
+ return mangle_fns->is_8_3(fname, check_case, True);
}
/*
looking for a matching name if it doesn't. It should succeed most of the time
or there will be a huge performance penalty
*/
-BOOL mangle_check_cache(char *s)
+BOOL mangle_check_cache(char *s, size_t maxlen)
{
- return mangle_fns->check_cache(s);
+ return mangle_fns->check_cache(s, maxlen);
}
/*
map a long filename to a 8.3 name.
*/
-BOOL mangle_map(char *OutName, BOOL need83, BOOL cache83, int snum)
+
+void mangle_map(pstring OutName, BOOL need83, BOOL cache83, int snum)
{
/* name mangling can be disabled for speed, in which case
we just truncate the string */
if (need83) {
string_truncate(OutName, 12);
}
- return True;
+ return;
}
/* invoke the inane "mangled map" code */
mangle_map_filename(OutName, snum);
-
- return mangle_fns->name_map(OutName, need83, cache83);
+ mangle_fns->name_map(OutName, need83, cache83, lp_defaultcase(snum));
}