Пример #1
0
/* 
   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));
}
Пример #2
0
/* 
   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));
}
Пример #3
0
/*
  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));
}