2008-05-22 Jason Rumney <jasonr@gnu.org>
+ * dispextern.h, xfaces.c (xstrcasecmp): Renamed from xstricmp.
+
+ * dosfns.c, fileio.c, font.c, fontset.c, image.c, macfns.c:
+ * macterm.c, process.c, w32.c, w32fns.c, w32proc.c, xfaces.c:
+ * xfns.c, xfont.c: Callers changed.
+
* xfont.c (xfont_list_pattern, compare_font_names): Use xstricmp.
* fontset.c (fs_query_fontset): Use xstricmp.
int *));
int ascii_face_of_lisp_face P_ ((struct frame *, int));
void prepare_face_for_display P_ ((struct frame *, struct face *));
-int xstricmp P_ ((const unsigned char *, const unsigned char *));
+int xstrcasecmp P_ ((const unsigned char *, const unsigned char *));
int lookup_face P_ ((struct frame *, Lisp_Object *));
int lookup_non_ascii_face P_ ((struct frame *, int, struct face *));
int lookup_named_face P_ ((struct frame *, Lisp_Object, int));
int i;
for (i = 0; i < sizeof (vga_colors) / sizeof (vga_colors[0]); i++)
- if (xstricmp (name, vga_colors[i]) == 0)
+ if (xstrcasecmp (name, vga_colors[i]) == 0)
return i;
return
#else
return (S_ISREG (st.st_mode)
&& len >= 5
- && (stricmp ((suffix = filename + len-4), ".com") == 0
- || stricmp (suffix, ".exe") == 0
- || stricmp (suffix, ".bat") == 0)
+ && (xstrcasecmp ((suffix = filename + len-4), ".com") == 0
+ || xstrcasecmp (suffix, ".exe") == 0
+ || xstrcasecmp (suffix, ".bat") == 0)
|| (st.st_mode & S_IFMT) == S_IFDIR);
#endif /* not WINDOWSNT */
#else /* not DOS_NT */
for (j = 1; j < ASIZE (AREF (table, i)); j++)
{
elt = AREF (AREF (table, i), j);
- if (xstricmp (s, (char *) SDATA (SYMBOL_NAME (elt))) == 0)
+ if (xstrcasecmp (s, (char *) SDATA (SYMBOL_NAME (elt))) == 0)
return ((XINT (AREF (AREF (table, i), 0)) << 8)
| (i << 4) | (j - 1));
}
Lisp_Object entity_str = SYMBOL_NAME (AREF (entity, i));
Lisp_Object spec_str = SYMBOL_NAME (spec_prop[i]);
- if (xstricmp ((char *) SDATA (spec_str), (char *) SDATA (entity_str)))
+ if (xstrcasecmp ((char *) SDATA (spec_str),
+ (char *) SDATA (entity_str)))
{
if (i == FONT_FAMILY_INDEX && CONSP (alternate_families))
{
j++, alternate_families = XCDR (alternate_families))
{
spec_str = XCAR (alternate_families);
- if (xstricmp ((char *) SDATA (spec_str),
- (char *) SDATA (entity_str)) == 0)
+ if (xstrcasecmp ((char *) SDATA (spec_str),
+ (char *) SDATA (entity_str)) == 0)
break;
}
this_name = FONTSET_NAME (fontset);
if (name_pattern == 1
? fast_string_match_ignore_case (name, this_name) >= 0
- : !xstricmp (SDATA (name), SDATA (this_name)))
+ : !xstrcasecmp (SDATA (name), SDATA (this_name)))
return i;
}
return -1;
if (CONSP (specified_color) && STRINGP (XCDR (specified_color)))
{
- if (xstricmp (SDATA (XCDR (specified_color)), "None") == 0)
+ if (xstrcasecmp (SDATA (XCDR (specified_color)), "None") == 0)
color_val = Qt;
else if (x_defined_color (f, SDATA (XCDR (specified_color)),
&cdef, 0))
}
if (NILP (color_val) && max_key > 0)
{
- if (xstricmp (max_color, "None") == 0)
+ if (xstrcasecmp (max_color, "None") == 0)
color_val = Qt;
else if (x_defined_color (f, max_color, &cdef, 0))
color_val = make_number (cdef.pixel);
int image_cache_refcount, dpyinfo_refcount;
#endif
-#if 0 /* Use xstricmp instead. */
+#if 0 /* Use xstrcasecmp instead. */
/* compare two strings ignoring case */
static int
BLOCK_INPUT;
for (i = 0; i < sizeof (mac_color_map) / sizeof (mac_color_map[0]); i++)
- if (xstricmp (colorname, mac_color_map[i].name) == 0)
+ if (xstrcasecmp (colorname, mac_color_map[i].name) == 0)
{
ret = make_number (mac_color_map[i].color);
break;
for (i = 0; i < dpyinfo->n_fonts; i++)
if (dpyinfo->font_table[i].name
- && (!xstricmp (dpyinfo->font_table[i].name, fontname)
- || !xstricmp (dpyinfo->font_table[i].full_name, fontname)))
+ && (!xstrcasecmp (dpyinfo->font_table[i].name, fontname)
+ || !xstrcasecmp (dpyinfo->font_table[i].full_name, fontname)))
return (dpyinfo->font_table + i);
return NULL;
}
got_it:
#define parse_signal(NAME, VALUE) \
- else if (!xstricmp (name, NAME)) \
+ else if (!xstrcasecmp (name, NAME)) \
XSETINT (sigcode, VALUE)
if (INTEGERP (sigcode))
if (!pw)
return pw;
- if (stricmp (name, pw->pw_name))
+ if (xstrcasecmp (name, pw->pw_name))
return NULL;
return pw;
{
strcpy (dflt_passwd.pw_name, uname);
/* Determine a reasonable uid value. */
- if (stricmp ("administrator", uname) == 0)
+ if (xstrcasecmp ("administrator", uname) == 0)
{
dflt_passwd.pw_uid = 500; /* well-known Administrator uid */
dflt_passwd.pw_gid = 513; /* well-known None gid */
else if (GetUserName (uname, &ulength))
{
strcpy (dflt_passwd.pw_name, uname);
- if (stricmp ("administrator", uname) == 0)
+ if (xstrcasecmp ("administrator", uname) == 0)
dflt_passwd.pw_uid = 0;
else
dflt_passwd.pw_uid = 123;
abort ();
*p = 0;
- if ((p = strrchr (modname, '\\')) && stricmp (p, "\\bin") == 0)
+ if ((p = strrchr (modname, '\\')) && xstrcasecmp (p, "\\bin") == 0)
{
char buf[SET_ENV_BUF_SIZE];
/* FIXME: should use substring of get_emacs_configuration ().
But I don't think the Windows build supports alpha, mips etc
anymore, so have taken the easy option for now. */
- else if (p && stricmp (p, "\\i386") == 0)
+ else if (p && xstrcasecmp (p, "\\i386") == 0)
{
*p = 0;
p = strrchr (modname, '\\');
{
*p = 0;
p = strrchr (modname, '\\');
- if (p && stricmp (p, "\\src") == 0)
+ if (p && xstrcasecmp (p, "\\src") == 0)
{
char buf[SET_ENV_BUF_SIZE];
volume_info_data * info;
for (info = volume_cache; info; info = info->next)
- if (stricmp (info->root_dir, root_dir) == 0)
+ if (xstrcasecmp (info->root_dir, root_dir) == 0)
break;
return info;
}
char * p = strrchr (name, '.');
return
(p != NULL
- && (stricmp (p, ".exe") == 0 ||
- stricmp (p, ".com") == 0 ||
- stricmp (p, ".bat") == 0 ||
- stricmp (p, ".cmd") == 0));
+ && (xstrcasecmp (p, ".exe") == 0 ||
+ xstrcasecmp (p, ".com") == 0 ||
+ xstrcasecmp (p, ".bat") == 0 ||
+ xstrcasecmp (p, ".cmd") == 0));
}
/* Emulate the Unix directory procedures opendir, closedir,
if (dir_find_handle != INVALID_HANDLE_VALUE
&& strnicmp (name, dir_pathname, len) == 0
&& IS_DIRECTORY_SEP (name[len])
- && stricmp (name + len + 1, dir_static.d_name) == 0)
+ && xstrcasecmp (name + len + 1, dir_static.d_name) == 0)
{
/* This was the last entry returned by readdir. */
wfd = dir_find_data;
#if 0 /* no way of knowing the filename */
char * p = strrchr (name, '.');
if (p != NULL &&
- (stricmp (p, ".exe") == 0 ||
- stricmp (p, ".com") == 0 ||
- stricmp (p, ".bat") == 0 ||
- stricmp (p, ".cmd") == 0))
+ (xstrcasecmp (p, ".exe") == 0 ||
+ xstrcasecmp (p, ".com") == 0 ||
+ xstrcasecmp (p, ".bat") == 0 ||
+ xstrcasecmp (p, ".cmd") == 0))
permission |= S_IEXEC;
#endif
}
{
if (!lpw) return (FW_DONTCARE);
- if (stricmp (lpw, "heavy") == 0) return FW_HEAVY;
- else if (stricmp (lpw, "extrabold") == 0) return FW_EXTRABOLD;
- else if (stricmp (lpw, "bold") == 0) return FW_BOLD;
- else if (stricmp (lpw, "demibold") == 0) return FW_SEMIBOLD;
- else if (stricmp (lpw, "semibold") == 0) return FW_SEMIBOLD;
- else if (stricmp (lpw, "medium") == 0) return FW_MEDIUM;
- else if (stricmp (lpw, "normal") == 0) return FW_NORMAL;
- else if (stricmp (lpw, "light") == 0) return FW_LIGHT;
- else if (stricmp (lpw, "extralight") == 0) return FW_EXTRALIGHT;
- else if (stricmp (lpw, "thin") == 0) return FW_THIN;
+ if (xstrcasecmp (lpw, "heavy") == 0) return FW_HEAVY;
+ else if (xstrcasecmp (lpw, "extrabold") == 0) return FW_EXTRABOLD;
+ else if (xstrcasecmp (lpw, "bold") == 0) return FW_BOLD;
+ else if (xstrcasecmp (lpw, "demibold") == 0) return FW_SEMIBOLD;
+ else if (xstrcasecmp (lpw, "semibold") == 0) return FW_SEMIBOLD;
+ else if (xstrcasecmp (lpw, "medium") == 0) return FW_MEDIUM;
+ else if (xstrcasecmp (lpw, "normal") == 0) return FW_NORMAL;
+ else if (xstrcasecmp (lpw, "light") == 0) return FW_LIGHT;
+ else if (xstrcasecmp (lpw, "extralight") == 0) return FW_EXTRALIGHT;
+ else if (xstrcasecmp (lpw, "thin") == 0) return FW_THIN;
else
return FW_DONTCARE;
}
if (NILP (this_entry))
{
/* At startup, we want iso8859-1 fonts to come up properly. */
- if (stricmp (charset, "iso8859-1") == 0)
+ if (xstrcasecmp (charset, "iso8859-1") == 0)
return ANSI_CHARSET;
else
return DEFAULT_CHARSET;
for (i = 0; i < one_w32_display_info.n_fonts ;i++, pfi++)
{
- if (stricmp (pfi->name, fontname) == 0) return pfi;
+ if (xstrcasecmp (pfi->name, fontname) == 0) return pfi;
}
return NULL;
p = strrchr (filename, '.');
/* We can only identify DOS .com programs from the extension. */
- if (p && stricmp (p, ".com") == 0)
+ if (p && xstrcasecmp (p, ".com") == 0)
*is_dos_app = TRUE;
- else if (p && (stricmp (p, ".bat") == 0
- || stricmp (p, ".cmd") == 0))
+ else if (p && (xstrcasecmp (p, ".bat") == 0
+ || xstrcasecmp (p, ".cmd") == 0))
{
/* A DOS shell script - it appears that CreateProcess is happy to
accept this (somewhat surprisingly); presumably it looks at
#endif /* MAC_OS */
-/* Like stricmp. Used to compare parts of font names which are in
- ISO8859-1. */
+/* Like strcasecmp/stricmp. Used to compare parts of font names which
+ are in ISO8859-1. */
int
-xstricmp (s1, s2)
+xstrcasecmp (s1, s2)
const unsigned char *s1, *s2;
{
while (*s1 && *s2)
#ifdef HAVE_WINDOW_SYSTEM
FRAME_WINDOW_P (f)
? (!NILP (Fxw_display_color_p (frame))
- || xstricmp (color_name, "black") == 0
- || xstricmp (color_name, "white") == 0
+ || xstrcasecmp (color_name, "black") == 0
+ || xstrcasecmp (color_name, "white") == 0
|| (background_p
&& face_color_gray_p (f, color_name))
|| (!NILP (Fx_display_grayscale_p (frame))
xassert (STRINGP (value));
- if (xstricmp (SDATA (value), "on") == 0
- || xstricmp (SDATA (value), "true") == 0)
+ if (xstrcasecmp (SDATA (value), "on") == 0
+ || xstrcasecmp (SDATA (value), "true") == 0)
result = Qt;
- else if (xstricmp (SDATA (value), "off") == 0
- || xstricmp (SDATA (value), "false") == 0)
+ else if (xstrcasecmp (SDATA (value), "off") == 0
+ || xstrcasecmp (SDATA (value), "false") == 0)
result = Qnil;
- else if (xstricmp (SDATA (value), "unspecified") == 0)
+ else if (xstrcasecmp (SDATA (value), "unspecified") == 0)
result = Qunspecified;
else if (signal_p)
signal_error ("Invalid face attribute value from X resource", value);
CHECK_SYMBOL (attr);
CHECK_STRING (value);
- if (xstricmp (SDATA (value), "unspecified") == 0)
+ if (xstrcasecmp (SDATA (value), "unspecified") == 0)
value = Qunspecified;
else if (EQ (attr, QCheight))
{
{
xassert (lface_fully_specified_p (lface1)
&& lface_fully_specified_p (lface2));
- return (xstricmp (SDATA (lface1[LFACE_FAMILY_INDEX]),
- SDATA (lface2[LFACE_FAMILY_INDEX])) == 0
+ return (xstrcasecmp (SDATA (lface1[LFACE_FAMILY_INDEX]),
+ SDATA (lface2[LFACE_FAMILY_INDEX])) == 0
&& EQ (lface1[LFACE_HEIGHT_INDEX], lface2[LFACE_HEIGHT_INDEX])
&& EQ (lface1[LFACE_SWIDTH_INDEX], lface2[LFACE_SWIDTH_INDEX])
&& EQ (lface1[LFACE_WEIGHT_INDEX], lface2[LFACE_WEIGHT_INDEX])
&& (EQ (lface1[LFACE_FONTSET_INDEX], lface2[LFACE_FONTSET_INDEX])
|| (STRINGP (lface1[LFACE_FONTSET_INDEX])
&& STRINGP (lface2[LFACE_FONTSET_INDEX])
- && ! xstricmp (SDATA (lface1[LFACE_FONTSET_INDEX]),
- SDATA (lface2[LFACE_FONTSET_INDEX]))))
+ && ! xstrcasecmp (SDATA (lface1[LFACE_FONTSET_INDEX]),
+ SDATA (lface2[LFACE_FONTSET_INDEX]))))
);
}
/* Determine the visual class. */
for (i = 0; visual_classes[i].name; ++i)
- if (xstricmp (s, visual_classes[i].name) == 0)
+ if (xstrcasecmp (s, visual_classes[i].name) == 0)
{
class = visual_classes[i].class;
break;
static int
compare_font_names (const void *name1, const void *name2)
{
- return xstricmp (*(const char **) name1, *(const char **) name2);
+ return xstrcasecmp (*(const char **) name1, *(const char **) name2);
}
static Lisp_Object xfont_list_pattern P_ ((Lisp_Object, Display *, char *));
Lisp_Object entity;
int result;
- if (i > 0 && xstricmp (indices[i - 1], indices[i]) == 0)
+ if (i > 0 && xstrcasecmp (indices[i - 1], indices[i]) == 0)
continue;
entity = font_make_entity ();