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/callproc.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/callproc.c')
| -rw-r--r-- | src/callproc.c | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/src/callproc.c b/src/callproc.c index c95055c67aa..68c4306b9ca 100644 --- a/src/callproc.c +++ b/src/callproc.c | |||
| @@ -159,8 +159,8 @@ call_process_cleanup (fdpid) | |||
| 159 | register Lisp_Object file; | 159 | register Lisp_Object file; |
| 160 | file = Fcdr (fdpid); | 160 | file = Fcdr (fdpid); |
| 161 | emacs_close (XFASTINT (Fcar (fdpid))); | 161 | emacs_close (XFASTINT (Fcar (fdpid))); |
| 162 | if (strcmp (XSTRING (file)-> data, NULL_DEVICE) != 0) | 162 | if (strcmp (SDATA (file), NULL_DEVICE) != 0) |
| 163 | unlink (XSTRING (file)->data); | 163 | unlink (SDATA (file)); |
| 164 | #else /* not MSDOS and not MAC_OS8 */ | 164 | #else /* not MSDOS and not MAC_OS8 */ |
| 165 | register int pid = XFASTINT (Fcdr (fdpid)); | 165 | register int pid = XFASTINT (Fcdr (fdpid)); |
| 166 | 166 | ||
| @@ -371,7 +371,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 371 | 371 | ||
| 372 | display = nargs >= 4 ? args[3] : Qnil; | 372 | display = nargs >= 4 ? args[3] : Qnil; |
| 373 | 373 | ||
| 374 | filefd = emacs_open (XSTRING (infile)->data, O_RDONLY, 0); | 374 | filefd = emacs_open (SDATA (infile), O_RDONLY, 0); |
| 375 | if (filefd < 0) | 375 | if (filefd < 0) |
| 376 | { | 376 | { |
| 377 | report_file_error ("Opening process input file", Fcons (infile, Qnil)); | 377 | report_file_error ("Opening process input file", Fcons (infile, Qnil)); |
| @@ -389,7 +389,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 389 | emacs_close (filefd); | 389 | emacs_close (filefd); |
| 390 | report_file_error ("Searching for program", Fcons (args[0], Qnil)); | 390 | report_file_error ("Searching for program", Fcons (args[0], Qnil)); |
| 391 | } | 391 | } |
| 392 | new_argv[0] = XSTRING (path)->data; | 392 | new_argv[0] = SDATA (path); |
| 393 | if (nargs > 4) | 393 | if (nargs > 4) |
| 394 | { | 394 | { |
| 395 | register int i; | 395 | register int i; |
| @@ -407,7 +407,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 407 | if (argument_coding.type == coding_type_ccl) | 407 | if (argument_coding.type == coding_type_ccl) |
| 408 | setup_ccl_program (&(argument_coding.spec.ccl.encoder), Qnil); | 408 | setup_ccl_program (&(argument_coding.spec.ccl.encoder), Qnil); |
| 409 | } | 409 | } |
| 410 | new_argv[i - 3] = XSTRING (args[i])->data; | 410 | new_argv[i - 3] = SDATA (args[i]); |
| 411 | } | 411 | } |
| 412 | UNGCPRO; | 412 | UNGCPRO; |
| 413 | new_argv[nargs - 3] = 0; | 413 | new_argv[nargs - 3] = 0; |
| @@ -443,9 +443,9 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 443 | #ifdef MAC_OS8 | 443 | #ifdef MAC_OS8 |
| 444 | /* Since we don't have pipes on the Mac, create a temporary file to | 444 | /* Since we don't have pipes on the Mac, create a temporary file to |
| 445 | hold the output of the subprocess. */ | 445 | hold the output of the subprocess. */ |
| 446 | tempfile = (char *) alloca (STRING_BYTES (XSTRING (Vtemp_file_name_pattern)) + 1); | 446 | tempfile = (char *) alloca (SBYTES (Vtemp_file_name_pattern) + 1); |
| 447 | bcopy (XSTRING (Vtemp_file_name_pattern)->data, tempfile, | 447 | bcopy (SDATA (Vtemp_file_name_pattern), tempfile, |
| 448 | STRING_BYTES (XSTRING (Vtemp_file_name_pattern)) + 1); | 448 | SBYTES (Vtemp_file_name_pattern) + 1); |
| 449 | 449 | ||
| 450 | mktemp (tempfile); | 450 | mktemp (tempfile); |
| 451 | 451 | ||
| @@ -505,11 +505,11 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 505 | else if (STRINGP (error_file)) | 505 | else if (STRINGP (error_file)) |
| 506 | { | 506 | { |
| 507 | #ifdef DOS_NT | 507 | #ifdef DOS_NT |
| 508 | fd_error = emacs_open (XSTRING (error_file)->data, | 508 | fd_error = emacs_open (SDATA (error_file), |
| 509 | O_WRONLY | O_TRUNC | O_CREAT | O_TEXT, | 509 | O_WRONLY | O_TRUNC | O_CREAT | O_TEXT, |
| 510 | S_IREAD | S_IWRITE); | 510 | S_IREAD | S_IWRITE); |
| 511 | #else /* not DOS_NT */ | 511 | #else /* not DOS_NT */ |
| 512 | fd_error = creat (XSTRING (error_file)->data, 0666); | 512 | fd_error = creat (SDATA (error_file), 0666); |
| 513 | #endif /* not DOS_NT */ | 513 | #endif /* not DOS_NT */ |
| 514 | } | 514 | } |
| 515 | 515 | ||
| @@ -545,15 +545,15 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 545 | close (fd_error); | 545 | close (fd_error); |
| 546 | fd1 = -1; /* No harm in closing that one! */ | 546 | fd1 = -1; /* No harm in closing that one! */ |
| 547 | 547 | ||
| 548 | infn = XSTRING (infile)->data; | 548 | infn = SDATA (infile); |
| 549 | outfn = tempfile; | 549 | outfn = tempfile; |
| 550 | if (NILP (error_file)) | 550 | if (NILP (error_file)) |
| 551 | errfn = NULL_DEVICE; | 551 | errfn = NULL_DEVICE; |
| 552 | else if (EQ (Qt, error_file)) | 552 | else if (EQ (Qt, error_file)) |
| 553 | errfn = outfn; | 553 | errfn = outfn; |
| 554 | else | 554 | else |
| 555 | errfn = XSTRING (error_file)->data; | 555 | errfn = SDATA (error_file); |
| 556 | currdn = XSTRING (current_dir)->data; | 556 | currdn = SDATA (current_dir); |
| 557 | pid = run_mac_command (new_argv, currdn, infn, outfn, errfn); | 557 | pid = run_mac_command (new_argv, currdn, infn, outfn, errfn); |
| 558 | 558 | ||
| 559 | /* Record that the synchronous process exited and note its | 559 | /* Record that the synchronous process exited and note its |
| @@ -1047,9 +1047,9 @@ usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &r | |||
| 1047 | strcat (tempfile, "detmp.XXX"); | 1047 | strcat (tempfile, "detmp.XXX"); |
| 1048 | #endif | 1048 | #endif |
| 1049 | #else /* not DOS_NT */ | 1049 | #else /* not DOS_NT */ |
| 1050 | char *tempfile = (char *) alloca (STRING_BYTES (XSTRING (Vtemp_file_name_pattern)) + 1); | 1050 | char *tempfile = (char *) alloca (SBYTES (Vtemp_file_name_pattern) + 1); |
| 1051 | bcopy (XSTRING (Vtemp_file_name_pattern)->data, tempfile, | 1051 | bcopy (SDATA (Vtemp_file_name_pattern), tempfile, |
| 1052 | STRING_BYTES (XSTRING (Vtemp_file_name_pattern)) + 1); | 1052 | SBYTES (Vtemp_file_name_pattern) + 1); |
| 1053 | #endif /* not DOS_NT */ | 1053 | #endif /* not DOS_NT */ |
| 1054 | 1054 | ||
| 1055 | coding_systems = Qt; | 1055 | coding_systems = Qt; |
| @@ -1188,7 +1188,7 @@ child_setup (in, out, err, new_argv, set_pgrp, current_dir) | |||
| 1188 | register char *temp; | 1188 | register char *temp; |
| 1189 | register int i; | 1189 | register int i; |
| 1190 | 1190 | ||
| 1191 | i = STRING_BYTES (XSTRING (current_dir)); | 1191 | i = SBYTES (current_dir); |
| 1192 | #ifdef MSDOS | 1192 | #ifdef MSDOS |
| 1193 | /* MSDOS must have all environment variables malloc'ed, because | 1193 | /* MSDOS must have all environment variables malloc'ed, because |
| 1194 | low-level libc functions that launch subsidiary processes rely | 1194 | low-level libc functions that launch subsidiary processes rely |
| @@ -1199,7 +1199,7 @@ child_setup (in, out, err, new_argv, set_pgrp, current_dir) | |||
| 1199 | #endif | 1199 | #endif |
| 1200 | temp = pwd_var + 4; | 1200 | temp = pwd_var + 4; |
| 1201 | bcopy ("PWD=", pwd_var, 4); | 1201 | bcopy ("PWD=", pwd_var, 4); |
| 1202 | bcopy (XSTRING (current_dir)->data, temp, i); | 1202 | bcopy (SDATA (current_dir), temp, i); |
| 1203 | if (!IS_DIRECTORY_SEP (temp[i - 1])) temp[i++] = DIRECTORY_SEP; | 1203 | if (!IS_DIRECTORY_SEP (temp[i - 1])) temp[i++] = DIRECTORY_SEP; |
| 1204 | temp[i] = 0; | 1204 | temp[i] = 0; |
| 1205 | 1205 | ||
| @@ -1253,7 +1253,7 @@ child_setup (in, out, err, new_argv, set_pgrp, current_dir) | |||
| 1253 | tem = XCDR (tem)) | 1253 | tem = XCDR (tem)) |
| 1254 | { | 1254 | { |
| 1255 | char **ep = env; | 1255 | char **ep = env; |
| 1256 | char *string = (char *) XSTRING (XCAR (tem))->data; | 1256 | char *string = (char *) SDATA (XCAR (tem)); |
| 1257 | /* See if this string duplicates any string already in the env. | 1257 | /* See if this string duplicates any string already in the env. |
| 1258 | If so, don't put it in. | 1258 | If so, don't put it in. |
| 1259 | When an env var has multiple definitions, | 1259 | When an env var has multiple definitions, |
| @@ -1280,7 +1280,7 @@ child_setup (in, out, err, new_argv, set_pgrp, current_dir) | |||
| 1280 | } | 1280 | } |
| 1281 | #ifdef WINDOWSNT | 1281 | #ifdef WINDOWSNT |
| 1282 | prepare_standard_handles (in, out, err, handles); | 1282 | prepare_standard_handles (in, out, err, handles); |
| 1283 | set_process_dir (XSTRING (current_dir)->data); | 1283 | set_process_dir (SDATA (current_dir)); |
| 1284 | #else /* not WINDOWSNT */ | 1284 | #else /* not WINDOWSNT */ |
| 1285 | /* Make sure that in, out, and err are not actually already in | 1285 | /* Make sure that in, out, and err are not actually already in |
| 1286 | descriptors zero, one, or two; this could happen if Emacs is | 1286 | descriptors zero, one, or two; this could happen if Emacs is |
| @@ -1405,18 +1405,18 @@ getenv_internal (var, varlen, value, valuelen) | |||
| 1405 | 1405 | ||
| 1406 | entry = XCAR (scan); | 1406 | entry = XCAR (scan); |
| 1407 | if (STRINGP (entry) | 1407 | if (STRINGP (entry) |
| 1408 | && STRING_BYTES (XSTRING (entry)) > varlen | 1408 | && SBYTES (entry) > varlen |
| 1409 | && XSTRING (entry)->data[varlen] == '=' | 1409 | && SREF (entry, varlen) == '=' |
| 1410 | #ifdef WINDOWSNT | 1410 | #ifdef WINDOWSNT |
| 1411 | /* NT environment variables are case insensitive. */ | 1411 | /* NT environment variables are case insensitive. */ |
| 1412 | && ! strnicmp (XSTRING (entry)->data, var, varlen) | 1412 | && ! strnicmp (SDATA (entry), var, varlen) |
| 1413 | #else /* not WINDOWSNT */ | 1413 | #else /* not WINDOWSNT */ |
| 1414 | && ! bcmp (XSTRING (entry)->data, var, varlen) | 1414 | && ! bcmp (SDATA (entry), var, varlen) |
| 1415 | #endif /* not WINDOWSNT */ | 1415 | #endif /* not WINDOWSNT */ |
| 1416 | ) | 1416 | ) |
| 1417 | { | 1417 | { |
| 1418 | *value = (char *) XSTRING (entry)->data + (varlen + 1); | 1418 | *value = (char *) SDATA (entry) + (varlen + 1); |
| 1419 | *valuelen = STRING_BYTES (XSTRING (entry)) - (varlen + 1); | 1419 | *valuelen = SBYTES (entry) - (varlen + 1); |
| 1420 | return 1; | 1420 | return 1; |
| 1421 | } | 1421 | } |
| 1422 | } | 1422 | } |
| @@ -1435,7 +1435,7 @@ This function consults the variable ``process-environment'' for its value. */) | |||
| 1435 | int valuelen; | 1435 | int valuelen; |
| 1436 | 1436 | ||
| 1437 | CHECK_STRING (var); | 1437 | CHECK_STRING (var); |
| 1438 | if (getenv_internal (XSTRING (var)->data, STRING_BYTES (XSTRING (var)), | 1438 | if (getenv_internal (SDATA (var), SBYTES (var), |
| 1439 | &value, &valuelen)) | 1439 | &value, &valuelen)) |
| 1440 | return make_string (value, valuelen); | 1440 | return make_string (value, valuelen); |
| 1441 | else | 1441 | else |
| @@ -1550,13 +1550,13 @@ init_callproc () | |||
| 1550 | #endif | 1550 | #endif |
| 1551 | { | 1551 | { |
| 1552 | tempdir = Fdirectory_file_name (Vexec_directory); | 1552 | tempdir = Fdirectory_file_name (Vexec_directory); |
| 1553 | if (access (XSTRING (tempdir)->data, 0) < 0) | 1553 | if (access (SDATA (tempdir), 0) < 0) |
| 1554 | dir_warning ("Warning: arch-dependent data dir (%s) does not exist.\n", | 1554 | dir_warning ("Warning: arch-dependent data dir (%s) does not exist.\n", |
| 1555 | Vexec_directory); | 1555 | Vexec_directory); |
| 1556 | } | 1556 | } |
| 1557 | 1557 | ||
| 1558 | tempdir = Fdirectory_file_name (Vdata_directory); | 1558 | tempdir = Fdirectory_file_name (Vdata_directory); |
| 1559 | if (access (XSTRING (tempdir)->data, 0) < 0) | 1559 | if (access (SDATA (tempdir), 0) < 0) |
| 1560 | dir_warning ("Warning: arch-independent data dir (%s) does not exist.\n", | 1560 | dir_warning ("Warning: arch-independent data dir (%s) does not exist.\n", |
| 1561 | Vdata_directory); | 1561 | Vdata_directory); |
| 1562 | 1562 | ||