diff options
| author | Ken Raeburn | 2002-07-15 00:01:34 +0000 |
|---|---|---|
| committer | Ken Raeburn | 2002-07-15 00:01:34 +0000 |
| commit | d5db40779d7505244d37476b4f046641f07eea2b (patch) | |
| tree | 5c8bf4dad41639287e722cb7cbdc0709e47a9e53 /src/macfns.c | |
| parent | 491c2516d32fa8b9ba9422ec142c8925dd82af00 (diff) | |
| download | emacs-d5db40779d7505244d37476b4f046641f07eea2b.tar.gz emacs-d5db40779d7505244d37476b4f046641f07eea2b.zip | |
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
SCHARS, SBYTES, STRING_INTERVALS, SREF, SDATA; explicit size_byte references
left unchanged for now.
Diffstat (limited to 'src/macfns.c')
| -rw-r--r-- | src/macfns.c | 192 |
1 files changed, 96 insertions, 96 deletions
diff --git a/src/macfns.c b/src/macfns.c index 9a9baed37a5..04cedba11dc 100644 --- a/src/macfns.c +++ b/src/macfns.c | |||
| @@ -534,7 +534,7 @@ x_create_bitmap_from_file (f, file) | |||
| 534 | { | 534 | { |
| 535 | if (dpyinfo->bitmaps[id].refcount | 535 | if (dpyinfo->bitmaps[id].refcount |
| 536 | && dpyinfo->bitmaps[id].file | 536 | && dpyinfo->bitmaps[id].file |
| 537 | && !strcmp (dpyinfo->bitmaps[id].file, (char *) XSTRING (file)->data)) | 537 | && !strcmp (dpyinfo->bitmaps[id].file, (char *) SDATA (file))) |
| 538 | { | 538 | { |
| 539 | ++dpyinfo->bitmaps[id].refcount; | 539 | ++dpyinfo->bitmaps[id].refcount; |
| 540 | return id + 1; | 540 | return id + 1; |
| @@ -550,7 +550,7 @@ x_create_bitmap_from_file (f, file) | |||
| 550 | return -1; | 550 | return -1; |
| 551 | emacs_close (fd); | 551 | emacs_close (fd); |
| 552 | 552 | ||
| 553 | filename = (char *) XSTRING (found)->data; | 553 | filename = (char *) SDATA (found); |
| 554 | 554 | ||
| 555 | hinst = LoadLibraryEx (filename, NULL, LOAD_LIBRARY_AS_DATAFILE); | 555 | hinst = LoadLibraryEx (filename, NULL, LOAD_LIBRARY_AS_DATAFILE); |
| 556 | 556 | ||
| @@ -566,11 +566,11 @@ x_create_bitmap_from_file (f, file) | |||
| 566 | id = x_allocate_bitmap_record (f); | 566 | id = x_allocate_bitmap_record (f); |
| 567 | dpyinfo->bitmaps[id - 1].pixmap = bitmap; | 567 | dpyinfo->bitmaps[id - 1].pixmap = bitmap; |
| 568 | dpyinfo->bitmaps[id - 1].refcount = 1; | 568 | dpyinfo->bitmaps[id - 1].refcount = 1; |
| 569 | dpyinfo->bitmaps[id - 1].file = (char *) xmalloc (XSTRING (file)->size + 1); | 569 | dpyinfo->bitmaps[id - 1].file = (char *) xmalloc (SCHARS (file) + 1); |
| 570 | dpyinfo->bitmaps[id - 1].depth = 1; | 570 | dpyinfo->bitmaps[id - 1].depth = 1; |
| 571 | dpyinfo->bitmaps[id - 1].height = height; | 571 | dpyinfo->bitmaps[id - 1].height = height; |
| 572 | dpyinfo->bitmaps[id - 1].width = width; | 572 | dpyinfo->bitmaps[id - 1].width = width; |
| 573 | strcpy (dpyinfo->bitmaps[id - 1].file, XSTRING (file)->data); | 573 | strcpy (dpyinfo->bitmaps[id - 1].file, SDATA (file)); |
| 574 | 574 | ||
| 575 | return id; | 575 | return id; |
| 576 | #endif /* MAC_TODO */ | 576 | #endif /* MAC_TODO */ |
| @@ -2067,9 +2067,9 @@ x_decode_color (f, arg, def) | |||
| 2067 | 2067 | ||
| 2068 | CHECK_STRING (arg); | 2068 | CHECK_STRING (arg); |
| 2069 | 2069 | ||
| 2070 | if (strcmp (XSTRING (arg)->data, "black") == 0) | 2070 | if (strcmp (SDATA (arg), "black") == 0) |
| 2071 | return BLACK_PIX_DEFAULT (f); | 2071 | return BLACK_PIX_DEFAULT (f); |
| 2072 | else if (strcmp (XSTRING (arg)->data, "white") == 0) | 2072 | else if (strcmp (SDATA (arg), "white") == 0) |
| 2073 | return WHITE_PIX_DEFAULT (f); | 2073 | return WHITE_PIX_DEFAULT (f); |
| 2074 | 2074 | ||
| 2075 | #if 0 | 2075 | #if 0 |
| @@ -2078,7 +2078,7 @@ x_decode_color (f, arg, def) | |||
| 2078 | return def; | 2078 | return def; |
| 2079 | #endif | 2079 | #endif |
| 2080 | 2080 | ||
| 2081 | if (mac_defined_color (f, XSTRING (arg)->data, &cdef, 1)) | 2081 | if (mac_defined_color (f, SDATA (arg), &cdef, 1)) |
| 2082 | return cdef.pixel; | 2082 | return cdef.pixel; |
| 2083 | 2083 | ||
| 2084 | /* defined_color failed; return an ultimate default. */ | 2084 | /* defined_color failed; return an ultimate default. */ |
| @@ -2509,11 +2509,11 @@ x_set_icon_name (f, arg, oldval) | |||
| 2509 | BLOCK_INPUT; | 2509 | BLOCK_INPUT; |
| 2510 | 2510 | ||
| 2511 | result = x_text_icon (f, | 2511 | result = x_text_icon (f, |
| 2512 | (char *) XSTRING ((!NILP (f->icon_name) | 2512 | (char *) SDATA ((!NILP (f->icon_name) |
| 2513 | ? f->icon_name | 2513 | ? f->icon_name |
| 2514 | : !NILP (f->title) | 2514 | : !NILP (f->title) |
| 2515 | ? f->title | 2515 | ? f->title |
| 2516 | : f->name))->data); | 2516 | : f->name))); |
| 2517 | 2517 | ||
| 2518 | if (result) | 2518 | if (result) |
| 2519 | { | 2519 | { |
| @@ -2555,12 +2555,12 @@ x_set_font (f, arg, oldval) | |||
| 2555 | 2555 | ||
| 2556 | BLOCK_INPUT; | 2556 | BLOCK_INPUT; |
| 2557 | result = (STRINGP (fontset_name) | 2557 | result = (STRINGP (fontset_name) |
| 2558 | ? x_new_fontset (f, XSTRING (fontset_name)->data) | 2558 | ? x_new_fontset (f, SDATA (fontset_name)) |
| 2559 | : x_new_font (f, XSTRING (arg)->data)); | 2559 | : x_new_font (f, SDATA (arg))); |
| 2560 | UNBLOCK_INPUT; | 2560 | UNBLOCK_INPUT; |
| 2561 | 2561 | ||
| 2562 | if (EQ (result, Qnil)) | 2562 | if (EQ (result, Qnil)) |
| 2563 | error ("Font `%s' is not defined", XSTRING (arg)->data); | 2563 | error ("Font `%s' is not defined", SDATA (arg)); |
| 2564 | else if (EQ (result, Qt)) | 2564 | else if (EQ (result, Qt)) |
| 2565 | error ("The characters of the given font have varying widths"); | 2565 | error ("The characters of the given font have varying widths"); |
| 2566 | else if (STRINGP (result)) | 2566 | else if (STRINGP (result)) |
| @@ -2836,7 +2836,7 @@ x_set_name (f, name, explicit) | |||
| 2836 | /* Check for no change needed in this very common case | 2836 | /* Check for no change needed in this very common case |
| 2837 | before we do any consing. */ | 2837 | before we do any consing. */ |
| 2838 | if (!strcmp (FRAME_MAC_DISPLAY_INFO (f)->mac_id_name, | 2838 | if (!strcmp (FRAME_MAC_DISPLAY_INFO (f)->mac_id_name, |
| 2839 | XSTRING (f->name)->data)) | 2839 | SDATA (f->name))) |
| 2840 | return; | 2840 | return; |
| 2841 | name = build_string (FRAME_MAC_DISPLAY_INFO (f)->mac_id_name); | 2841 | name = build_string (FRAME_MAC_DISPLAY_INFO (f)->mac_id_name); |
| 2842 | } | 2842 | } |
| @@ -2867,9 +2867,9 @@ x_set_name (f, name, explicit) | |||
| 2867 | 2867 | ||
| 2868 | { | 2868 | { |
| 2869 | Str255 windowTitle; | 2869 | Str255 windowTitle; |
| 2870 | if (strlen (XSTRING (name)->data) < 255) | 2870 | if (strlen (SDATA (name)) < 255) |
| 2871 | { | 2871 | { |
| 2872 | strcpy (windowTitle, XSTRING (name)->data); | 2872 | strcpy (windowTitle, SDATA (name)); |
| 2873 | c2pstr (windowTitle); | 2873 | c2pstr (windowTitle); |
| 2874 | SetWTitle (FRAME_MAC_WINDOW (f), windowTitle); | 2874 | SetWTitle (FRAME_MAC_WINDOW (f), windowTitle); |
| 2875 | } | 2875 | } |
| @@ -2941,9 +2941,9 @@ x_set_title (f, name, old_name) | |||
| 2941 | 2941 | ||
| 2942 | { | 2942 | { |
| 2943 | Str255 windowTitle; | 2943 | Str255 windowTitle; |
| 2944 | if (strlen (XSTRING (name)->data) < 255) | 2944 | if (strlen (SDATA (name)) < 255) |
| 2945 | { | 2945 | { |
| 2946 | strcpy (windowTitle, XSTRING (name)->data); | 2946 | strcpy (windowTitle, SDATA (name)); |
| 2947 | c2pstr (windowTitle); | 2947 | c2pstr (windowTitle); |
| 2948 | SetWTitle (FRAME_MAC_WINDOW (f), windowTitle); | 2948 | SetWTitle (FRAME_MAC_WINDOW (f), windowTitle); |
| 2949 | } | 2949 | } |
| @@ -3067,10 +3067,10 @@ validate_x_resource_name () | |||
| 3067 | 3067 | ||
| 3068 | if (STRINGP (Vx_resource_name)) | 3068 | if (STRINGP (Vx_resource_name)) |
| 3069 | { | 3069 | { |
| 3070 | unsigned char *p = XSTRING (Vx_resource_name)->data; | 3070 | unsigned char *p = SDATA (Vx_resource_name); |
| 3071 | int i; | 3071 | int i; |
| 3072 | 3072 | ||
| 3073 | len = STRING_BYTES (XSTRING (Vx_resource_name)); | 3073 | len = SBYTES (Vx_resource_name); |
| 3074 | 3074 | ||
| 3075 | /* Only letters, digits, - and _ are valid in resource names. | 3075 | /* Only letters, digits, - and _ are valid in resource names. |
| 3076 | Count the valid characters and count the invalid ones. */ | 3076 | Count the valid characters and count the invalid ones. */ |
| @@ -3109,12 +3109,12 @@ validate_x_resource_name () | |||
| 3109 | 3109 | ||
| 3110 | for (i = 0; i < len; i++) | 3110 | for (i = 0; i < len; i++) |
| 3111 | { | 3111 | { |
| 3112 | int c = XSTRING (new)->data[i]; | 3112 | int c = SREF (new, i); |
| 3113 | if (! ((c >= 'a' && c <= 'z') | 3113 | if (! ((c >= 'a' && c <= 'z') |
| 3114 | || (c >= 'A' && c <= 'Z') | 3114 | || (c >= 'A' && c <= 'Z') |
| 3115 | || (c >= '0' && c <= '9') | 3115 | || (c >= '0' && c <= '9') |
| 3116 | || c == '-' || c == '_')) | 3116 | || c == '-' || c == '_')) |
| 3117 | XSTRING (new)->data[i] = '_'; | 3117 | SREF (new, i) = '_'; |
| 3118 | } | 3118 | } |
| 3119 | } | 3119 | } |
| 3120 | 3120 | ||
| @@ -3153,37 +3153,37 @@ and the class is `Emacs.CLASS.SUBCLASS'. */) | |||
| 3153 | 3153 | ||
| 3154 | /* Allocate space for the components, the dots which separate them, | 3154 | /* Allocate space for the components, the dots which separate them, |
| 3155 | and the final '\0'. Make them big enough for the worst case. */ | 3155 | and the final '\0'. Make them big enough for the worst case. */ |
| 3156 | name_key = (char *) alloca (STRING_BYTES (XSTRING (Vx_resource_name)) | 3156 | name_key = (char *) alloca (SBYTES (Vx_resource_name) |
| 3157 | + (STRINGP (component) | 3157 | + (STRINGP (component) |
| 3158 | ? STRING_BYTES (XSTRING (component)) : 0) | 3158 | ? SBYTES (component) : 0) |
| 3159 | + STRING_BYTES (XSTRING (attribute)) | 3159 | + SBYTES (attribute) |
| 3160 | + 3); | 3160 | + 3); |
| 3161 | 3161 | ||
| 3162 | class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1) | 3162 | class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1) |
| 3163 | + STRING_BYTES (XSTRING (class)) | 3163 | + SBYTES (class) |
| 3164 | + (STRINGP (subclass) | 3164 | + (STRINGP (subclass) |
| 3165 | ? STRING_BYTES (XSTRING (subclass)) : 0) | 3165 | ? SBYTES (subclass) : 0) |
| 3166 | + 3); | 3166 | + 3); |
| 3167 | 3167 | ||
| 3168 | /* Start with emacs.FRAMENAME for the name (the specific one) | 3168 | /* Start with emacs.FRAMENAME for the name (the specific one) |
| 3169 | and with `Emacs' for the class key (the general one). */ | 3169 | and with `Emacs' for the class key (the general one). */ |
| 3170 | strcpy (name_key, XSTRING (Vx_resource_name)->data); | 3170 | strcpy (name_key, SDATA (Vx_resource_name)); |
| 3171 | strcpy (class_key, EMACS_CLASS); | 3171 | strcpy (class_key, EMACS_CLASS); |
| 3172 | 3172 | ||
| 3173 | strcat (class_key, "."); | 3173 | strcat (class_key, "."); |
| 3174 | strcat (class_key, XSTRING (class)->data); | 3174 | strcat (class_key, SDATA (class)); |
| 3175 | 3175 | ||
| 3176 | if (!NILP (component)) | 3176 | if (!NILP (component)) |
| 3177 | { | 3177 | { |
| 3178 | strcat (class_key, "."); | 3178 | strcat (class_key, "."); |
| 3179 | strcat (class_key, XSTRING (subclass)->data); | 3179 | strcat (class_key, SDATA (subclass)); |
| 3180 | 3180 | ||
| 3181 | strcat (name_key, "."); | 3181 | strcat (name_key, "."); |
| 3182 | strcat (name_key, XSTRING (component)->data); | 3182 | strcat (name_key, SDATA (component)); |
| 3183 | } | 3183 | } |
| 3184 | 3184 | ||
| 3185 | strcat (name_key, "."); | 3185 | strcat (name_key, "."); |
| 3186 | strcat (name_key, XSTRING (attribute)->data); | 3186 | strcat (name_key, SDATA (attribute)); |
| 3187 | 3187 | ||
| 3188 | value = x_get_string_resource (Qnil, | 3188 | value = x_get_string_resource (Qnil, |
| 3189 | name_key, class_key); | 3189 | name_key, class_key); |
| @@ -3206,13 +3206,13 @@ x_get_resource_string (attribute, class) | |||
| 3206 | 3206 | ||
| 3207 | /* Allocate space for the components, the dots which separate them, | 3207 | /* Allocate space for the components, the dots which separate them, |
| 3208 | and the final '\0'. */ | 3208 | and the final '\0'. */ |
| 3209 | name_key = (char *) alloca (STRING_BYTES (XSTRING (Vinvocation_name)) | 3209 | name_key = (char *) alloca (SBYTES (Vinvocation_name) |
| 3210 | + strlen (attribute) + 2); | 3210 | + strlen (attribute) + 2); |
| 3211 | class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1) | 3211 | class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1) |
| 3212 | + strlen (class) + 2); | 3212 | + strlen (class) + 2); |
| 3213 | 3213 | ||
| 3214 | sprintf (name_key, "%s.%s", | 3214 | sprintf (name_key, "%s.%s", |
| 3215 | XSTRING (Vinvocation_name)->data, | 3215 | SDATA (Vinvocation_name), |
| 3216 | attribute); | 3216 | attribute); |
| 3217 | sprintf (class_key, "%s.%s", EMACS_CLASS, class); | 3217 | sprintf (class_key, "%s.%s", EMACS_CLASS, class); |
| 3218 | 3218 | ||
| @@ -3269,15 +3269,15 @@ mac_get_arg (alist, param, attribute, class, type) | |||
| 3269 | switch (type) | 3269 | switch (type) |
| 3270 | { | 3270 | { |
| 3271 | case RES_TYPE_NUMBER: | 3271 | case RES_TYPE_NUMBER: |
| 3272 | return make_number (atoi (XSTRING (tem)->data)); | 3272 | return make_number (atoi (SDATA (tem))); |
| 3273 | 3273 | ||
| 3274 | case RES_TYPE_FLOAT: | 3274 | case RES_TYPE_FLOAT: |
| 3275 | return make_float (atof (XSTRING (tem)->data)); | 3275 | return make_float (atof (SDATA (tem))); |
| 3276 | 3276 | ||
| 3277 | case RES_TYPE_BOOLEAN: | 3277 | case RES_TYPE_BOOLEAN: |
| 3278 | tem = Fdowncase (tem); | 3278 | tem = Fdowncase (tem); |
| 3279 | if (!strcmp (XSTRING (tem)->data, "on") | 3279 | if (!strcmp (SDATA (tem), "on") |
| 3280 | || !strcmp (XSTRING (tem)->data, "true")) | 3280 | || !strcmp (SDATA (tem), "true")) |
| 3281 | return Qt; | 3281 | return Qt; |
| 3282 | else | 3282 | else |
| 3283 | return Qnil; | 3283 | return Qnil; |
| @@ -3291,11 +3291,11 @@ mac_get_arg (alist, param, attribute, class, type) | |||
| 3291 | { | 3291 | { |
| 3292 | Lisp_Object lower; | 3292 | Lisp_Object lower; |
| 3293 | lower = Fdowncase (tem); | 3293 | lower = Fdowncase (tem); |
| 3294 | if (!strcmp (XSTRING (lower)->data, "on") | 3294 | if (!strcmp (SDATA (lower), "on") |
| 3295 | || !strcmp (XSTRING (lower)->data, "true")) | 3295 | || !strcmp (SDATA (lower), "true")) |
| 3296 | return Qt; | 3296 | return Qt; |
| 3297 | else if (!strcmp (XSTRING (lower)->data, "off") | 3297 | else if (!strcmp (SDATA (lower), "off") |
| 3298 | || !strcmp (XSTRING (lower)->data, "false")) | 3298 | || !strcmp (SDATA (lower), "false")) |
| 3299 | return Qnil; | 3299 | return Qnil; |
| 3300 | else | 3300 | else |
| 3301 | return Fintern (tem, Qnil); | 3301 | return Fintern (tem, Qnil); |
| @@ -3490,7 +3490,7 @@ or a list (- N) meaning -N pixels relative to bottom/right corner. */) | |||
| 3490 | 3490 | ||
| 3491 | CHECK_STRING (string); | 3491 | CHECK_STRING (string); |
| 3492 | 3492 | ||
| 3493 | geometry = XParseGeometry ((char *) XSTRING (string)->data, | 3493 | geometry = XParseGeometry ((char *) SDATA (string), |
| 3494 | &x, &y, &width, &height); | 3494 | &x, &y, &width, &height); |
| 3495 | 3495 | ||
| 3496 | result = Qnil; | 3496 | result = Qnil; |
| @@ -3678,7 +3678,7 @@ mac_window (f, window_prompting, minibuffer_only) | |||
| 3678 | Elsewhere we specify the window name for the window manager. */ | 3678 | Elsewhere we specify the window name for the window manager. */ |
| 3679 | 3679 | ||
| 3680 | { | 3680 | { |
| 3681 | char *str = (char *) XSTRING (Vx_resource_name)->data; | 3681 | char *str = (char *) SDATA (Vx_resource_name); |
| 3682 | f->namebuf = (char *) xmalloc (strlen (str) + 1); | 3682 | f->namebuf = (char *) xmalloc (strlen (str) + 1); |
| 3683 | strcpy (f->namebuf, str); | 3683 | strcpy (f->namebuf, str); |
| 3684 | } | 3684 | } |
| @@ -3752,9 +3752,9 @@ x_icon (f, parms) | |||
| 3752 | ? IconicState | 3752 | ? IconicState |
| 3753 | : NormalState)); | 3753 | : NormalState)); |
| 3754 | 3754 | ||
| 3755 | x_text_icon (f, (char *) XSTRING ((!NILP (f->icon_name) | 3755 | x_text_icon (f, (char *) SDATA ((!NILP (f->icon_name) |
| 3756 | ? f->icon_name | 3756 | ? f->icon_name |
| 3757 | : f->name))->data); | 3757 | : f->name))); |
| 3758 | #endif | 3758 | #endif |
| 3759 | 3759 | ||
| 3760 | UNBLOCK_INPUT; | 3760 | UNBLOCK_INPUT; |
| @@ -3964,9 +3964,9 @@ This function is an internal primitive--use `make-frame' instead. */) | |||
| 3964 | { | 3964 | { |
| 3965 | tem = Fquery_fontset (font, Qnil); | 3965 | tem = Fquery_fontset (font, Qnil); |
| 3966 | if (STRINGP (tem)) | 3966 | if (STRINGP (tem)) |
| 3967 | font = x_new_fontset (f, XSTRING (tem)->data); | 3967 | font = x_new_fontset (f, SDATA (tem)); |
| 3968 | else | 3968 | else |
| 3969 | font = x_new_font (f, XSTRING (font)->data); | 3969 | font = x_new_font (f, SDATA (font)); |
| 3970 | } | 3970 | } |
| 3971 | /* Try out a font which we hope has bold and italic variations. */ | 3971 | /* Try out a font which we hope has bold and italic variations. */ |
| 3972 | if (! STRINGP (font)) | 3972 | if (! STRINGP (font)) |
| @@ -4178,7 +4178,7 @@ DEFUN ("xw-color-defined-p", Fxw_color_defined_p, Sxw_color_defined_p, 1, 2, 0, | |||
| 4178 | 4178 | ||
| 4179 | CHECK_STRING (color); | 4179 | CHECK_STRING (color); |
| 4180 | 4180 | ||
| 4181 | if (mac_defined_color (f, XSTRING (color)->data, &foo, 0)) | 4181 | if (mac_defined_color (f, SDATA (color), &foo, 0)) |
| 4182 | return Qt; | 4182 | return Qt; |
| 4183 | else | 4183 | else |
| 4184 | return Qnil; | 4184 | return Qnil; |
| @@ -4194,7 +4194,7 @@ DEFUN ("xw-color-values", Fxw_color_values, Sxw_color_values, 1, 2, 0, | |||
| 4194 | 4194 | ||
| 4195 | CHECK_STRING (color); | 4195 | CHECK_STRING (color); |
| 4196 | 4196 | ||
| 4197 | if (mac_defined_color (f, XSTRING (color)->data, &foo, 0)) | 4197 | if (mac_defined_color (f, SDATA (color), &foo, 0)) |
| 4198 | { | 4198 | { |
| 4199 | Lisp_Object rgb[3]; | 4199 | Lisp_Object rgb[3]; |
| 4200 | 4200 | ||
| @@ -4515,10 +4515,10 @@ x_display_info_for_name (name) | |||
| 4515 | validate_x_resource_name (); | 4515 | validate_x_resource_name (); |
| 4516 | 4516 | ||
| 4517 | dpyinfo = mac_term_init (name, (unsigned char *) 0, | 4517 | dpyinfo = mac_term_init (name, (unsigned char *) 0, |
| 4518 | (char *) XSTRING (Vx_resource_name)->data); | 4518 | (char *) SDATA (Vx_resource_name)); |
| 4519 | 4519 | ||
| 4520 | if (dpyinfo == 0) | 4520 | if (dpyinfo == 0) |
| 4521 | error ("Cannot connect to server %s", XSTRING (name)->data); | 4521 | error ("Cannot connect to server %s", SDATA (name)); |
| 4522 | 4522 | ||
| 4523 | mac_in_use = 1; | 4523 | mac_in_use = 1; |
| 4524 | XSETFASTINT (Vwindow_system_version, 3); | 4524 | XSETFASTINT (Vwindow_system_version, 3); |
| @@ -4548,7 +4548,7 @@ terminate Emacs if we can't open the connection. */) | |||
| 4548 | error ("Not using Mac OS"); | 4548 | error ("Not using Mac OS"); |
| 4549 | 4549 | ||
| 4550 | if (! NILP (xrm_string)) | 4550 | if (! NILP (xrm_string)) |
| 4551 | xrm_option = (unsigned char *) XSTRING (xrm_string)->data; | 4551 | xrm_option = (unsigned char *) SDATA (xrm_string); |
| 4552 | else | 4552 | else |
| 4553 | xrm_option = (unsigned char *) 0; | 4553 | xrm_option = (unsigned char *) 0; |
| 4554 | 4554 | ||
| @@ -4557,15 +4557,15 @@ terminate Emacs if we can't open the connection. */) | |||
| 4557 | /* This is what opens the connection and sets x_current_display. | 4557 | /* This is what opens the connection and sets x_current_display. |
| 4558 | This also initializes many symbols, such as those used for input. */ | 4558 | This also initializes many symbols, such as those used for input. */ |
| 4559 | dpyinfo = mac_term_init (display, xrm_option, | 4559 | dpyinfo = mac_term_init (display, xrm_option, |
| 4560 | (char *) XSTRING (Vx_resource_name)->data); | 4560 | (char *) SDATA (Vx_resource_name)); |
| 4561 | 4561 | ||
| 4562 | if (dpyinfo == 0) | 4562 | if (dpyinfo == 0) |
| 4563 | { | 4563 | { |
| 4564 | if (!NILP (must_succeed)) | 4564 | if (!NILP (must_succeed)) |
| 4565 | fatal ("Cannot connect to server %s.\n", | 4565 | fatal ("Cannot connect to server %s.\n", |
| 4566 | XSTRING (display)->data); | 4566 | SDATA (display)); |
| 4567 | else | 4567 | else |
| 4568 | error ("Cannot connect to server %s", XSTRING (display)->data); | 4568 | error ("Cannot connect to server %s", SDATA (display)); |
| 4569 | } | 4569 | } |
| 4570 | 4570 | ||
| 4571 | mac_in_use = 1; | 4571 | mac_in_use = 1; |
| @@ -4842,7 +4842,7 @@ parse_image_spec (spec, keywords, nkeywords, type) | |||
| 4842 | 4842 | ||
| 4843 | /* Find key in KEYWORDS. Error if not found. */ | 4843 | /* Find key in KEYWORDS. Error if not found. */ |
| 4844 | for (i = 0; i < nkeywords; ++i) | 4844 | for (i = 0; i < nkeywords; ++i) |
| 4845 | if (strcmp (keywords[i].name, XSTRING (SYMBOL_NAME (key))->data) == 0) | 4845 | if (strcmp (keywords[i].name, SDATA (SYMBOL_NAME (key))) == 0) |
| 4846 | break; | 4846 | break; |
| 4847 | 4847 | ||
| 4848 | if (i == nkeywords) | 4848 | if (i == nkeywords) |
| @@ -5152,7 +5152,7 @@ x_alloc_image_color (f, img, color_name, dflt) | |||
| 5152 | 5152 | ||
| 5153 | xassert (STRINGP (color_name)); | 5153 | xassert (STRINGP (color_name)); |
| 5154 | 5154 | ||
| 5155 | if (w32_defined_color (f, XSTRING (color_name)->data, &color, 1)) | 5155 | if (w32_defined_color (f, SDATA (color_name), &color, 1)) |
| 5156 | { | 5156 | { |
| 5157 | /* This isn't called frequently so we get away with simply | 5157 | /* This isn't called frequently so we get away with simply |
| 5158 | reallocating the color vector to the needed size, here. */ | 5158 | reallocating the color vector to the needed size, here. */ |
| @@ -5730,7 +5730,7 @@ xbm_image_p (object) | |||
| 5730 | 5730 | ||
| 5731 | if (STRINGP (elt)) | 5731 | if (STRINGP (elt)) |
| 5732 | { | 5732 | { |
| 5733 | if (XSTRING (elt)->size | 5733 | if (SCHARS (elt) |
| 5734 | < (width + BITS_PER_CHAR - 1) / BITS_PER_CHAR) | 5734 | < (width + BITS_PER_CHAR - 1) / BITS_PER_CHAR) |
| 5735 | return 0; | 5735 | return 0; |
| 5736 | } | 5736 | } |
| @@ -5745,7 +5745,7 @@ xbm_image_p (object) | |||
| 5745 | } | 5745 | } |
| 5746 | else if (STRINGP (data)) | 5746 | else if (STRINGP (data)) |
| 5747 | { | 5747 | { |
| 5748 | if (XSTRING (data)->size | 5748 | if (SCHARS (data) |
| 5749 | < (width + BITS_PER_CHAR - 1) / BITS_PER_CHAR * height) | 5749 | < (width + BITS_PER_CHAR - 1) / BITS_PER_CHAR * height) |
| 5750 | return 0; | 5750 | return 0; |
| 5751 | } | 5751 | } |
| @@ -6026,7 +6026,7 @@ xbm_load_image_from_file (f, img, specified_file) | |||
| 6026 | return 0; | 6026 | return 0; |
| 6027 | } | 6027 | } |
| 6028 | 6028 | ||
| 6029 | rc = xbm_read_bitmap_file_data (XSTRING (file)->data, &img->width, | 6029 | rc = xbm_read_bitmap_file_data (SDATA (file), &img->width, |
| 6030 | &img->height, &data); | 6030 | &img->height, &data); |
| 6031 | if (rc) | 6031 | if (rc) |
| 6032 | { | 6032 | { |
| @@ -6139,13 +6139,13 @@ xbm_load (f, img) | |||
| 6139 | { | 6139 | { |
| 6140 | Lisp_Object line = XVECTOR (data)->contents[i]; | 6140 | Lisp_Object line = XVECTOR (data)->contents[i]; |
| 6141 | if (STRINGP (line)) | 6141 | if (STRINGP (line)) |
| 6142 | bcopy (XSTRING (line)->data, p, nbytes); | 6142 | bcopy (SDATA (line), p, nbytes); |
| 6143 | else | 6143 | else |
| 6144 | bcopy (XBOOL_VECTOR (line)->data, p, nbytes); | 6144 | bcopy (XBOOL_VECTOR (line)->data, p, nbytes); |
| 6145 | } | 6145 | } |
| 6146 | } | 6146 | } |
| 6147 | else if (STRINGP (data)) | 6147 | else if (STRINGP (data)) |
| 6148 | bits = XSTRING (data)->data; | 6148 | bits = SDATA (data); |
| 6149 | else | 6149 | else |
| 6150 | bits = XBOOL_VECTOR (data)->data; | 6150 | bits = XBOOL_VECTOR (data)->data; |
| 6151 | 6151 | ||
| @@ -6337,10 +6337,10 @@ xpm_load (f, img) | |||
| 6337 | { | 6337 | { |
| 6338 | Lisp_Object name = XCAR (XCAR (tail)); | 6338 | Lisp_Object name = XCAR (XCAR (tail)); |
| 6339 | Lisp_Object color = XCDR (XCAR (tail)); | 6339 | Lisp_Object color = XCDR (XCAR (tail)); |
| 6340 | xpm_syms[i].name = (char *) alloca (XSTRING (name)->size + 1); | 6340 | xpm_syms[i].name = (char *) alloca (SCHARS (name) + 1); |
| 6341 | strcpy (xpm_syms[i].name, XSTRING (name)->data); | 6341 | strcpy (xpm_syms[i].name, SDATA (name)); |
| 6342 | xpm_syms[i].value = (char *) alloca (XSTRING (color)->size + 1); | 6342 | xpm_syms[i].value = (char *) alloca (SCHARS (color) + 1); |
| 6343 | strcpy (xpm_syms[i].value, XSTRING (color)->data); | 6343 | strcpy (xpm_syms[i].value, SDATA (color)); |
| 6344 | } | 6344 | } |
| 6345 | } | 6345 | } |
| 6346 | 6346 | ||
| @@ -6359,14 +6359,14 @@ xpm_load (f, img) | |||
| 6359 | } | 6359 | } |
| 6360 | 6360 | ||
| 6361 | rc = XpmReadFileToPixmap (NULL, FRAME_W32_WINDOW (f), | 6361 | rc = XpmReadFileToPixmap (NULL, FRAME_W32_WINDOW (f), |
| 6362 | XSTRING (file)->data, &img->pixmap, &img->mask, | 6362 | SDATA (file), &img->pixmap, &img->mask, |
| 6363 | &attrs); | 6363 | &attrs); |
| 6364 | } | 6364 | } |
| 6365 | else | 6365 | else |
| 6366 | { | 6366 | { |
| 6367 | Lisp_Object buffer = image_spec_value (img->spec, QCdata, NULL); | 6367 | Lisp_Object buffer = image_spec_value (img->spec, QCdata, NULL); |
| 6368 | rc = XpmCreatePixmapFromBuffer (NULL, FRAME_W32_WINDOW (f), | 6368 | rc = XpmCreatePixmapFromBuffer (NULL, FRAME_W32_WINDOW (f), |
| 6369 | XSTRING (buffer)->data, | 6369 | SDATA (buffer), |
| 6370 | &img->pixmap, &img->mask, | 6370 | &img->pixmap, &img->mask, |
| 6371 | &attrs); | 6371 | &attrs); |
| 6372 | } | 6372 | } |
| @@ -6998,8 +6998,8 @@ pbm_read_file (file, size) | |||
| 6998 | char *buf = NULL; | 6998 | char *buf = NULL; |
| 6999 | struct stat st; | 6999 | struct stat st; |
| 7000 | 7000 | ||
| 7001 | if (stat (XSTRING (file)->data, &st) == 0 | 7001 | if (stat (SDATA (file), &st) == 0 |
| 7002 | && (fp = fopen (XSTRING (file)->data, "r")) != NULL | 7002 | && (fp = fopen (SDATA (file), "r")) != NULL |
| 7003 | && (buf = (char *) xmalloc (st.st_size), | 7003 | && (buf = (char *) xmalloc (st.st_size), |
| 7004 | fread (buf, 1, st.st_size, fp) == st.st_size)) | 7004 | fread (buf, 1, st.st_size, fp) == st.st_size)) |
| 7005 | { | 7005 | { |
| @@ -7067,8 +7067,8 @@ pbm_load (f, img) | |||
| 7067 | { | 7067 | { |
| 7068 | Lisp_Object data; | 7068 | Lisp_Object data; |
| 7069 | data = image_spec_value (img->spec, QCdata, NULL); | 7069 | data = image_spec_value (img->spec, QCdata, NULL); |
| 7070 | p = XSTRING (data)->data; | 7070 | p = SDATA (data); |
| 7071 | end = p + STRING_BYTES (XSTRING (data)); | 7071 | end = p + SBYTES (data); |
| 7072 | } | 7072 | } |
| 7073 | 7073 | ||
| 7074 | /* Check magic number. */ | 7074 | /* Check magic number. */ |
| @@ -7401,7 +7401,7 @@ png_load (f, img) | |||
| 7401 | } | 7401 | } |
| 7402 | 7402 | ||
| 7403 | /* Open the image file. */ | 7403 | /* Open the image file. */ |
| 7404 | fp = fopen (XSTRING (file)->data, "rb"); | 7404 | fp = fopen (SDATA (file), "rb"); |
| 7405 | if (!fp) | 7405 | if (!fp) |
| 7406 | { | 7406 | { |
| 7407 | image_error ("Cannot open image file `%s'", file, Qnil); | 7407 | image_error ("Cannot open image file `%s'", file, Qnil); |
| @@ -7423,8 +7423,8 @@ png_load (f, img) | |||
| 7423 | else | 7423 | else |
| 7424 | { | 7424 | { |
| 7425 | /* Read from memory. */ | 7425 | /* Read from memory. */ |
| 7426 | tbr.bytes = XSTRING (specified_data)->data; | 7426 | tbr.bytes = SDATA (specified_data); |
| 7427 | tbr.len = STRING_BYTES (XSTRING (specified_data)); | 7427 | tbr.len = SBYTES (specified_data); |
| 7428 | tbr.index = 0; | 7428 | tbr.index = 0; |
| 7429 | 7429 | ||
| 7430 | /* Check PNG signature. */ | 7430 | /* Check PNG signature. */ |
| @@ -7936,7 +7936,7 @@ jpeg_load (f, img) | |||
| 7936 | return 0; | 7936 | return 0; |
| 7937 | } | 7937 | } |
| 7938 | 7938 | ||
| 7939 | fp = fopen (XSTRING (file)->data, "r"); | 7939 | fp = fopen (SDATA (file), "r"); |
| 7940 | if (fp == NULL) | 7940 | if (fp == NULL) |
| 7941 | { | 7941 | { |
| 7942 | image_error ("Cannot open `%s'", file, Qnil); | 7942 | image_error ("Cannot open `%s'", file, Qnil); |
| @@ -7986,8 +7986,8 @@ jpeg_load (f, img) | |||
| 7986 | if (NILP (specified_data)) | 7986 | if (NILP (specified_data)) |
| 7987 | jpeg_stdio_src (&cinfo, fp); | 7987 | jpeg_stdio_src (&cinfo, fp); |
| 7988 | else | 7988 | else |
| 7989 | jpeg_memory_src (&cinfo, XSTRING (specified_data)->data, | 7989 | jpeg_memory_src (&cinfo, SDATA (specified_data), |
| 7990 | STRING_BYTES (XSTRING (specified_data))); | 7990 | SBYTES (specified_data)); |
| 7991 | 7991 | ||
| 7992 | jpeg_read_header (&cinfo, TRUE); | 7992 | jpeg_read_header (&cinfo, TRUE); |
| 7993 | 7993 | ||
| @@ -8295,7 +8295,7 @@ tiff_load (f, img) | |||
| 8295 | } | 8295 | } |
| 8296 | 8296 | ||
| 8297 | /* Try to open the image file. */ | 8297 | /* Try to open the image file. */ |
| 8298 | tiff = TIFFOpen (XSTRING (file)->data, "r"); | 8298 | tiff = TIFFOpen (SDATA (file), "r"); |
| 8299 | if (tiff == NULL) | 8299 | if (tiff == NULL) |
| 8300 | { | 8300 | { |
| 8301 | image_error ("Cannot open `%s'", file, Qnil); | 8301 | image_error ("Cannot open `%s'", file, Qnil); |
| @@ -8306,8 +8306,8 @@ tiff_load (f, img) | |||
| 8306 | else | 8306 | else |
| 8307 | { | 8307 | { |
| 8308 | /* Memory source! */ | 8308 | /* Memory source! */ |
| 8309 | memsrc.bytes = XSTRING (specified_data)->data; | 8309 | memsrc.bytes = SDATA (specified_data); |
| 8310 | memsrc.len = STRING_BYTES (XSTRING (specified_data)); | 8310 | memsrc.len = SBYTES (specified_data); |
| 8311 | memsrc.index = 0; | 8311 | memsrc.index = 0; |
| 8312 | 8312 | ||
| 8313 | tiff = TIFFClientOpen ("memory_source", "r", &memsrc, | 8313 | tiff = TIFFClientOpen ("memory_source", "r", &memsrc, |
| @@ -8539,7 +8539,7 @@ gif_load (f, img) | |||
| 8539 | } | 8539 | } |
| 8540 | 8540 | ||
| 8541 | /* Open the GIF file. */ | 8541 | /* Open the GIF file. */ |
| 8542 | gif = DGifOpenFileName (XSTRING (file)->data); | 8542 | gif = DGifOpenFileName (SDATA (file)); |
| 8543 | if (gif == NULL) | 8543 | if (gif == NULL) |
| 8544 | { | 8544 | { |
| 8545 | image_error ("Cannot open `%s'", file, Qnil); | 8545 | image_error ("Cannot open `%s'", file, Qnil); |
| @@ -8551,8 +8551,8 @@ gif_load (f, img) | |||
| 8551 | { | 8551 | { |
| 8552 | /* Read from memory! */ | 8552 | /* Read from memory! */ |
| 8553 | current_gif_memory_src = &memsrc; | 8553 | current_gif_memory_src = &memsrc; |
| 8554 | memsrc.bytes = XSTRING (specified_data)->data; | 8554 | memsrc.bytes = SDATA (specified_data); |
| 8555 | memsrc.len = STRING_BYTES (XSTRING (specified_data)); | 8555 | memsrc.len = SBYTES (specified_data); |
| 8556 | memsrc.index = 0; | 8556 | memsrc.index = 0; |
| 8557 | 8557 | ||
| 8558 | gif = DGifOpen(&memsrc, gif_read_from_memory); | 8558 | gif = DGifOpen(&memsrc, gif_read_from_memory); |
| @@ -8999,10 +8999,10 @@ selected frame. Value is VALUE. */) | |||
| 8999 | CHECK_STRING (value); | 8999 | CHECK_STRING (value); |
| 9000 | 9000 | ||
| 9001 | BLOCK_INPUT; | 9001 | BLOCK_INPUT; |
| 9002 | prop_atom = XInternAtom (FRAME_W32_DISPLAY (f), XSTRING (prop)->data, False); | 9002 | prop_atom = XInternAtom (FRAME_W32_DISPLAY (f), SDATA (prop), False); |
| 9003 | XChangeProperty (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f), | 9003 | XChangeProperty (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f), |
| 9004 | prop_atom, XA_STRING, 8, PropModeReplace, | 9004 | prop_atom, XA_STRING, 8, PropModeReplace, |
| 9005 | XSTRING (value)->data, XSTRING (value)->size); | 9005 | SDATA (value), SCHARS (value)); |
| 9006 | 9006 | ||
| 9007 | /* Make sure the property is set when we return. */ | 9007 | /* Make sure the property is set when we return. */ |
| 9008 | XFlush (FRAME_W32_DISPLAY (f)); | 9008 | XFlush (FRAME_W32_DISPLAY (f)); |
| @@ -9028,7 +9028,7 @@ FRAME nil or omitted means use the selected frame. Value is PROP. */) | |||
| 9028 | 9028 | ||
| 9029 | CHECK_STRING (prop); | 9029 | CHECK_STRING (prop); |
| 9030 | BLOCK_INPUT; | 9030 | BLOCK_INPUT; |
| 9031 | prop_atom = XInternAtom (FRAME_W32_DISPLAY (f), XSTRING (prop)->data, False); | 9031 | prop_atom = XInternAtom (FRAME_W32_DISPLAY (f), SDATA (prop), False); |
| 9032 | XDeleteProperty (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f), prop_atom); | 9032 | XDeleteProperty (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f), prop_atom); |
| 9033 | 9033 | ||
| 9034 | /* Make sure the property is removed when we return. */ | 9034 | /* Make sure the property is removed when we return. */ |
| @@ -9062,7 +9062,7 @@ value. */) | |||
| 9062 | 9062 | ||
| 9063 | CHECK_STRING (prop); | 9063 | CHECK_STRING (prop); |
| 9064 | BLOCK_INPUT; | 9064 | BLOCK_INPUT; |
| 9065 | prop_atom = XInternAtom (FRAME_W32_DISPLAY (f), XSTRING (prop)->data, False); | 9065 | prop_atom = XInternAtom (FRAME_W32_DISPLAY (f), SDATA (prop), False); |
| 9066 | rc = XGetWindowProperty (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f), | 9066 | rc = XGetWindowProperty (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f), |
| 9067 | prop_atom, 0, 0, False, XA_STRING, | 9067 | prop_atom, 0, 0, False, XA_STRING, |
| 9068 | &actual_type, &actual_format, &actual_size, | 9068 | &actual_type, &actual_format, &actual_size, |
| @@ -9378,9 +9378,9 @@ x_create_tip_frame (dpyinfo, parms) | |||
| 9378 | { | 9378 | { |
| 9379 | tem = Fquery_fontset (font, Qnil); | 9379 | tem = Fquery_fontset (font, Qnil); |
| 9380 | if (STRINGP (tem)) | 9380 | if (STRINGP (tem)) |
| 9381 | font = x_new_fontset (f, XSTRING (tem)->data); | 9381 | font = x_new_fontset (f, SDATA (tem)); |
| 9382 | else | 9382 | else |
| 9383 | font = x_new_font (f, XSTRING (font)->data); | 9383 | font = x_new_font (f, SDATA (font)); |
| 9384 | } | 9384 | } |
| 9385 | 9385 | ||
| 9386 | /* Try out a font which we hope has bold and italic variations. */ | 9386 | /* Try out a font which we hope has bold and italic variations. */ |
| @@ -9800,14 +9800,14 @@ selection dialog's entry field, if MUSTMATCH is non-nil. */) | |||
| 9800 | /* Create the dialog with PROMPT as title, using DIR as initial | 9800 | /* Create the dialog with PROMPT as title, using DIR as initial |
| 9801 | directory and using "*" as pattern. */ | 9801 | directory and using "*" as pattern. */ |
| 9802 | dir = Fexpand_file_name (dir, Qnil); | 9802 | dir = Fexpand_file_name (dir, Qnil); |
| 9803 | strncpy (init_dir, XSTRING (dir)->data, MAX_PATH); | 9803 | strncpy (init_dir, SDATA (dir), MAX_PATH); |
| 9804 | init_dir[MAX_PATH] = '\0'; | 9804 | init_dir[MAX_PATH] = '\0'; |
| 9805 | unixtodos_filename (init_dir); | 9805 | unixtodos_filename (init_dir); |
| 9806 | 9806 | ||
| 9807 | if (STRINGP (default_filename)) | 9807 | if (STRINGP (default_filename)) |
| 9808 | { | 9808 | { |
| 9809 | char *file_name_only; | 9809 | char *file_name_only; |
| 9810 | char *full_path_name = XSTRING (default_filename)->data; | 9810 | char *full_path_name = SDATA (default_filename); |
| 9811 | 9811 | ||
| 9812 | unixtodos_filename (full_path_name); | 9812 | unixtodos_filename (full_path_name); |
| 9813 | 9813 | ||
| @@ -9846,7 +9846,7 @@ selection dialog's entry field, if MUSTMATCH is non-nil. */) | |||
| 9846 | file_details.lpstrFile = filename; | 9846 | file_details.lpstrFile = filename; |
| 9847 | file_details.nMaxFile = sizeof (filename); | 9847 | file_details.nMaxFile = sizeof (filename); |
| 9848 | file_details.lpstrInitialDir = init_dir; | 9848 | file_details.lpstrInitialDir = init_dir; |
| 9849 | file_details.lpstrTitle = XSTRING (prompt)->data; | 9849 | file_details.lpstrTitle = SDATA (prompt); |
| 9850 | file_details.Flags = OFN_HIDEREADONLY | OFN_NOCHANGEDIR; | 9850 | file_details.Flags = OFN_HIDEREADONLY | OFN_NOCHANGEDIR; |
| 9851 | 9851 | ||
| 9852 | if (!NILP (mustmatch)) | 9852 | if (!NILP (mustmatch)) |