[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/src/w32fns.c
From: |
Ken Raeburn |
Subject: |
[Emacs-diffs] Changes to emacs/src/w32fns.c |
Date: |
Sun, 14 Jul 2002 20:01:01 -0400 |
Index: emacs/src/w32fns.c
diff -c emacs/src/w32fns.c:1.178 emacs/src/w32fns.c:1.179
*** emacs/src/w32fns.c:1.178 Thu Jul 11 10:15:56 2002
--- emacs/src/w32fns.c Sun Jul 14 20:00:37 2002
***************
*** 571,577 ****
{
if (dpyinfo->bitmaps[id].refcount
&& dpyinfo->bitmaps[id].file
! && !strcmp (dpyinfo->bitmaps[id].file, (char *) XSTRING (file)->data))
{
++dpyinfo->bitmaps[id].refcount;
return id + 1;
--- 571,577 ----
{
if (dpyinfo->bitmaps[id].refcount
&& dpyinfo->bitmaps[id].file
! && !strcmp (dpyinfo->bitmaps[id].file, (char *) SDATA (file)))
{
++dpyinfo->bitmaps[id].refcount;
return id + 1;
***************
*** 584,590 ****
return -1;
emacs_close (fd);
! filename = (char *) XSTRING (found)->data;
hinst = LoadLibraryEx (filename, NULL, LOAD_LIBRARY_AS_DATAFILE);
--- 584,590 ----
return -1;
emacs_close (fd);
! filename = (char *) SDATA (found);
hinst = LoadLibraryEx (filename, NULL, LOAD_LIBRARY_AS_DATAFILE);
***************
*** 600,610 ****
id = x_allocate_bitmap_record (f);
dpyinfo->bitmaps[id - 1].pixmap = bitmap;
dpyinfo->bitmaps[id - 1].refcount = 1;
! dpyinfo->bitmaps[id - 1].file = (char *) xmalloc (XSTRING (file)->size + 1);
dpyinfo->bitmaps[id - 1].depth = 1;
dpyinfo->bitmaps[id - 1].height = height;
dpyinfo->bitmaps[id - 1].width = width;
! strcpy (dpyinfo->bitmaps[id - 1].file, XSTRING (file)->data);
return id;
#endif /* TODO */
--- 600,610 ----
id = x_allocate_bitmap_record (f);
dpyinfo->bitmaps[id - 1].pixmap = bitmap;
dpyinfo->bitmaps[id - 1].refcount = 1;
! dpyinfo->bitmaps[id - 1].file = (char *) xmalloc (SCHARS (file) + 1);
dpyinfo->bitmaps[id - 1].depth = 1;
dpyinfo->bitmaps[id - 1].height = height;
dpyinfo->bitmaps[id - 1].width = width;
! strcpy (dpyinfo->bitmaps[id - 1].file, SDATA (file));
return id;
#endif /* TODO */
***************
*** 1216,1222 ****
CHECK_STRING (filename);
abspath = Fexpand_file_name (filename, Qnil);
! fp = fopen (XSTRING (filename)->data, "rt");
if (fp)
{
char buf[512];
--- 1216,1222 ----
CHECK_STRING (filename);
abspath = Fexpand_file_name (filename, Qnil);
! fp = fopen (SDATA (filename), "rt");
if (fp)
{
char buf[512];
***************
*** 1556,1562 ****
tem = Fcar (elt);
! if (lstrcmpi (XSTRING (tem)->data, colorname) == 0)
{
ret = XUINT (Fcdr (elt));
break;
--- 1556,1562 ----
tem = Fcar (elt);
! if (lstrcmpi (SDATA (tem), colorname) == 0)
{
ret = XUINT (Fcdr (elt));
break;
***************
*** 1986,1994 ****
CHECK_STRING (arg);
! if (strcmp (XSTRING (arg)->data, "black") == 0)
return BLACK_PIX_DEFAULT (f);
! else if (strcmp (XSTRING (arg)->data, "white") == 0)
return WHITE_PIX_DEFAULT (f);
if ((FRAME_W32_DISPLAY_INFO (f)->n_planes * FRAME_W32_DISPLAY_INFO
(f)->n_cbits) == 1)
--- 1986,1994 ----
CHECK_STRING (arg);
! if (strcmp (SDATA (arg), "black") == 0)
return BLACK_PIX_DEFAULT (f);
! else if (strcmp (SDATA (arg), "white") == 0)
return WHITE_PIX_DEFAULT (f);
if ((FRAME_W32_DISPLAY_INFO (f)->n_planes * FRAME_W32_DISPLAY_INFO
(f)->n_cbits) == 1)
***************
*** 1996,2002 ****
/* w32_defined_color is responsible for coping with failures
by looking for a near-miss. */
! if (w32_defined_color (f, XSTRING (arg)->data, &cdef, 1))
return cdef.pixel;
/* defined_color failed; return an ultimate default. */
--- 1996,2002 ----
/* w32_defined_color is responsible for coping with failures
by looking for a near-miss. */
! if (w32_defined_color (f, SDATA (arg), &cdef, 1))
return cdef.pixel;
/* defined_color failed; return an ultimate default. */
***************
*** 2476,2486 ****
BLOCK_INPUT;
result = x_text_icon (f,
! (char *) XSTRING ((!NILP (f->icon_name)
! ? f->icon_name
! : !NILP (f->title)
! ? f->title
! : f->name))->data);
if (result)
{
--- 2476,2486 ----
BLOCK_INPUT;
result = x_text_icon (f,
! (char *) SDATA ((!NILP (f->icon_name)
! ? f->icon_name
! : !NILP (f->title)
! ? f->title
! : f->name)));
if (result)
{
***************
*** 2522,2533 ****
BLOCK_INPUT;
result = (STRINGP (fontset_name)
! ? x_new_fontset (f, XSTRING (fontset_name)->data)
! : x_new_font (f, XSTRING (arg)->data));
UNBLOCK_INPUT;
if (EQ (result, Qnil))
! error ("Font `%s' is not defined", XSTRING (arg)->data);
else if (EQ (result, Qt))
error ("The characters of the given font have varying widths");
else if (STRINGP (result))
--- 2522,2533 ----
BLOCK_INPUT;
result = (STRINGP (fontset_name)
! ? x_new_fontset (f, SDATA (fontset_name))
! : x_new_font (f, SDATA (arg)));
UNBLOCK_INPUT;
if (EQ (result, Qnil))
! error ("Font `%s' is not defined", SDATA (arg));
else if (EQ (result, Qt))
error ("The characters of the given font have varying widths");
else if (STRINGP (result))
***************
*** 2812,2818 ****
/* Check for no change needed in this very common case
before we do any consing. */
if (!strcmp (FRAME_W32_DISPLAY_INFO (f)->w32_id_name,
! XSTRING (f->name)->data))
return;
name = build_string (FRAME_W32_DISPLAY_INFO (f)->w32_id_name);
}
--- 2812,2818 ----
/* Check for no change needed in this very common case
before we do any consing. */
if (!strcmp (FRAME_W32_DISPLAY_INFO (f)->w32_id_name,
! SDATA (f->name)))
return;
name = build_string (FRAME_W32_DISPLAY_INFO (f)->w32_id_name);
}
***************
*** 2836,2842 ****
name = ENCODE_SYSTEM (name);
BLOCK_INPUT;
! SetWindowText(FRAME_W32_WINDOW (f), XSTRING (name)->data);
UNBLOCK_INPUT;
}
}
--- 2836,2842 ----
name = ENCODE_SYSTEM (name);
BLOCK_INPUT;
! SetWindowText(FRAME_W32_WINDOW (f), SDATA (name));
UNBLOCK_INPUT;
}
}
***************
*** 2896,2902 ****
name = ENCODE_SYSTEM (name);
BLOCK_INPUT;
! SetWindowText(FRAME_W32_WINDOW (f), XSTRING (name)->data);
UNBLOCK_INPUT;
}
}
--- 2896,2902 ----
name = ENCODE_SYSTEM (name);
BLOCK_INPUT;
! SetWindowText(FRAME_W32_WINDOW (f), SDATA (name));
UNBLOCK_INPUT;
}
}
***************
*** 3002,3011 ****
if (STRINGP (Vx_resource_name))
{
! unsigned char *p = XSTRING (Vx_resource_name)->data;
int i;
! len = STRING_BYTES (XSTRING (Vx_resource_name));
/* Only letters, digits, - and _ are valid in resource names.
Count the valid characters and count the invalid ones. */
--- 3002,3011 ----
if (STRINGP (Vx_resource_name))
{
! unsigned char *p = SDATA (Vx_resource_name);
int i;
! len = SBYTES (Vx_resource_name);
/* Only letters, digits, - and _ are valid in resource names.
Count the valid characters and count the invalid ones. */
***************
*** 3044,3055 ****
for (i = 0; i < len; i++)
{
! int c = XSTRING (new)->data[i];
if (! ((c >= 'a' && c <= 'z')
|| (c >= 'A' && c <= 'Z')
|| (c >= '0' && c <= '9')
|| c == '-' || c == '_'))
! XSTRING (new)->data[i] = '_';
}
}
--- 3044,3055 ----
for (i = 0; i < len; i++)
{
! int c = SREF (new, i);
if (! ((c >= 'a' && c <= 'z')
|| (c >= 'A' && c <= 'Z')
|| (c >= '0' && c <= '9')
|| c == '-' || c == '_'))
! SREF (new, i) = '_';
}
}
***************
*** 3087,3123 ****
/* Allocate space for the components, the dots which separate them,
and the final '\0'. Make them big enough for the worst case. */
! name_key = (char *) alloca (STRING_BYTES (XSTRING (Vx_resource_name))
+ (STRINGP (component)
! ? STRING_BYTES (XSTRING (component)) : 0)
! + STRING_BYTES (XSTRING (attribute))
+ 3);
class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1)
! + STRING_BYTES (XSTRING (class))
+ (STRINGP (subclass)
! ? STRING_BYTES (XSTRING (subclass)) : 0)
+ 3);
/* Start with emacs.FRAMENAME for the name (the specific one)
and with `Emacs' for the class key (the general one). */
! strcpy (name_key, XSTRING (Vx_resource_name)->data);
strcpy (class_key, EMACS_CLASS);
strcat (class_key, ".");
! strcat (class_key, XSTRING (class)->data);
if (!NILP (component))
{
strcat (class_key, ".");
! strcat (class_key, XSTRING (subclass)->data);
strcat (name_key, ".");
! strcat (name_key, XSTRING (component)->data);
}
strcat (name_key, ".");
! strcat (name_key, XSTRING (attribute)->data);
value = x_get_string_resource (Qnil,
name_key, class_key);
--- 3087,3123 ----
/* Allocate space for the components, the dots which separate them,
and the final '\0'. Make them big enough for the worst case. */
! name_key = (char *) alloca (SBYTES (Vx_resource_name)
+ (STRINGP (component)
! ? SBYTES (component) : 0)
! + SBYTES (attribute)
+ 3);
class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1)
! + SBYTES (class)
+ (STRINGP (subclass)
! ? SBYTES (subclass) : 0)
+ 3);
/* Start with emacs.FRAMENAME for the name (the specific one)
and with `Emacs' for the class key (the general one). */
! strcpy (name_key, SDATA (Vx_resource_name));
strcpy (class_key, EMACS_CLASS);
strcat (class_key, ".");
! strcat (class_key, SDATA (class));
if (!NILP (component))
{
strcat (class_key, ".");
! strcat (class_key, SDATA (subclass));
strcat (name_key, ".");
! strcat (name_key, SDATA (component));
}
strcat (name_key, ".");
! strcat (name_key, SDATA (attribute));
value = x_get_string_resource (Qnil,
name_key, class_key);
***************
*** 3140,3152 ****
/* Allocate space for the components, the dots which separate them,
and the final '\0'. */
! name_key = (char *) alloca (STRING_BYTES (XSTRING (Vinvocation_name))
+ strlen (attribute) + 2);
class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1)
+ strlen (class) + 2);
sprintf (name_key, "%s.%s",
! XSTRING (Vinvocation_name)->data,
attribute);
sprintf (class_key, "%s.%s", EMACS_CLASS, class);
--- 3140,3152 ----
/* Allocate space for the components, the dots which separate them,
and the final '\0'. */
! name_key = (char *) alloca (SBYTES (Vinvocation_name)
+ strlen (attribute) + 2);
class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1)
+ strlen (class) + 2);
sprintf (name_key, "%s.%s",
! SDATA (Vinvocation_name),
attribute);
sprintf (class_key, "%s.%s", EMACS_CLASS, class);
***************
*** 3201,3215 ****
switch (type)
{
case RES_TYPE_NUMBER:
! return make_number (atoi (XSTRING (tem)->data));
case RES_TYPE_FLOAT:
! return make_float (atof (XSTRING (tem)->data));
case RES_TYPE_BOOLEAN:
tem = Fdowncase (tem);
! if (!strcmp (XSTRING (tem)->data, "on")
! || !strcmp (XSTRING (tem)->data, "true"))
return Qt;
else
return Qnil;
--- 3201,3215 ----
switch (type)
{
case RES_TYPE_NUMBER:
! return make_number (atoi (SDATA (tem)));
case RES_TYPE_FLOAT:
! return make_float (atof (SDATA (tem)));
case RES_TYPE_BOOLEAN:
tem = Fdowncase (tem);
! if (!strcmp (SDATA (tem), "on")
! || !strcmp (SDATA (tem), "true"))
return Qt;
else
return Qnil;
***************
*** 3223,3233 ****
{
Lisp_Object lower;
lower = Fdowncase (tem);
! if (!strcmp (XSTRING (lower)->data, "on")
! || !strcmp (XSTRING (lower)->data, "true"))
return Qt;
! else if (!strcmp (XSTRING (lower)->data, "off")
! || !strcmp (XSTRING (lower)->data, "false"))
return Qnil;
else
return Fintern (tem, Qnil);
--- 3223,3233 ----
{
Lisp_Object lower;
lower = Fdowncase (tem);
! if (!strcmp (SDATA (lower), "on")
! || !strcmp (SDATA (lower), "true"))
return Qt;
! else if (!strcmp (SDATA (lower), "off")
! || !strcmp (SDATA (lower), "false"))
return Qnil;
else
return Fintern (tem, Qnil);
***************
*** 3284,3290 ****
CHECK_STRING (string);
! geometry = XParseGeometry ((char *) XSTRING (string)->data,
&x, &y, &width, &height);
result = Qnil;
--- 3284,3290 ----
CHECK_STRING (string);
! geometry = XParseGeometry ((char *) SDATA (string),
&x, &y, &width, &height);
result = Qnil;
***************
*** 5342,5348 ****
Elsewhere we specify the window name for the window manager. */
{
! char *str = (char *) XSTRING (Vx_resource_name)->data;
f->namebuf = (char *) xmalloc (strlen (str) + 1);
strcpy (f->namebuf, str);
}
--- 5342,5348 ----
Elsewhere we specify the window name for the window manager. */
{
! char *str = (char *) SDATA (Vx_resource_name);
f->namebuf = (char *) xmalloc (strlen (str) + 1);
strcpy (f->namebuf, str);
}
***************
*** 5409,5417 ****
? IconicState
: NormalState));
! x_text_icon (f, (char *) XSTRING ((!NILP (f->icon_name)
? f->icon_name
! : f->name))->data);
#endif
UNBLOCK_INPUT;
--- 5409,5417 ----
? IconicState
: NormalState));
! x_text_icon (f, (char *) SDATA ((!NILP (f->icon_name)
? f->icon_name
! : f->name)));
#endif
UNBLOCK_INPUT;
***************
*** 5621,5629 ****
{
tem = Fquery_fontset (font, Qnil);
if (STRINGP (tem))
! font = x_new_fontset (f, XSTRING (tem)->data);
else
! font = x_new_font (f, XSTRING (font)->data);
}
/* Try out a font which we hope has bold and italic variations. */
if (!STRINGP (font))
--- 5621,5629 ----
{
tem = Fquery_fontset (font, Qnil);
if (STRINGP (tem))
! font = x_new_fontset (f, SDATA (tem));
else
! font = x_new_font (f, SDATA (font));
}
/* Try out a font which we hope has bold and italic variations. */
if (!STRINGP (font))
***************
*** 5912,5923 ****
for (tail = font_names; CONSP (tail); tail = XCDR (tail))
if (dpyinfo->font_table[i].name
&& (!strcmp (dpyinfo->font_table[i].name,
! XSTRING (XCAR (tail))->data)
|| !strcmp (dpyinfo->font_table[i].full_name,
! XSTRING (XCAR (tail))->data)))
return (dpyinfo->font_table + i);
! fontname = (char *) XSTRING (XCAR (font_names))->data;
}
else if (w32_strict_fontnames)
{
--- 5912,5923 ----
for (tail = font_names; CONSP (tail); tail = XCDR (tail))
if (dpyinfo->font_table[i].name
&& (!strcmp (dpyinfo->font_table[i].name,
! SDATA (XCAR (tail)))
|| !strcmp (dpyinfo->font_table[i].full_name,
! SDATA (XCAR (tail)))))
return (dpyinfo->font_table + i);
! fontname = (char *) SDATA (XCAR (font_names));
}
else if (w32_strict_fontnames)
{
***************
*** 6125,6133 ****
char *bdf_name, *bdf_file;
Lisp_Object bdf_pair;
! bdf_name = XSTRING (XCAR (bdf_fonts))->data;
bdf_pair = Fassoc (XCAR (bdf_fonts), Vw32_bdf_filename_alist);
! bdf_file = XSTRING (XCDR (bdf_pair))->data;
retval = w32_load_bdf_font (f, bdf_name, size, bdf_file);
--- 6125,6133 ----
char *bdf_name, *bdf_file;
Lisp_Object bdf_pair;
! bdf_name = SDATA (XCAR (bdf_fonts));
bdf_pair = Fassoc (XCAR (bdf_fonts), Vw32_bdf_filename_alist);
! bdf_file = SDATA (XCDR (bdf_pair));
retval = w32_load_bdf_font (f, bdf_name, size, bdf_file);
***************
*** 6413,6419 ****
|| !SYMBOLP (XCAR (XCDR (this_entry))))
continue;
! x_charset = XSTRING (XCAR (this_entry))->data;
w32_charset = XCAR (XCDR (this_entry));
codepage = XCDR (XCDR (this_entry));
--- 6413,6419 ----
|| !SYMBOLP (XCAR (XCDR (this_entry))))
continue;
! x_charset = SDATA (XCAR (this_entry));
w32_charset = XCAR (XCDR (this_entry));
codepage = XCDR (XCDR (this_entry));
***************
*** 7196,7202 ****
if (!NILP (lpef->pattern))
{
! charset = xlfd_charset_of_font (XSTRING(lpef->pattern)->data);
/* We already checked charsets above, but DEFAULT_CHARSET
slipped through. So only allow exact matches for DEFAULT_CHARSET.
*/
--- 7196,7202 ----
if (!NILP (lpef->pattern))
{
! charset = xlfd_charset_of_font (SDATA (lpef->pattern));
/* We already checked charsets above, but DEFAULT_CHARSET
slipped through. So only allow exact matches for DEFAULT_CHARSET.
*/
***************
*** 7216,7222 ****
for ( ; CONSP (charset_list); charset_list = Fcdr (charset_list))
{
Lisp_Object this_charset = Fcar (charset_list);
! charset = XSTRING (this_charset)->data;
/* List bold and italic variations if w32-enable-synthesized-fonts
is non-nil and this is a plain font. */
--- 7216,7222 ----
for ( ; CONSP (charset_list); charset_list = Fcdr (charset_list))
{
Lisp_Object this_charset = Fcar (charset_list);
! charset = SDATA (this_charset);
/* List bold and italic variations if w32-enable-synthesized-fonts
is non-nil and this is a plain font. */
***************
*** 7261,7267 ****
return;
if (NILP (lpef->pattern)
! || w32_font_match (buf, XSTRING (lpef->pattern)->data))
{
/* Check if we already listed this font. This may happen if
w32_enable_synthesized_fonts is non-nil, and there are real
--- 7261,7267 ----
return;
if (NILP (lpef->pattern)
! || w32_font_match (buf, SDATA (lpef->pattern)))
{
/* Check if we already listed this font. This may happen if
w32_enable_synthesized_fonts is non-nil, and there are real
***************
*** 7335,7349 ****
int n_fonts = 0;
list = Vw32_bdf_filename_alist;
! ptnstr = XSTRING (pattern)->data;
for ( ; CONSP (list); list = XCDR (list))
{
tem = XCAR (list);
if (CONSP (tem))
! fontname = XSTRING (XCAR (tem))->data;
else if (STRINGP (tem))
! fontname = XSTRING (tem)->data;
else
continue;
--- 7335,7349 ----
int n_fonts = 0;
list = Vw32_bdf_filename_alist;
! ptnstr = SDATA (pattern);
for ( ; CONSP (list); list = XCDR (list))
{
tem = XCAR (list);
if (CONSP (tem))
! fontname = SDATA (XCAR (tem));
else if (STRINGP (tem))
! fontname = SDATA (tem);
else
continue;
***************
*** 7395,7401 ****
/* Avoid expensive EnumFontFamilies functions if we are not
going to be able to output one of these anyway. */
! codepage = w32_codepage_for_font (XSTRING (tpat)->data);
if (codepage != CP_8BIT && codepage != CP_UNICODE
&& codepage != CP_DEFAULT && codepage != CP_UNKNOWN
&& !IsValidCodePage(codepage))
--- 7395,7401 ----
/* Avoid expensive EnumFontFamilies functions if we are not
going to be able to output one of these anyway. */
! codepage = w32_codepage_for_font (SDATA (tpat));
if (codepage != CP_8BIT && codepage != CP_UNICODE
&& codepage != CP_DEFAULT && codepage != CP_UNKNOWN
&& !IsValidCodePage(codepage))
***************
*** 7422,7428 ****
/* Use EnumFontFamiliesEx where it is available, as it knows
about character sets. Fall back to EnumFontFamilies for
older versions of NT that don't support the 'Ex function. */
! x_to_w32_font (XSTRING (tpat)->data, &ef.logfont);
{
LOGFONT font_match_pattern;
HMODULE gdi32 = GetModuleHandle ("gdi32.dll");
--- 7422,7428 ----
/* Use EnumFontFamiliesEx where it is available, as it knows
about character sets. Fall back to EnumFontFamilies for
older versions of NT that don't support the 'Ex function. */
! x_to_w32_font (SDATA (tpat), &ef.logfont);
{
LOGFONT font_match_pattern;
HMODULE gdi32 = GetModuleHandle ("gdi32.dll");
***************
*** 7492,7498 ****
HDC hdc;
HANDLE oldobj;
! if (!x_to_w32_font (XSTRING (XCAR (tem))->data, &lf))
continue;
BLOCK_INPUT;
--- 7492,7498 ----
HDC hdc;
HANDLE oldobj;
! if (!x_to_w32_font (SDATA (XCAR (tem)), &lf))
continue;
BLOCK_INPUT;
***************
*** 7639,7645 ****
for ( ; CONSP(filelist); filelist = XCDR (filelist))
{
Lisp_Object filename = XCAR (filelist);
! if (w32_BDF_to_x_font (XSTRING (filename)->data, fontname, 100))
store_in_alist (&list, build_string (fontname), filename);
}
return list;
--- 7639,7645 ----
for ( ; CONSP(filelist); filelist = XCDR (filelist))
{
Lisp_Object filename = XCAR (filelist);
! if (w32_BDF_to_x_font (SDATA (filename), fontname, 100))
store_in_alist (&list, build_string (fontname), filename);
}
return list;
***************
*** 7684,7690 ****
CHECK_STRING (color);
! if (w32_defined_color (f, XSTRING (color)->data, &foo, 0))
return Qt;
else
return Qnil;
--- 7684,7690 ----
CHECK_STRING (color);
! if (w32_defined_color (f, SDATA (color), &foo, 0))
return Qt;
else
return Qnil;
***************
*** 7700,7706 ****
CHECK_STRING (color);
! if (w32_defined_color (f, XSTRING (color)->data, &foo, 0))
{
Lisp_Object rgb[3];
--- 7700,7706 ----
CHECK_STRING (color);
! if (w32_defined_color (f, SDATA (color), &foo, 0))
{
Lisp_Object rgb[3];
***************
*** 8031,8040 ****
validate_x_resource_name ();
dpyinfo = w32_term_init (name, (unsigned char *)0,
! (char *) XSTRING (Vx_resource_name)->data);
if (dpyinfo == 0)
! error ("Cannot connect to server %s", XSTRING (name)->data);
w32_in_use = 1;
XSETFASTINT (Vwindow_system_version, 3);
--- 8031,8040 ----
validate_x_resource_name ();
dpyinfo = w32_term_init (name, (unsigned char *)0,
! (char *) SDATA (Vx_resource_name));
if (dpyinfo == 0)
! error ("Cannot connect to server %s", SDATA (name));
w32_in_use = 1;
XSETFASTINT (Vwindow_system_version, 3);
***************
*** 8089,8095 ****
Vw32_color_map = Fw32_default_color_map ();
if (! NILP (xrm_string))
! xrm_option = (unsigned char *) XSTRING (xrm_string)->data;
else
xrm_option = (unsigned char *) 0;
--- 8089,8095 ----
Vw32_color_map = Fw32_default_color_map ();
if (! NILP (xrm_string))
! xrm_option = (unsigned char *) SDATA (xrm_string);
else
xrm_option = (unsigned char *) 0;
***************
*** 8098,8104 ****
{
char basename[ MAX_PATH ], *str;
! strcpy (basename, XSTRING (Vinvocation_name)->data);
str = strrchr (basename, '.');
if (str) *str = 0;
Vinvocation_name = build_string (basename);
--- 8098,8104 ----
{
char basename[ MAX_PATH ], *str;
! strcpy (basename, SDATA (Vinvocation_name));
str = strrchr (basename, '.');
if (str) *str = 0;
Vinvocation_name = build_string (basename);
***************
*** 8110,8124 ****
/* This is what opens the connection and sets x_current_display.
This also initializes many symbols, such as those used for input. */
dpyinfo = w32_term_init (display, xrm_option,
! (char *) XSTRING (Vx_resource_name)->data);
if (dpyinfo == 0)
{
if (!NILP (must_succeed))
fatal ("Cannot connect to server %s.\n",
! XSTRING (display)->data);
else
! error ("Cannot connect to server %s", XSTRING (display)->data);
}
w32_in_use = 1;
--- 8110,8124 ----
/* This is what opens the connection and sets x_current_display.
This also initializes many symbols, such as those used for input. */
dpyinfo = w32_term_init (display, xrm_option,
! (char *) SDATA (Vx_resource_name));
if (dpyinfo == 0)
{
if (!NILP (must_succeed))
fatal ("Cannot connect to server %s.\n",
! SDATA (display));
else
! error ("Cannot connect to server %s", SDATA (display));
}
w32_in_use = 1;
***************
*** 8402,8408 ****
/* Find key in KEYWORDS. Error if not found. */
for (i = 0; i < nkeywords; ++i)
! if (strcmp (keywords[i].name, XSTRING (SYMBOL_NAME (key))->data) == 0)
break;
if (i == nkeywords)
--- 8402,8408 ----
/* Find key in KEYWORDS. Error if not found. */
for (i = 0; i < nkeywords; ++i)
! if (strcmp (keywords[i].name, SDATA (SYMBOL_NAME (key))) == 0)
break;
if (i == nkeywords)
***************
*** 8916,8922 ****
xassert (STRINGP (color_name));
! if (w32_defined_color (f, XSTRING (color_name)->data, &color, 1))
{
/* This isn't called frequently so we get away with simply
reallocating the color vector to the needed size, here. */
--- 8916,8922 ----
xassert (STRINGP (color_name));
! if (w32_defined_color (f, SDATA (color_name), &color, 1))
{
/* This isn't called frequently so we get away with simply
reallocating the color vector to the needed size, here. */
***************
*** 9694,9700 ****
if (STRINGP (elt))
{
! if (XSTRING (elt)->size
< (width + BITS_PER_CHAR - 1) / BITS_PER_CHAR)
return 0;
}
--- 9694,9700 ----
if (STRINGP (elt))
{
! if (SCHARS (elt)
< (width + BITS_PER_CHAR - 1) / BITS_PER_CHAR)
return 0;
}
***************
*** 9709,9715 ****
}
else if (STRINGP (data))
{
! if (XSTRING (data)->size
< (width + BITS_PER_CHAR - 1) / BITS_PER_CHAR * height)
return 0;
}
--- 9709,9715 ----
}
else if (STRINGP (data))
{
! if (SCHARS (data)
< (width + BITS_PER_CHAR - 1) / BITS_PER_CHAR * height)
return 0;
}
***************
*** 10073,10081 ****
{
int w, h;
return (STRINGP (data)
! && xbm_read_bitmap_data (XSTRING (data)->data,
! (XSTRING (data)->data
! + STRING_BYTES (XSTRING (data))),
&w, &h, NULL));
}
--- 10073,10081 ----
{
int w, h;
return (STRINGP (data)
! && xbm_read_bitmap_data (SDATA (data),
! (SDATA (data)
! + SBYTES (data)),
&w, &h, NULL));
}
***************
*** 10111,10117 ****
return 0;
}
! contents = slurp_file (XSTRING (file)->data, &size);
if (contents == NULL)
{
image_error ("Error loading XBM image `%s'", img->spec, Qnil);
--- 10111,10117 ----
return 0;
}
! contents = slurp_file (SDATA (file), &size);
if (contents == NULL)
{
image_error ("Error loading XBM image `%s'", img->spec, Qnil);
***************
*** 10161,10169 ****
background);
if (in_memory_file_p)
! success_p = xbm_load_image (f, img, XSTRING (data)->data,
! (XSTRING (data)->data
! + STRING_BYTES (XSTRING (data))));
else
{
if (VECTORP (data))
--- 10161,10169 ----
background);
if (in_memory_file_p)
! success_p = xbm_load_image (f, img, SDATA (data),
! (SDATA (data)
! + SBYTES (data)));
else
{
if (VECTORP (data))
***************
*** 10177,10189 ****
{
Lisp_Object line = XVECTOR (data)->contents[i];
if (STRINGP (line))
! bcopy (XSTRING (line)->data, p, nbytes);
else
bcopy (XBOOL_VECTOR (line)->data, p, nbytes);
}
}
else if (STRINGP (data))
! bits = XSTRING (data)->data;
else
bits = XBOOL_VECTOR (data)->data;
--- 10177,10189 ----
{
Lisp_Object line = XVECTOR (data)->contents[i];
if (STRINGP (line))
! bcopy (SDATA (line), p, nbytes);
else
bcopy (XBOOL_VECTOR (line)->data, p, nbytes);
}
}
else if (STRINGP (data))
! bits = SDATA (data);
else
bits = XBOOL_VECTOR (data)->data;
***************
*** 10372,10381 ****
{
Lisp_Object name = XCAR (XCAR (tail));
Lisp_Object color = XCDR (XCAR (tail));
! xpm_syms[i].name = (char *) alloca (XSTRING (name)->size + 1);
! strcpy (xpm_syms[i].name, XSTRING (name)->data);
! xpm_syms[i].value = (char *) alloca (XSTRING (color)->size + 1);
! strcpy (xpm_syms[i].value, XSTRING (color)->data);
}
}
--- 10372,10381 ----
{
Lisp_Object name = XCAR (XCAR (tail));
Lisp_Object color = XCDR (XCAR (tail));
! xpm_syms[i].name = (char *) alloca (SCHARS (name) + 1);
! strcpy (xpm_syms[i].name, SDATA (name));
! xpm_syms[i].value = (char *) alloca (SCHARS (color) + 1);
! strcpy (xpm_syms[i].value, SDATA (color));
}
}
***************
*** 10394,10407 ****
}
rc = XpmReadFileToPixmap (NULL, FRAME_W32_WINDOW (f),
! XSTRING (file)->data, &img->pixmap, &img->mask,
&attrs);
}
else
{
Lisp_Object buffer = image_spec_value (img->spec, QCdata, NULL);
rc = XpmCreatePixmapFromBuffer (NULL, FRAME_W32_WINDOW (f),
! XSTRING (buffer)->data,
&img->pixmap, &img->mask,
&attrs);
}
--- 10394,10407 ----
}
rc = XpmReadFileToPixmap (NULL, FRAME_W32_WINDOW (f),
! SDATA (file), &img->pixmap, &img->mask,
&attrs);
}
else
{
Lisp_Object buffer = image_spec_value (img->spec, QCdata, NULL);
rc = XpmCreatePixmapFromBuffer (NULL, FRAME_W32_WINDOW (f),
! SDATA (buffer),
&img->pixmap, &img->mask,
&attrs);
}
***************
*** 11218,11225 ****
char *buf = NULL;
struct stat st;
! if (stat (XSTRING (file)->data, &st) == 0
! && (fp = fopen (XSTRING (file)->data, "r")) != NULL
&& (buf = (char *) xmalloc (st.st_size),
fread (buf, 1, st.st_size, fp) == st.st_size))
{
--- 11218,11225 ----
char *buf = NULL;
struct stat st;
! if (stat (SDATA (file), &st) == 0
! && (fp = fopen (SDATA (file), "r")) != NULL
&& (buf = (char *) xmalloc (st.st_size),
fread (buf, 1, st.st_size, fp) == st.st_size))
{
***************
*** 11272,11278 ****
return 0;
}
! contents = slurp_file (XSTRING (file)->data, &size);
if (contents == NULL)
{
image_error ("Error reading `%s'", file, Qnil);
--- 11272,11278 ----
return 0;
}
! contents = slurp_file (SDATA (file), &size);
if (contents == NULL)
{
image_error ("Error reading `%s'", file, Qnil);
***************
*** 11287,11294 ****
{
Lisp_Object data;
data = image_spec_value (img->spec, QCdata, NULL);
! p = XSTRING (data)->data;
! end = p + STRING_BYTES (XSTRING (data));
}
/* Check magic number. */
--- 11287,11294 ----
{
Lisp_Object data;
data = image_spec_value (img->spec, QCdata, NULL);
! p = SDATA (data);
! end = p + SBYTES (data);
}
/* Check magic number. */
***************
*** 11644,11650 ****
}
/* Open the image file. */
! fp = fopen (XSTRING (file)->data, "rb");
if (!fp)
{
image_error ("Cannot open image file `%s'", file, Qnil);
--- 11644,11650 ----
}
/* Open the image file. */
! fp = fopen (SDATA (file), "rb");
if (!fp)
{
image_error ("Cannot open image file `%s'", file, Qnil);
***************
*** 11666,11673 ****
else
{
/* Read from memory. */
! tbr.bytes = XSTRING (specified_data)->data;
! tbr.len = STRING_BYTES (XSTRING (specified_data));
tbr.index = 0;
/* Check PNG signature. */
--- 11666,11673 ----
else
{
/* Read from memory. */
! tbr.bytes = SDATA (specified_data);
! tbr.len = SBYTES (specified_data);
tbr.index = 0;
/* Check PNG signature. */
***************
*** 11793,11799 ****
/* The user specified `:background', use that. */
{
COLORREF color;
! if (w32_defined_color (f, XSTRING (specified_bg)->data, &color, 0))
{
png_color_16 user_bg;
--- 11793,11799 ----
/* The user specified `:background', use that. */
{
COLORREF color;
! if (w32_defined_color (f, SDATA (specified_bg), &color, 0))
{
png_color_16 user_bg;
***************
*** 12213,12219 ****
return 0;
}
! fp = fopen (XSTRING (file)->data, "r");
if (fp == NULL)
{
image_error ("Cannot open `%s'", file, Qnil);
--- 12213,12219 ----
return 0;
}
! fp = fopen (SDATA (file), "r");
if (fp == NULL)
{
image_error ("Cannot open `%s'", file, Qnil);
***************
*** 12260,12267 ****
if (NILP (specified_data))
jpeg_stdio_src (&cinfo, fp);
else
! jpeg_memory_src (&cinfo, XSTRING (specified_data)->data,
! STRING_BYTES (XSTRING (specified_data)));
jpeg_read_header (&cinfo, TRUE);
--- 12260,12267 ----
if (NILP (specified_data))
jpeg_stdio_src (&cinfo, fp);
else
! jpeg_memory_src (&cinfo, SDATA (specified_data),
! SBYTES (specified_data));
jpeg_read_header (&cinfo, TRUE);
***************
*** 12604,12610 ****
}
/* Try to open the image file. */
! tiff = TIFFOpen (XSTRING (file)->data, "r");
if (tiff == NULL)
{
image_error ("Cannot open `%s'", file, Qnil);
--- 12604,12610 ----
}
/* Try to open the image file. */
! tiff = TIFFOpen (SDATA (file), "r");
if (tiff == NULL)
{
image_error ("Cannot open `%s'", file, Qnil);
***************
*** 12615,12622 ****
else
{
/* Memory source! */
! memsrc.bytes = XSTRING (specified_data)->data;
! memsrc.len = STRING_BYTES (XSTRING (specified_data));
memsrc.index = 0;
tiff = TIFFClientOpen ("memory_source", "r", &memsrc,
--- 12615,12622 ----
else
{
/* Memory source! */
! memsrc.bytes = SDATA (specified_data);
! memsrc.len = SBYTES (specified_data);
memsrc.index = 0;
tiff = TIFFClientOpen ("memory_source", "r", &memsrc,
***************
*** 12852,12858 ****
}
/* Open the GIF file. */
! gif = DGifOpenFileName (XSTRING (file)->data);
if (gif == NULL)
{
image_error ("Cannot open `%s'", file, Qnil);
--- 12852,12858 ----
}
/* Open the GIF file. */
! gif = DGifOpenFileName (SDATA (file));
if (gif == NULL)
{
image_error ("Cannot open `%s'", file, Qnil);
***************
*** 12864,12871 ****
{
/* Read from memory! */
current_gif_memory_src = &memsrc;
! memsrc.bytes = XSTRING (specified_data)->data;
! memsrc.len = STRING_BYTES (XSTRING (specified_data));
memsrc.index = 0;
gif = DGifOpen(&memsrc, gif_read_from_memory);
--- 12864,12871 ----
{
/* Read from memory! */
current_gif_memory_src = &memsrc;
! memsrc.bytes = SDATA (specified_data);
! memsrc.len = SBYTES (specified_data);
memsrc.index = 0;
gif = DGifOpen(&memsrc, gif_read_from_memory);
***************
*** 13323,13332 ****
CHECK_STRING (value);
BLOCK_INPUT;
! prop_atom = XInternAtom (FRAME_W32_DISPLAY (f), XSTRING (prop)->data,
False);
XChangeProperty (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f),
prop_atom, XA_STRING, 8, PropModeReplace,
! XSTRING (value)->data, XSTRING (value)->size);
/* Make sure the property is set when we return. */
XFlush (FRAME_W32_DISPLAY (f));
--- 13323,13332 ----
CHECK_STRING (value);
BLOCK_INPUT;
! prop_atom = XInternAtom (FRAME_W32_DISPLAY (f), SDATA (prop), False);
XChangeProperty (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f),
prop_atom, XA_STRING, 8, PropModeReplace,
! SDATA (value), SCHARS (value));
/* Make sure the property is set when we return. */
XFlush (FRAME_W32_DISPLAY (f));
***************
*** 13352,13358 ****
CHECK_STRING (prop);
BLOCK_INPUT;
! prop_atom = XInternAtom (FRAME_W32_DISPLAY (f), XSTRING (prop)->data,
False);
XDeleteProperty (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f), prop_atom);
/* Make sure the property is removed when we return. */
--- 13352,13358 ----
CHECK_STRING (prop);
BLOCK_INPUT;
! prop_atom = XInternAtom (FRAME_W32_DISPLAY (f), SDATA (prop), False);
XDeleteProperty (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f), prop_atom);
/* Make sure the property is removed when we return. */
***************
*** 13386,13392 ****
CHECK_STRING (prop);
BLOCK_INPUT;
! prop_atom = XInternAtom (FRAME_W32_DISPLAY (f), XSTRING (prop)->data,
False);
rc = XGetWindowProperty (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f),
prop_atom, 0, 0, False, XA_STRING,
&actual_type, &actual_format, &actual_size,
--- 13386,13392 ----
CHECK_STRING (prop);
BLOCK_INPUT;
! prop_atom = XInternAtom (FRAME_W32_DISPLAY (f), SDATA (prop), False);
rc = XGetWindowProperty (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f),
prop_atom, 0, 0, False, XA_STRING,
&actual_type, &actual_format, &actual_size,
***************
*** 13753,13761 ****
{
tem = Fquery_fontset (font, Qnil);
if (STRINGP (tem))
! font = x_new_fontset (f, XSTRING (tem)->data);
else
! font = x_new_font (f, XSTRING (font)->data);
}
/* Try out a font which we hope has bold and italic variations. */
--- 13753,13761 ----
{
tem = Fquery_fontset (font, Qnil);
if (STRINGP (tem))
! font = x_new_fontset (f, SDATA (tem));
else
! font = x_new_font (f, SDATA (font));
}
/* Try out a font which we hope has bold and italic variations. */
***************
*** 14313,14326 ****
/* Create the dialog with PROMPT as title, using DIR as initial
directory and using "*" as pattern. */
dir = Fexpand_file_name (dir, Qnil);
! strncpy (init_dir, XSTRING (dir)->data, MAX_PATH);
init_dir[MAX_PATH] = '\0';
unixtodos_filename (init_dir);
if (STRINGP (default_filename))
{
char *file_name_only;
! char *full_path_name = XSTRING (default_filename)->data;
unixtodos_filename (full_path_name);
--- 14313,14326 ----
/* Create the dialog with PROMPT as title, using DIR as initial
directory and using "*" as pattern. */
dir = Fexpand_file_name (dir, Qnil);
! strncpy (init_dir, SDATA (dir), MAX_PATH);
init_dir[MAX_PATH] = '\0';
unixtodos_filename (init_dir);
if (STRINGP (default_filename))
{
char *file_name_only;
! char *full_path_name = SDATA (default_filename);
unixtodos_filename (full_path_name);
***************
*** 14354,14360 ****
file_details.lpstrFile = filename;
file_details.nMaxFile = sizeof (filename);
file_details.lpstrInitialDir = init_dir;
! file_details.lpstrTitle = XSTRING (prompt)->data;
file_details.Flags = (OFN_HIDEREADONLY | OFN_NOCHANGEDIR
| OFN_EXPLORER | OFN_ENABLEHOOK);
if (!NILP (mustmatch))
--- 14354,14360 ----
file_details.lpstrFile = filename;
file_details.nMaxFile = sizeof (filename);
file_details.lpstrInitialDir = init_dir;
! file_details.lpstrTitle = SDATA (prompt);
file_details.Flags = (OFN_HIDEREADONLY | OFN_NOCHANGEDIR
| OFN_EXPLORER | OFN_ENABLEHOOK);
if (!NILP (mustmatch))
***************
*** 14507,14517 ****
document = ENCODE_FILE (document);
if ((int) ShellExecute (NULL,
(STRINGP (operation) ?
! XSTRING (operation)->data : NULL),
! XSTRING (document)->data,
(STRINGP (parameters) ?
! XSTRING (parameters)->data : NULL),
! XSTRING (current_dir)->data,
(INTEGERP (show_flag) ?
XINT (show_flag) : SW_SHOWDEFAULT))
> 32)
--- 14507,14517 ----
document = ENCODE_FILE (document);
if ((int) ShellExecute (NULL,
(STRINGP (operation) ?
! SDATA (operation) : NULL),
! SDATA (document),
(STRINGP (parameters) ?
! SDATA (parameters) : NULL),
! SDATA (current_dir),
(INTEGERP (show_flag) ?
XINT (show_flag) : SW_SHOWDEFAULT))
> 32)
***************
*** 14573,14579 ****
c = Fcar (c);
if (!SYMBOLP (c))
abort ();
! vk_code = lookup_vk_code (XSTRING (SYMBOL_NAME (c))->data);
}
else if (INTEGERP (c))
{
--- 14573,14579 ----
c = Fcar (c);
if (!SYMBOLP (c))
abort ();
! vk_code = lookup_vk_code (SDATA (SYMBOL_NAME (c)));
}
else if (INTEGERP (c))
{
***************
*** 14777,14783 ****
/* On Windows, we may need to specify the root directory of the
volume holding FILENAME. */
char rootname[MAX_PATH];
! char *name = XSTRING (encoded)->data;
/* find the root name of the volume if given */
if (isalpha (name[0]) && name[1] == ':')
--- 14777,14783 ----
/* On Windows, we may need to specify the root directory of the
volume holding FILENAME. */
char rootname[MAX_PATH];
! char *name = SDATA (encoded);
/* find the root name of the volume if given */
if (isalpha (name[0]) && name[1] == ':')