Changeset 4074
- Timestamp:
- 05/13/06 09:57:50 (3 years ago)
- Files:
-
- trunk/src/ChangeLog.Meadow (modified) (1 diff)
- trunk/src/mw32bdf.c (modified) (1 diff)
- trunk/src/mw32clpbd.c (modified) (4 diffs)
- trunk/src/mw32dl.c (modified) (1 diff)
- trunk/src/mw32font.c (modified) (12 diffs)
- trunk/src/mw32ime.c (modified) (2 diffs)
- trunk/src/mw32menu.c (modified) (7 diffs)
- trunk/src/mw32term.c (modified) (5 diffs)
- trunk/src/w32.c (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/ChangeLog.Meadow
r4073 r4074 1 2006-05-13 MIYOSHI Masanori <miyoshi@meadowy.org> 2 3 * mw32term.c: Purge XSTRING and use SDATA, SBYTES and SCHARS 4 instead. 5 6 * mw32menu.c: Ditto. 7 8 * mw32ime.c: Ditto. 9 10 * mw32font.c: Ditto. 11 12 * mw32dl.c: Ditto. 13 14 * mw32clpbd.c: Ditto. 15 16 * mw32bdf.c: Ditto. 17 18 * w32.c (normalize_filename): Ditto. 19 Normalize coding style. 20 1 21 2006-05-03 MIYOSHI Masanori <miyoshi@meadowy.org> 2 22 trunk/src/mw32bdf.c
r4003 r4074 340 340 Lisp_Object ret = Qnil; 341 341 342 bdffontp = mw32_init_bdf_font ( XSTRING (fontfile)->data);342 bdffontp = mw32_init_bdf_font (SDATA (fontfile)); 343 343 344 344 if (!bdffontp) return Qnil; trunk/src/mw32clpbd.c
r3956 r4074 85 85 BLOCK_INPUT; 86 86 87 htextsize = decoding_buffer_size (&coding, 88 STRING_BYTES (XSTRING (string)) + 1); 87 htextsize = decoding_buffer_size (&coding, SBYTES (string) + 1); 89 88 if ((htext = GlobalAlloc (GMEM_MOVEABLE | GMEM_DDESHARE, 90 89 htextsize)) == NULL) … … 94 93 if ((hmuletext = 95 94 GlobalAlloc (GMEM_MOVEABLE | GMEM_DDESHARE, 96 MW32_MULE_CB_REQSIZE (STRING_BYTES (XSTRING (string)) 97 + 1))) 95 MW32_MULE_CB_REQSIZE (SBYTES (string) + 1))) 98 96 == NULL) 99 97 goto error; … … 101 99 goto error; 102 100 103 MW32_MULE_SET_CB (lpmulecb, XSTRING (string)->data, 104 STRING_BYTES(XSTRING (string)) + 1); 101 MW32_MULE_SET_CB (lpmulecb, SDATA (string), SBYTES (string) + 1); 105 102 GlobalUnlock (hmuletext); 106 103 } … … 108 105 goto error; 109 106 110 encode_coding (&coding, XSTRING (string)->data, lptext, 111 STRING_BYTES(XSTRING (string)), htextsize); 107 encode_coding (&coding, SDATA (string), lptext, SBYTES (string), htextsize); 112 108 size = coding.produced; 113 109 lptext[size] = '\0'; trunk/src/mw32dl.c
r4065 r4074 148 148 CHECK_STRING (filename); 149 149 150 hlib = LoadLibrary ( XSTRING (filename)->data);150 hlib = LoadLibrary (SDATA (filename)); 151 151 152 152 current_dls++; trunk/src/mw32font.c
r4065 r4074 881 881 buf = alloca (bufsize); 882 882 /* LOGFONT is NEVER accessed by lisp interpreter. */ 883 encode_coding (&coding, XSTRING (src)->data, buf,883 encode_coding (&coding, SDATA (src), buf, 884 884 LISPY_STRING_BYTES (src), bufsize); 885 885 size = coding.produced; … … 1103 1103 plf->encoding.e.ccl_method.size = size; 1104 1104 plf->encoding.e.ccl_method.data = data; 1105 memcpy (data, XSTRING (symname)->data, size);1105 memcpy (data, SDATA (symname), size); 1106 1106 1107 1107 byte = Fget (encoding, Qfont_unit_byte); … … 1234 1234 xlfd_pattern_regexp (Lisp_Object pattern) 1235 1235 { 1236 if (!index ( XSTRING (pattern)->data, '*')1237 && !index ( XSTRING (pattern)->data, '?'))1236 if (!index (SDATA (pattern), '*') 1237 && !index (SDATA (pattern), '?')) 1238 1238 /* PATTERN does not contain any wild cards. */ 1239 1239 return pattern; … … 1241 1241 { 1242 1242 /* We must at first update the cached data. */ 1243 char *regex = (char *) alloca ( XSTRING (pattern)->size* 2 + 3);1243 char *regex = (char *) alloca (SCHARS (pattern) * 2 + 3); 1244 1244 char *p0, *p1 = regex; 1245 1245 1246 1246 /* Convert "*" to ".*", "?" to ".". */ 1247 1247 *p1++ = '^'; 1248 for (p0 = (char *) XSTRING (pattern)->data; *p0; p0++)1248 for (p0 = (char *) SDATA (pattern); *p0; p0++) 1249 1249 { 1250 1250 if (*p0 == '*') … … 1674 1674 unsigned char* filename; 1675 1675 tem = XCDR (llf); 1676 filename = XSTRING (CAR (tem))->data;1676 filename = SDATA (CAR (tem)); 1677 1677 plf = mw32_add_logical_font (pfr); 1678 1678 if (!mw32_set_bdf_font (f, plf, filename)) … … 1708 1708 if (LISPY_STRING_BYTES (family_attr) != 1) return 0; 1709 1709 1710 name = XSTRING (family_attr)->data;1710 name = SDATA (family_attr); 1711 1711 if (name[0] == '*') return 1; 1712 1712 … … 2188 2188 { 2189 2189 int idx; 2190 idx = mw32_get_font_request ( XSTRING (lfont_name)->data);2190 idx = mw32_get_font_request (SDATA (lfont_name)); 2191 2191 if (idx >= 0) pfr = &mw32_fr_table[idx]; 2192 2192 else pfr = NULL; … … 2406 2406 CHECK_LIST (alist); 2407 2407 2408 if (mw32_get_font_request ( XSTRING (name)->data) >= 0)2409 error ("Already registerd %s font.", XSTRING (name)->data);2408 if (mw32_get_font_request (SDATA (name)) >= 0) 2409 error ("Already registerd %s font.", SDATA (name)); 2410 2410 2411 2411 mw32_check_font_request_alist (alist); 2412 2412 2413 mw32_internal_add_font ( XSTRING (name)->data, alist);2413 mw32_internal_add_font (SDATA (name), alist); 2414 2414 2415 2415 return Qnil; … … 2429 2429 CHECK_LIST (alist); 2430 2430 2431 idx = mw32_get_font_request ( XSTRING (name)->data);2431 idx = mw32_get_font_request (SDATA (name)); 2432 2432 if (idx < 0) 2433 error ("Font request %s is not registered.", XSTRING (name)->data);2433 error ("Font request %s is not registered.", SDATA (name)); 2434 2434 2435 2435 mw32_check_font_request_alist (alist); … … 2439 2439 pfr->loaded_LF_num = 0; 2440 2440 pfr->idx = idx; 2441 pfr->name = xstrdup ( XSTRING (name)->data);2441 pfr->name = xstrdup (SDATA (name)); 2442 2442 2443 2443 return Qnil; … … 2469 2469 CHECK_STRING (name); 2470 2470 2471 idx = mw32_get_font_request ( XSTRING (name)->data);2471 idx = mw32_get_font_request (SDATA (name)); 2472 2472 if (idx < 0) 2473 error ("Font request %s is not registered.", XSTRING (name)->data);2473 error ("Font request %s is not registered.", SDATA (name)); 2474 2474 2475 2475 return AREF (Vmw32_font_request_table, idx); … … 2640 2640 LISPY_STRING_BYTES (family) + 1); 2641 2641 buf = alloca (bufsize); 2642 encode_coding (&coding, XSTRING (family)->data, buf,2642 encode_coding (&coding, SDATA (family), buf, 2643 2643 LISPY_STRING_BYTES (family), bufsize); 2644 2644 size = coding.produced; trunk/src/mw32ime.c
r4065 r4074 1402 1402 1403 1403 MEADOW_ENCODE_ALLOC (LISPY_STRING_BYTES (object)); 1404 MEADOW_ENCODE ( XSTRING (object)->data, LISPY_STRING_BYTES (object));1404 MEADOW_ENCODE (SDATA (object), LISPY_STRING_BYTES (object)); 1405 1405 len = MEADOW_ENCODE_PRODUCED; 1406 1406 MEADOW_ENCODE_BUF[len] = '\0'; … … 1649 1649 str = XCONS (curelem)->car; 1650 1650 attr = XCONS (curelem)->u.cdr; 1651 encode_coding (&coding, XSTRING (str)->data, cs,1651 encode_coding (&coding, SDATA (str), cs, 1652 1652 LISPY_STRING_BYTES (str), size); 1653 1653 strsize = coding.produced; trunk/src/mw32menu.c
r4065 r4074 427 427 TCHAR *menu_str = 0; 428 428 429 if (NILP (name) || name_is_separator ( XSTRING (name)->data))429 if (NILP (name) || name_is_separator (SDATA (name))) 430 430 AppendMenu (hmenu, MF_SEPARATOR, menu_id, NULL); 431 431 else … … 438 438 #endif 439 439 if (STRINGP (description)) 440 desclen = strlen ( XSTRING (description)->data);440 desclen = strlen (SDATA (description)); 441 441 /* Never description set to a size entry... so use 'strlen' */ 442 442 else … … 449 449 LISPY_STRING_BYTES (name) + 1); 450 450 menu_str = alloca (decodebufsize + desclen); 451 encode_coding (&coding, XSTRING (name)->data, menu_str,451 encode_coding (&coding, SDATA (name), menu_str, 452 452 LISPY_STRING_BYTES (name), decodebufsize); 453 453 size = coding.produced; 454 454 #else 455 size = LISPY_STRING_BYTES ( XSTRING (name));455 size = LISPY_STRING_BYTES (name); 456 456 menu_str = alloca (size + desclen + 1); 457 memcpy (menu_str, XSTRING (name)->data, size);457 memcpy (menu_str, SDATA (name), size); 458 458 #endif 459 459 if (desclen) 460 memcpy (&menu_str[size], XSTRING (description)->data, desclen);460 memcpy (&menu_str[size], SDATA (description), desclen); 461 461 menu_str[size + desclen] = '\0'; 462 462 … … 1486 1486 save_wv->contents = wv; 1487 1487 1488 wv->name = (char *) XSTRING (item_name)->data;1488 wv->name = (char *) SDATA (item_name); 1489 1489 if (!NILP (descrip)) 1490 wv->key = (char *) XSTRING (descrip)->data;1490 wv->key = (char *) SDATA (descrip); 1491 1491 wv->value = 0; 1492 1492 /* The EMACS_INT cast avoids a warning. There's no problem … … 1650 1650 if (handle != INVALID_HANDLE_VALUE) 1651 1651 appendmenu_encode (first_handle, MF_POPUP | MF_STRING, 1652 (UINT) handle, XSTRING (string)->data);1652 (UINT) handle, SDATA (string)); 1653 1653 } 1654 1654 … … 1698 1698 1699 1699 nochange = (modifymenu_encode (first_handle, idx, 1700 MF_STRING, 0, 1701 XSTRING (string)->data)&& nochange);1700 MF_STRING, 0, SDATA (string)) 1701 && nochange); 1702 1702 idx++; 1703 1703 } … … 1984 1984 { 1985 1985 InsertMenu (first_handle, 0, MF_BYPOSITION | MF_SEPARATOR, 0, 0); 1986 insertmenu_encode (first_handle, 0, 1987 MF_OWNERDRAW, 0, XSTRING (title)->data); 1986 insertmenu_encode (first_handle, 0, MF_OWNERDRAW, 0, SDATA (title)); 1988 1987 } 1989 1988 trunk/src/mw32term.c
r4065 r4074 5955 5955 return fontset_name (fontset); 5956 5956 5957 result = mw32_new_font (f, ( XSTRING (fontset_ascii (fontset))->data));5957 result = mw32_new_font (f, (SDATA (fontset_ascii (fontset)))); 5958 5958 5959 5959 if (!STRINGP (result)) … … 6077 6077 for (share = x_display_list, tail = x_display_name_list; share; 6078 6078 share = share->next, tail = XCDR (tail)) 6079 if (same_x_server ( XSTRING (XCAR (XCAR (tail)))->data,6080 XSTRING (display_name)->data))6079 if (same_x_server (SDATA (XCAR (XCAR (tail))), 6080 SDATA (display_name))) 6081 6081 break; 6082 6082 if (share) … … 6118 6118 6119 6119 dpyinfo->mw32_id_name 6120 = (char *) xmalloc (S TRING_BYTES (XSTRING (Vinvocation_name))6121 + S TRING_BYTES (XSTRING (Vsystem_name))6120 = (char *) xmalloc (SBYTES (Vinvocation_name) 6121 + SBYTES (Vsystem_name) 6122 6122 + 2); 6123 6123 sprintf (dpyinfo->mw32_id_name, "%s@%s", 6124 XSTRING (Vinvocation_name)->data, XSTRING (Vsystem_name)->data);6124 SDATA (Vinvocation_name), SDATA (Vsystem_name)); 6125 6125 6126 6126 #if 0 … … 6428 6428 for (i = 0;i < 256;i++) 6429 6429 { 6430 if (lispy_function_keys[i] && 6431 (strcmp (lispy_function_keys[i], 6432 XSTRING (key)->data) == 0)) 6430 if (lispy_function_keys[i] 6431 && (strcmp (lispy_function_keys[i], SDATA (key)) == 0)) 6433 6432 { 6434 6433 virtkey = i; … … 6438 6437 6439 6438 if (virtkey == -1) 6440 error ("Can't find the key:%s", XSTRING (key)->data);6439 error ("Can't find the key:%s", SDATA (key)); 6441 6440 } 6442 6441 else trunk/src/w32.c
r4058 r4074 623 623 TCHAR next_char; 624 624 625 if (lstrlen (fp) > MAX_PATH) return; 625 if (lstrlen (fp) > MAX_PATH) 626 return; 626 627 627 628 /* Always lower-case drive letters a-z, even if the filesystem … … 640 641 if (NILP (Vw32_downcase_file_names)) 641 642 { 642 for (; *fp;fp = n_fp)643 for (; *fp; fp = n_fp) 643 644 { 644 645 n_fp = CharNext (fp); … … 653 654 654 655 element_start = fp; 655 for (pelem = path_element; *fp;)656 for (pelem = path_element; *fp;) 656 657 { 657 658 if (IS_DIRECTORY_SEP (*fp)) … … 659 660 if (element_start && (pelem > path_element)) 660 661 memcpy (element_start, path_element, 661 (pelem - path_element) * sizeof (TCHAR));662 (pelem - path_element) * sizeof (TCHAR)); 662 663 663 664 *fp = path_sep; … … 669 670 if (element_start && (pelem > path_element)) 670 671 memcpy (element_start, path_element, 671 (pelem - path_element) * sizeof (TCHAR));672 (pelem - path_element) * sizeof (TCHAR)); 672 673 673 674 pelem = path_element; … … 683 684 684 685 n_fp = CharNext (fp); 685 while (n_fp > fp) *pelem++ = *fp++; 686 while (n_fp > fp) 687 *pelem++ = *fp++; 686 688 } 687 689 } … … 912 914 q = p; 913 915 914 for(;; p = CharNext (p))915 { 916 if (!(*p) || IS_DIRECTORY_SEP (*p))916 for(;; p = CharNext (p)) 917 { 918 if (!(*p) || IS_DIRECTORY_SEP (*p)) 917 919 break; 918 920 } … … 2968 2970 WIN32_FIND_DATA w32fd; 2969 2971 2970 len = lstrlen ((LPTSTR) path);2972 len = lstrlen ((LPTSTR) path); 2971 2973 if (len > (MAX_PATH - 3)) 2972 2974 return ret; 2973 memcpy (name, path, sizeof (TCHAR) * (len + 1));2975 memcpy (name, path, sizeof (TCHAR) * (len + 1)); 2974 2976 2975 2977 unixtodos_filename (name); … … 2977 2979 prevname = CharPrev(name, &name[len]); 2978 2980 2979 if (IS_DIRECTORY_SEP (*prevname))2981 if (IS_DIRECTORY_SEP (*prevname)) 2980 2982 { 2981 2983 name[len] = '*'; … … 3004 3006 return ret; 3005 3007 3006 do { 3007 if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) 3008 num++; 3009 if (max > 0) max--; 3010 else if (max == 0) break; 3011 } while (FindNextFile (hf, &w32fd)); 3008 do 3009 { 3010 if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) 3011 num++; 3012 if (max > 0) 3013 max--; 3014 else if (max == 0) 3015 break; 3016 } while (FindNextFile (hf, &w32fd)); 3012 3017 3013 3018 FindClose (hf); … … 4669 4674 CHECK_STRING (filename); 4670 4675 4671 filetmp = (char *) alloca (S TRING_BYTES (XSTRING (filename)) + 1);4676 filetmp = (char *) alloca (SBYTES (filename) + 1); 4672 4677 if (!filetmp) 4673 4678 { 4674 4679 error ("Cannot allocate memory!."); 4675 4680 } 4676 memcpy (filetmp, XSTRING (filename)->data, 4677 STRING_BYTES (XSTRING (filename)) + 1); 4681 memcpy (filetmp, SDATA (filename), SBYTES (filename) + 1); 4678 4682 unixtodos_argument (filetmp, !NILP (ep), !NILP (h2sp), 4679 4683 !NILP (qp), !NILP (s2isp)); … … 4700 4704 Vfile_name_coding_system, Qt); 4701 4705 directory = Ffile_name_directory (fullpath); 4702 hff = FindFirstFile (XSTRING (fullpath)->data, &w32FindData); 4703 if (hff == INVALID_HANDLE_VALUE){ 4704 return Qnil; 4705 } 4706 hff = FindFirstFile (SDATA (fullpath), &w32FindData); 4707 if (hff == INVALID_HANDLE_VALUE) 4708 { 4709 return Qnil; 4710 } 4706 4711 fullpath = 4707 4712 Fexpand_file_name (Fdecode_coding_string … … 4729 4734 fullpath = Fencode_coding_string (Fexpand_file_name (lfn, Qnil), 4730 4735 Vfile_name_coding_system, Qt); 4731 len = GetShortPathName ( XSTRING (fullpath)->data, buf, MAX_PATH);4736 len = GetShortPathName (SDATA (fullpath), buf, MAX_PATH); 4732 4737 if (!len) 4733 4738 return Qnil; … … 4802 4807 Vfile_name_coding_system, 4803 4808 Qt); 4804 p = XSTRING (directory)->data;4809 p = SDATA (directory); 4805 4810 unixtodos_filename (p); 4806 4811 } … … 4808 4813 file = Fencode_coding_string (file, Vfile_name_coding_system, Qt); 4809 4814 4810 ret = (UINT) FindExecutable ( XSTRING (file)->data, p, buf);4815 ret = (UINT) FindExecutable (SDATA (file), p, buf); 4811 4816 4812 4817 if (ret == ERROR_FILE_NOT_FOUND) 4813 error ("specified file:%s is not found", XSTRING (file)->data);4818 error ("specified file:%s is not found", SDATA (file)); 4814 4819 else if (ret == ERROR_PATH_NOT_FOUND) 4815 4820 error ("specified directory is not found", directory);
