1 /* This file contains path component name utility functions.
3 * The entry points into this file are:
4 * normalize_name normalize a path component name for hashing purposes
5 * compare_name check whether two path component names are equivalent
8 * April 2009 (D.C. van Moolenbroek)
15 /*===========================================================================*
17 *===========================================================================*/
18 void normalize_name(dst
, src
)
22 /* Normalize the given path component name, storing the result in the given
27 size
= strlen(src
) + 1;
29 assert(size
<= NAME_MAX
+1);
31 if (sffs_params
->p_case_insens
) {
32 for (i
= 0; i
< size
; i
++)
33 *dst
++ = tolower(*src
++);
35 else memcpy(dst
, src
, size
);
38 /*===========================================================================*
40 *===========================================================================*/
41 int compare_name(name1
, name2
)
45 /* Return TRUE if the given path component names are equivalent, FALSE
50 if (sffs_params
->p_case_insens
)
51 r
= strcasecmp(name1
, name2
);
53 r
= strcmp(name1
, name2
);
55 return r
? FALSE
: TRUE
;