Mercurial > emacs
comparison src/fileio.c @ 46465:5c56d4068a01
(report_file_error): String pointer args now point to
const.
(Ffile_name_directory, Ffile_name_nondirectory):
(Fmake_directory_internal, Fdelete_directory):
(Ffile_name_absolute_p, Fwrite_region, double_dollars): Use const
for pointer to lisp string data.
author | Ken Raeburn <raeburn@raeburn.org> |
---|---|
date | Tue, 16 Jul 2002 19:48:17 +0000 |
parents | 9aa6b2db42da |
children | b95625933c8f |
comparison
equal
deleted
inserted
replaced
46464:e05dd5b81fc7 | 46465:5c56d4068a01 |
---|---|
248 static int e_write P_ ((int, Lisp_Object, int, int, struct coding_system *)); | 248 static int e_write P_ ((int, Lisp_Object, int, int, struct coding_system *)); |
249 | 249 |
250 | 250 |
251 void | 251 void |
252 report_file_error (string, data) | 252 report_file_error (string, data) |
253 char *string; | 253 const char *string; |
254 Lisp_Object data; | 254 Lisp_Object data; |
255 { | 255 { |
256 Lisp_Object errstring; | 256 Lisp_Object errstring; |
257 int errorno = errno; | 257 int errorno = errno; |
258 | 258 |
391 Given a Unix syntax file name, returns a string ending in slash; | 391 Given a Unix syntax file name, returns a string ending in slash; |
392 on VMS, perhaps instead a string ending in `:', `]' or `>'. */) | 392 on VMS, perhaps instead a string ending in `:', `]' or `>'. */) |
393 (filename) | 393 (filename) |
394 Lisp_Object filename; | 394 Lisp_Object filename; |
395 { | 395 { |
396 register unsigned char *beg; | 396 register const unsigned char *beg; |
397 register unsigned char *p; | 397 register const unsigned char *p; |
398 Lisp_Object handler; | 398 Lisp_Object handler; |
399 | 399 |
400 CHECK_STRING (filename); | 400 CHECK_STRING (filename); |
401 | 401 |
402 /* If the file name has special constructs in it, | 402 /* If the file name has special constructs in it, |
467 this is everything after the last slash, | 467 this is everything after the last slash, |
468 or the entire name if it contains no slash. */) | 468 or the entire name if it contains no slash. */) |
469 (filename) | 469 (filename) |
470 Lisp_Object filename; | 470 Lisp_Object filename; |
471 { | 471 { |
472 register unsigned char *beg, *p, *end; | 472 register const unsigned char *beg, *p, *end; |
473 Lisp_Object handler; | 473 Lisp_Object handler; |
474 | 474 |
475 CHECK_STRING (filename); | 475 CHECK_STRING (filename); |
476 | 476 |
477 /* If the file name has special constructs in it, | 477 /* If the file name has special constructs in it, |
2538 Smake_directory_internal, 1, 1, 0, | 2538 Smake_directory_internal, 1, 1, 0, |
2539 doc: /* Create a new directory named DIRECTORY. */) | 2539 doc: /* Create a new directory named DIRECTORY. */) |
2540 (directory) | 2540 (directory) |
2541 Lisp_Object directory; | 2541 Lisp_Object directory; |
2542 { | 2542 { |
2543 unsigned char *dir; | 2543 const unsigned char *dir; |
2544 Lisp_Object handler; | 2544 Lisp_Object handler; |
2545 Lisp_Object encoded_dir; | 2545 Lisp_Object encoded_dir; |
2546 | 2546 |
2547 CHECK_STRING (directory); | 2547 CHECK_STRING (directory); |
2548 directory = Fexpand_file_name (directory, Qnil); | 2548 directory = Fexpand_file_name (directory, Qnil); |
2568 DEFUN ("delete-directory", Fdelete_directory, Sdelete_directory, 1, 1, "FDelete directory: ", | 2568 DEFUN ("delete-directory", Fdelete_directory, Sdelete_directory, 1, 1, "FDelete directory: ", |
2569 doc: /* Delete the directory named DIRECTORY. */) | 2569 doc: /* Delete the directory named DIRECTORY. */) |
2570 (directory) | 2570 (directory) |
2571 Lisp_Object directory; | 2571 Lisp_Object directory; |
2572 { | 2572 { |
2573 unsigned char *dir; | 2573 const unsigned char *dir; |
2574 Lisp_Object handler; | 2574 Lisp_Object handler; |
2575 Lisp_Object encoded_dir; | 2575 Lisp_Object encoded_dir; |
2576 | 2576 |
2577 CHECK_STRING (directory); | 2577 CHECK_STRING (directory); |
2578 directory = Fdirectory_file_name (Fexpand_file_name (directory, Qnil)); | 2578 directory = Fdirectory_file_name (Fexpand_file_name (directory, Qnil)); |
2901 doc: /* Return t if file FILENAME specifies an absolute file name. | 2901 doc: /* Return t if file FILENAME specifies an absolute file name. |
2902 On Unix, this is a name starting with a `/' or a `~'. */) | 2902 On Unix, this is a name starting with a `/' or a `~'. */) |
2903 (filename) | 2903 (filename) |
2904 Lisp_Object filename; | 2904 Lisp_Object filename; |
2905 { | 2905 { |
2906 unsigned char *ptr; | 2906 const unsigned char *ptr; |
2907 | 2907 |
2908 CHECK_STRING (filename); | 2908 CHECK_STRING (filename); |
2909 ptr = SDATA (filename); | 2909 ptr = SDATA (filename); |
2910 if (IS_DIRECTORY_SEP (*ptr) || *ptr == '~' | 2910 if (IS_DIRECTORY_SEP (*ptr) || *ptr == '~' |
2911 #ifdef VMS | 2911 #ifdef VMS |
4748 Lisp_Object start, end, filename, append, visit, lockname, mustbenew; | 4748 Lisp_Object start, end, filename, append, visit, lockname, mustbenew; |
4749 { | 4749 { |
4750 register int desc; | 4750 register int desc; |
4751 int failure; | 4751 int failure; |
4752 int save_errno = 0; | 4752 int save_errno = 0; |
4753 unsigned char *fn; | 4753 const unsigned char *fn; |
4754 struct stat st; | 4754 struct stat st; |
4755 int tem; | 4755 int tem; |
4756 int count = SPECPDL_INDEX (); | 4756 int count = SPECPDL_INDEX (); |
4757 int count1; | 4757 int count1; |
4758 #ifdef VMS | 4758 #ifdef VMS |
5811 | 5811 |
5812 static Lisp_Object | 5812 static Lisp_Object |
5813 double_dollars (val) | 5813 double_dollars (val) |
5814 Lisp_Object val; | 5814 Lisp_Object val; |
5815 { | 5815 { |
5816 register unsigned char *old, *new; | 5816 register const unsigned char *old; |
5817 register unsigned char *new; | |
5817 register int n; | 5818 register int n; |
5818 int osize, count; | 5819 int osize, count; |
5819 | 5820 |
5820 osize = SBYTES (val); | 5821 osize = SBYTES (val); |
5821 | 5822 |