/* Lisp functions for making directory listings.
- Copyright (C) 1985, 1986, 1993, 1994, 1999, 2000, 2001, 2002, 2003,
- 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 1985-1986, 1993-1994, 1999-2011 Free Software Foundation, Inc.
This file is part of GNU Emacs.
#include <grp.h>
#include <errno.h>
-
-#ifdef HAVE_UNISTD_H
#include <unistd.h>
-#endif
/* The d_nameln member of a struct dirent includes the '\0' character
on some systems, but not on others. What's worse, you can't tell
Since applying strlen to the name always works, we'll just do that. */
#define NAMLEN(p) strlen (p->d_name)
-#ifdef SYSV_SYSTEM_DIR
+#ifdef HAVE_DIRENT_H
#include <dirent.h>
#define DIRENTRY struct dirent
-#else /* not SYSV_SYSTEM_DIR */
+#else /* not HAVE_DIRENT_H */
-#ifdef MSDOS
-#include <dirent.h>
-#else
#include <sys/dir.h>
-#endif
-
#include <sys/stat.h>
-#ifndef MSDOS
#define DIRENTRY struct direct
-extern DIR *opendir ();
-extern struct direct *readdir ();
+extern DIR *opendir (char *);
+extern struct direct *readdir (DIR *);
-#endif /* not MSDOS */
-#endif /* not SYSV_SYSTEM_DIR */
+#endif /* HAVE_DIRENT_H */
-/* Some versions of Cygwin don't have d_ino in `struct dirent'. */
-#if defined(MSDOS) || defined(__CYGWIN__)
+#ifdef MSDOS
#define DIRENTRY_NONEMPTY(p) ((p)->d_name[0] != 0)
#else
#define DIRENTRY_NONEMPTY(p) ((p)->d_ino)
#include "blockinput.h"
/* Returns a search buffer, with a fastmap allocated and ready to go. */
-extern struct re_pattern_buffer *compile_pattern (Lisp_Object, struct re_registers *, Lisp_Object, int, int);
+extern struct re_pattern_buffer *compile_pattern (Lisp_Object,
+ struct re_registers *,
+ Lisp_Object, int, int);
/* From filemode.c. Can't go in Lisp.h because of `stat'. */
extern void filemodestring (struct stat *, char *);
#define lstat stat
#endif
-extern int completion_ignore_case;
-extern Lisp_Object Qcompletion_ignore_case;
-extern Lisp_Object Vcompletion_regexp_list;
-extern Lisp_Object Vw32_get_true_file_attributes;
-
-Lisp_Object Vcompletion_ignored_extensions;
Lisp_Object Qdirectory_files;
Lisp_Object Qdirectory_files_and_attributes;
Lisp_Object Qfile_name_completion;
Lisp_Object Qfile_attributes;
Lisp_Object Qfile_attributes_lessp;
-static int scmp (unsigned char *, unsigned char *, int);
+static int scmp (const unsigned char *, const unsigned char *, int);
\f
#ifdef WINDOWSNT
Lisp_Object
#ifdef WINDOWSNT
if (attrs)
{
- extern Lisp_Object Qlocal;
extern int is_slow_fs (const char *);
/* Do this only once to avoid doing it (in w32.c:stat) for each
If NOSORT is non-nil, the list is not sorted--its order is unpredictable.
Otherwise, the list returned is sorted with `string-lessp'.
NOSORT is useful if you plan to sort the result yourself. */)
- (directory, full, match, nosort)
- Lisp_Object directory, full, match, nosort;
+ (Lisp_Object directory, Lisp_Object full, Lisp_Object match, Lisp_Object nosort)
{
Lisp_Object handler;
directory = Fexpand_file_name (directory, Qnil);
`file-attributes' for further documentation.
On MS-Windows, performance depends on `w32-get-true-file-attributes',
which see. */)
- (directory, full, match, nosort, id_format)
- Lisp_Object directory, full, match, nosort, id_format;
+ (Lisp_Object directory, Lisp_Object full, Lisp_Object match, Lisp_Object nosort, Lisp_Object id_format)
{
Lisp_Object handler;
directory = Fexpand_file_name (directory, Qnil);
This function ignores some of the possible completions as
determined by the variable `completion-ignored-extensions', which see. */)
- (file, directory, predicate)
- Lisp_Object file, directory, predicate;
+ (Lisp_Object file, Lisp_Object directory, Lisp_Object predicate)
{
Lisp_Object handler;
Sfile_name_all_completions, 2, 2, 0,
doc: /* Return a list of all completions of file name FILE in directory DIRECTORY.
These are all file names in directory DIRECTORY which begin with FILE. */)
- (file, directory)
- Lisp_Object file, directory;
+ (Lisp_Object file, Lisp_Object directory)
{
Lisp_Object handler;
else number of chars that match at the beginning. */
static int
-scmp (register unsigned char *s1, register unsigned char *s2, int len)
+scmp (const unsigned char *s1, const unsigned char *s2, int len)
{
register int l = len;
On some FAT-based filesystems, only the date of last access is recorded,
so last access time will always be midnight of that day. */)
- (filename, id_format)
- Lisp_Object filename, id_format;
+ (Lisp_Object filename, Lisp_Object id_format)
{
Lisp_Object values[12];
Lisp_Object encoded;
DEFUN ("file-attributes-lessp", Ffile_attributes_lessp, Sfile_attributes_lessp, 2, 2, 0,
doc: /* Return t if first arg file attributes list is less than second.
Comparison is in lexicographic order and case is significant. */)
- (f1, f2)
- Lisp_Object f1, f2;
+ (Lisp_Object f1, Lisp_Object f2)
{
return Fstring_lessp (Fcar (f1), Fcar (f2));
}
defsubr (&Sfile_attributes);
defsubr (&Sfile_attributes_lessp);
- DEFVAR_LISP ("completion-ignored-extensions", &Vcompletion_ignored_extensions,
+ DEFVAR_LISP ("completion-ignored-extensions", Vcompletion_ignored_extensions,
doc: /* Completion ignores file names ending in any string in this list.
It does not ignore them if all possible completions end in one of
these strings or when displaying a list of completions.
Vcompletion_ignored_extensions = Qnil;
}
-/* arch-tag: 1ac8deca-4d8f-4d41-ade9-089154d98c03
- (do not change this comment) */