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(char dst
[NAME_MAX
+1], char *src
)
20 /* Normalize the given path component name, storing the result in the given
25 size
= strlen(src
) + 1;
27 assert(size
<= NAME_MAX
+1);
29 if (sffs_params
->p_case_insens
) {
30 for (i
= 0; i
< size
; i
++)
31 *dst
++ = tolower((int)*src
++);
33 else memcpy(dst
, src
, size
);
36 /*===========================================================================*
38 *===========================================================================*/
39 int compare_name(char *name1
, char *name2
)
41 /* Return TRUE if the given path component names are equivalent, FALSE
46 if (sffs_params
->p_case_insens
)
47 r
= strcasecmp(name1
, name2
);
49 r
= strcmp(name1
, name2
);
51 return r
? FALSE
: TRUE
;