X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Ffts_.h;h=e217c73f102d38194d8e8957942cc2dcbc7d37c3;hb=43593319b31e6b0175b8eec4433bac744959822d;hp=e1a8196af072f2a32df3ff695f1c6cba3fc6da9e;hpb=b2e2010c7c902235b5efb5bd3c6529f61b093aa4;p=gnulib.git diff --git a/lib/fts_.h b/lib/fts_.h index e1a8196af..e217c73f1 100644 --- a/lib/fts_.h +++ b/lib/fts_.h @@ -1,6 +1,6 @@ /* Traverse a file hierarchy. - Copyright (C) 2004-2010 Free Software Foundation, Inc. + Copyright (C) 2004-2013 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -31,7 +31,7 @@ * may be used to endorse or promote products derived from this software * without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE @@ -55,13 +55,19 @@ # undef __THROW # define __THROW # undef __BEGIN_DECLS -# define __BEGIN_DECLS # undef __END_DECLS -# define __END_DECLS +# ifdef __cplusplus +# define __BEGIN_DECLS extern "C" { +# define __END_DECLS } +# else +# define __BEGIN_DECLS +# define __END_DECLS +# endif # endif # include # include +# include # include # include "i-ring.h" @@ -92,8 +98,8 @@ typedef struct { The lazy way (which works only with FTS_PHYSICAL), with which one may process a directory that is a part of the cycle several times before detecting the cycle. - The `tight' way, whereby fts uses more memory (proportional - to number of `active' directories, aka distance from root + The "tight" way, whereby fts uses more memory (proportional + to number of "active" directories, aka distance from root of current tree to current directory -- see active_dir_ht) to detect any cycle right away. For example, du must use this option to avoid counting disk space in a cycle multiple @@ -137,13 +143,18 @@ typedef struct { dirent.d_type data. */ # define FTS_DEFER_STAT 0x0400 -# define FTS_OPTIONMASK 0x07ff /* valid user option mask */ +# define FTS_NOATIME 0x0800 /* use O_NOATIME during traversal */ -# define FTS_NAMEONLY 0x1000 /* (private) child names only */ -# define FTS_STOP 0x2000 /* (private) unrecoverable error */ + /* Use this flag to disable stripping of trailing slashes + from input path names during fts_open initialization. */ +# define FTS_VERBATIM 0x1000 + +# define FTS_OPTIONMASK 0x1fff /* valid user option mask */ + +# define FTS_NAMEONLY 0x2000 /* (private) child names only */ +# define FTS_STOP 0x4000 /* (private) unrecoverable error */ int fts_options; /* fts_open options, global flags */ -# if GNULIB_FTS /* Map a directory's device number to a boolean. The boolean is true if for that file system (type determined by a single fstatfs call per FS) st_nlink can be used to calculate the number of @@ -175,7 +186,6 @@ typedef struct { struct cycle_check_state *state; } fts_cycle; -# endif /* A stack of the file descriptors corresponding to the most-recently traversed parent directories. Currently used only in FTS_CWDFD mode. */ @@ -186,6 +196,9 @@ typedef struct _ftsent { struct _ftsent *fts_cycle; /* cycle node */ struct _ftsent *fts_parent; /* parent directory */ struct _ftsent *fts_link; /* next file in directory */ + DIR *fts_dirp; /* Dir pointer for any directory + containing more entries than we + read at one time. */ long fts_number; /* local numeric value */ void *fts_pointer; /* local address value */ char *fts_accpath; /* access file name */