Mercurial > emacs
comparison src/mac.c @ 46370:40db0673e6f0
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.
author | Ken Raeburn <raeburn@raeburn.org> |
---|---|
date | Mon, 15 Jul 2002 00:00:41 +0000 |
parents | 7b1f766314f6 |
children | 3d4689375228 |
comparison
equal
deleted
inserted
replaced
46369:dd1d3b1d0053 | 46370:40db0673e6f0 |
---|---|
2046 openp (Vexec_path, build_string (newargv[0]), EXEC_SUFFIXES, &path, | 2046 openp (Vexec_path, build_string (newargv[0]), EXEC_SUFFIXES, &path, |
2047 make_number (X_OK)); | 2047 make_number (X_OK)); |
2048 | 2048 |
2049 if (NILP (path)) | 2049 if (NILP (path)) |
2050 return -1; | 2050 return -1; |
2051 if (posix_to_mac_pathname (XSTRING (path)->data, tempmacpathname, | 2051 if (posix_to_mac_pathname (SDATA (path), tempmacpathname, |
2052 MAXPATHLEN+1) == 0) | 2052 MAXPATHLEN+1) == 0) |
2053 return -1; | 2053 return -1; |
2054 } | 2054 } |
2055 strcpy (macappname, tempmacpathname); | 2055 strcpy (macappname, tempmacpathname); |
2056 } | 2056 } |
2527 Lisp_Object lisp_result; | 2527 Lisp_Object lisp_result; |
2528 long status; | 2528 long status; |
2529 | 2529 |
2530 CHECK_STRING (script); | 2530 CHECK_STRING (script); |
2531 | 2531 |
2532 status = do_applescript (XSTRING (script)->data, &result); | 2532 status = do_applescript (SDATA (script), &result); |
2533 if (status) | 2533 if (status) |
2534 { | 2534 { |
2535 if (!result) | 2535 if (!result) |
2536 error ("AppleScript error %d", status); | 2536 error ("AppleScript error %d", status); |
2537 else | 2537 else |
2564 { | 2564 { |
2565 char posix_filename[MAXPATHLEN+1]; | 2565 char posix_filename[MAXPATHLEN+1]; |
2566 | 2566 |
2567 CHECK_STRING (mac_filename); | 2567 CHECK_STRING (mac_filename); |
2568 | 2568 |
2569 if (mac_to_posix_pathname (XSTRING (mac_filename)->data, posix_filename, | 2569 if (mac_to_posix_pathname (SDATA (mac_filename), posix_filename, |
2570 MAXPATHLEN)) | 2570 MAXPATHLEN)) |
2571 return build_string (posix_filename); | 2571 return build_string (posix_filename); |
2572 else | 2572 else |
2573 return Qnil; | 2573 return Qnil; |
2574 } | 2574 } |
2582 { | 2582 { |
2583 char mac_filename[MAXPATHLEN+1]; | 2583 char mac_filename[MAXPATHLEN+1]; |
2584 | 2584 |
2585 CHECK_STRING (posix_filename); | 2585 CHECK_STRING (posix_filename); |
2586 | 2586 |
2587 if (posix_to_mac_pathname (XSTRING (posix_filename)->data, mac_filename, | 2587 if (posix_to_mac_pathname (SDATA (posix_filename), mac_filename, |
2588 MAXPATHLEN)) | 2588 MAXPATHLEN)) |
2589 return build_string (mac_filename); | 2589 return build_string (mac_filename); |
2590 else | 2590 else |
2591 return Qnil; | 2591 return Qnil; |
2592 } | 2592 } |
2668 | 2668 |
2669 /* fixme: ignore the push flag for now */ | 2669 /* fixme: ignore the push flag for now */ |
2670 | 2670 |
2671 CHECK_STRING (value); | 2671 CHECK_STRING (value); |
2672 | 2672 |
2673 len = XSTRING (value)->size; | 2673 len = SCHARS (value); |
2674 buf = (char *) alloca (len+1); | 2674 buf = (char *) alloca (len+1); |
2675 bcopy (XSTRING (value)->data, buf, len); | 2675 bcopy (SDATA (value), buf, len); |
2676 buf[len] = '\0'; | 2676 buf[len] = '\0'; |
2677 | 2677 |
2678 /* convert to Mac-style eol's before sending to clipboard */ | 2678 /* convert to Mac-style eol's before sending to clipboard */ |
2679 for (i = 0; i < len; i++) | 2679 for (i = 0; i < len; i++) |
2680 if (buf[i] == '\n') | 2680 if (buf[i] == '\n') |