/* determine if a string is possibly in a mangled format, ignoring case In this algorithm, mangled names use only pure ascii characters (no multi-byte) so we can avoid doing a UCS2 conversion NOTE! This interface must be able to handle a path with unix directory separators. It should return true if any component is mangled */ static bool is_mangled(struct pvfs_mangle_context *ctx, const char *name) { const char *p; const char *s; M_DEBUG(10,("is_mangled %s ?\n", name)); for (s=name; (p=strchr(s, '/')); s=p+1) { if (is_mangled_component(ctx, s, PTR_DIFF(p, s))) { return true; } } /* and the last part ... */ return is_mangled_component(ctx, s, strlen(s)); }
/* determine if a string is possibly in a mangled format, ignoring case In this algorithm, mangled names use only pure ascii characters (no multi-byte) so we can avoid doing a UCS2 conversion NOTE! This interface must be able to handle a path with unix directory separators. It should return true if any component is mangled */ static BOOL is_mangled(const char *name) { const char *p; const char *s; M_DEBUG(10,("is_mangled %s ?\n", name)); for (s=name; (p=strchr(s, '/')); s=p+1) { if (is_mangled_component(s, PTR_DIFF(p, s))) { return True; } } /* and the last part ... */ return is_mangled_component(s,strlen(s)); }
/* see if a component of a filename could be a mangled name from our mangling code */ bool pvfs_is_mangled_component(struct pvfs_state *pvfs, const char *name) { return is_mangled_component(pvfs->mangle_ctx, name, strlen(name)); }