aboutsummaryrefslogtreecommitdiffstats
path: root/src/dired.c
diff options
context:
space:
mode:
authorPaul Eggert2012-08-27 10:23:48 -0700
committerPaul Eggert2012-08-27 10:23:48 -0700
commitde1339b0a8a5b6b8bf784c816b2b974f4610e3ac (patch)
tree2a77a2ce1b781f5cf30c734e9b0919a6ff3264ec /src/dired.c
parentf10fe38f772c29031a23ef7aa92d2de1b3675461 (diff)
downloademacs-de1339b0a8a5b6b8bf784c816b2b974f4610e3ac.tar.gz
emacs-de1339b0a8a5b6b8bf784c816b2b974f4610e3ac.zip
* composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
* composite.c (find_composition, composition_gstring_p) (composition_reseat_it, find_automatic_composition): * data.c (let_shadows_buffer_binding_p) (let_shadows_global_binding_p, set_internal, make_blv) (Fmake_variable_buffer_local, Fmake_local_variable) (Fmake_variable_frame_local, arithcompare, cons_to_unsigned) (cons_to_signed, arith_driver): * dbusbind.c (xd_in_read_queued_messages): * dired.c (directory_files_internal, file_name_completion): Use bool for booleans. * dired.c (file_name_completion): * process.h (fd_callback): Omit int (actually boolean) argument. It wasn't being used. All uses changed. * composite.h, lisp.h: Reflect above API changes.
Diffstat (limited to 'src/dired.c')
-rw-r--r--src/dired.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/dired.c b/src/dired.c
index 771230717e3..206f370ed63 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -109,18 +109,20 @@ directory_files_internal_unwind (Lisp_Object dh)
109} 109}
110 110
111/* Function shared by Fdirectory_files and Fdirectory_files_and_attributes. 111/* Function shared by Fdirectory_files and Fdirectory_files_and_attributes.
112 When ATTRS is zero, return a list of directory filenames; when 112 If not ATTRS, return a list of directory filenames;
113 non-zero, return a list of directory filenames and their attributes. 113 if ATTRS, return a list of directory filenames and their attributes.
114 In the latter case, ID_FORMAT is passed to Ffile_attributes. */ 114 In the latter case, ID_FORMAT is passed to Ffile_attributes. */
115 115
116Lisp_Object 116Lisp_Object
117directory_files_internal (Lisp_Object directory, Lisp_Object full, Lisp_Object match, Lisp_Object nosort, int attrs, Lisp_Object id_format) 117directory_files_internal (Lisp_Object directory, Lisp_Object full,
118 Lisp_Object match, Lisp_Object nosort, bool attrs,
119 Lisp_Object id_format)
118{ 120{
119 DIR *d; 121 DIR *d;
120 ptrdiff_t directory_nbytes; 122 ptrdiff_t directory_nbytes;
121 Lisp_Object list, dirfilename, encoded_directory; 123 Lisp_Object list, dirfilename, encoded_directory;
122 struct re_pattern_buffer *bufp = NULL; 124 struct re_pattern_buffer *bufp = NULL;
123 int needsep = 0; 125 bool needsep = 0;
124 ptrdiff_t count = SPECPDL_INDEX (); 126 ptrdiff_t count = SPECPDL_INDEX ();
125 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; 127 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
126 DIRENTRY *dp; 128 DIRENTRY *dp;
@@ -227,7 +229,7 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full, Lisp_Object m
227 if (DIRENTRY_NONEMPTY (dp)) 229 if (DIRENTRY_NONEMPTY (dp))
228 { 230 {
229 ptrdiff_t len; 231 ptrdiff_t len;
230 int wanted = 0; 232 bool wanted = 0;
231 Lisp_Object name, finalname; 233 Lisp_Object name, finalname;
232 struct gcpro gcpro1, gcpro2; 234 struct gcpro gcpro1, gcpro2;
233 235
@@ -381,9 +383,8 @@ which see. */)
381} 383}
382 384
383 385
384static Lisp_Object file_name_completion 386static Lisp_Object file_name_completion (Lisp_Object, Lisp_Object, bool,
385 (Lisp_Object file, Lisp_Object dirname, int all_flag, int ver_flag, 387 Lisp_Object);
386 Lisp_Object predicate);
387 388
388DEFUN ("file-name-completion", Ffile_name_completion, Sfile_name_completion, 389DEFUN ("file-name-completion", Ffile_name_completion, Sfile_name_completion,
389 2, 3, 0, 390 2, 3, 0,
@@ -415,7 +416,7 @@ determined by the variable `completion-ignored-extensions', which see. */)
415 if (!NILP (handler)) 416 if (!NILP (handler))
416 return call4 (handler, Qfile_name_completion, file, directory, predicate); 417 return call4 (handler, Qfile_name_completion, file, directory, predicate);
417 418
418 return file_name_completion (file, directory, 0, 0, predicate); 419 return file_name_completion (file, directory, 0, predicate);
419} 420}
420 421
421DEFUN ("file-name-all-completions", Ffile_name_all_completions, 422DEFUN ("file-name-all-completions", Ffile_name_all_completions,
@@ -439,14 +440,15 @@ These are all file names in directory DIRECTORY which begin with FILE. */)
439 if (!NILP (handler)) 440 if (!NILP (handler))
440 return call3 (handler, Qfile_name_all_completions, file, directory); 441 return call3 (handler, Qfile_name_all_completions, file, directory);
441 442
442 return file_name_completion (file, directory, 1, 0, Qnil); 443 return file_name_completion (file, directory, 1, Qnil);
443} 444}
444 445
445static int file_name_completion_stat (Lisp_Object dirname, DIRENTRY *dp, struct stat *st_addr); 446static int file_name_completion_stat (Lisp_Object dirname, DIRENTRY *dp, struct stat *st_addr);
446static Lisp_Object Qdefault_directory; 447static Lisp_Object Qdefault_directory;
447 448
448static Lisp_Object 449static Lisp_Object
449file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag, int ver_flag, Lisp_Object predicate) 450file_name_completion (Lisp_Object file, Lisp_Object dirname, bool all_flag,
451 Lisp_Object predicate)
450{ 452{
451 DIR *d; 453 DIR *d;
452 ptrdiff_t bestmatchsize = 0; 454 ptrdiff_t bestmatchsize = 0;
@@ -459,10 +461,10 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag, int v
459 Lisp_Object encoded_dir; 461 Lisp_Object encoded_dir;
460 struct stat st; 462 struct stat st;
461 int directoryp; 463 int directoryp;
462 /* If includeall is zero, exclude files in completion-ignored-extensions as 464 /* If not INCLUDEALL, exclude files in completion-ignored-extensions as
463 well as "." and "..". Until shown otherwise, assume we can't exclude 465 well as "." and "..". Until shown otherwise, assume we can't exclude
464 anything. */ 466 anything. */
465 int includeall = 1; 467 bool includeall = 1;
466 ptrdiff_t count = SPECPDL_INDEX (); 468 ptrdiff_t count = SPECPDL_INDEX ();
467 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; 469 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
468 470
@@ -500,7 +502,7 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag, int v
500 { 502 {
501 DIRENTRY *dp; 503 DIRENTRY *dp;
502 ptrdiff_t len; 504 ptrdiff_t len;
503 int canexclude = 0; 505 bool canexclude = 0;
504 506
505 errno = 0; 507 errno = 0;
506 dp = readdir (d); 508 dp = readdir (d);