Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

fts.h File Reference

#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>

Go to the source code of this file.

Data Structures

struct  FTS
struct  _ftsent

Defines

#define _FTS_H   1
#define __THROW
#define __BEGIN_DECLS
#define __END_DECLS
#define FTS_COMFOLLOW   0x0001
#define FTS_LOGICAL   0x0002
#define FTS_NOCHDIR   0x0004
#define FTS_NOSTAT   0x0008
#define FTS_PHYSICAL   0x0010
#define FTS_SEEDOT   0x0020
#define FTS_XDEV   0x0040
#define FTS_WHITEOUT   0x0080
#define FTS_OPTIONMASK   0x00ff
#define FTS_NAMEONLY   0x0100
#define FTS_STOP   0x0200
#define FTS_ROOTPARENTLEVEL   -1
#define FTS_ROOTLEVEL   0
#define FTS_D   1
#define FTS_DC   2
#define FTS_DEFAULT   3
#define FTS_DNR   4
#define FTS_DOT   5
#define FTS_DP   6
#define FTS_ERR   7
#define FTS_F   8
#define FTS_INIT   9
#define FTS_NS   10
#define FTS_NSOK   11
#define FTS_SL   12
#define FTS_SLNONE   13
#define FTS_W   14
#define FTS_DONTCHDIR   0x01
#define FTS_SYMFOLLOW   0x02
#define FTS_AGAIN   1
#define FTS_FOLLOW   2
#define FTS_NOINSTR   3
#define FTS_SKIP   4

Typedefs

typedef _ftsent FTSENT

Functions

FTSENTFts_children (FTS *sp, int instr)
 Return list of children of the current node.
int Fts_close (FTS *sp)
 Destroy a file hierarchy traversal handle.
FTSFts_open (char *const *argv, int options, int(*compar)(const FTSENT **, const FTSENT **))
 Create a handle for file hierarchy traversal.
FTSENTFts_read (FTS *sp)
 Return next node in the file hierarchy traversal.
int Fts_set (FTS *sp, FTSENT *p, int instr)
 Modify the traversal for a file set member.


Define Documentation

#define __BEGIN_DECLS
 

Definition at line 44 of file fts.h.

#define __END_DECLS
 

Definition at line 45 of file fts.h.

#define __THROW
 

Definition at line 39 of file fts.h.

#define _FTS_H   1
 

Definition at line 33 of file fts.h.

#define FTS_AGAIN   1
 

read node again

Definition at line 159 of file fts.h.

Referenced by Fts_set(), and rpmfts_new().

#define FTS_COMFOLLOW   0x0001
 

follow command line symlinks

Definition at line 97 of file fts.h.

Referenced by Fts_open(), main(), recurseDir(), rpmfts_initialize(), and rpmfts_new().

#define FTS_D   1
 

preorder directory

Definition at line 139 of file fts.h.

Referenced by fts_build(), Fts_children(), Fts_read(), ftsPrint(), recurseDir(), and rpmfts_new().

#define FTS_DC   2
 

directory that causes cycles

Definition at line 140 of file fts.h.

Referenced by fts_build(), ftsPrint(), recurseDir(), and rpmfts_new().

#define FTS_DEFAULT   3
 

none of the above

Definition at line 141 of file fts.h.

Referenced by ftsPrint(), recurseDir(), and rpmfts_new().

#define FTS_DNR   4
 

unreadable directory

Definition at line 142 of file fts.h.

Referenced by ftsPrint(), recurseDir(), and rpmfts_new().

#define FTS_DONTCHDIR   0x01
 

don't chdir .. to the parent

Definition at line 155 of file fts.h.

Referenced by rpmfts_new().

#define FTS_DOT   5
 

dot or dot-dot

Definition at line 143 of file fts.h.

Referenced by ftsPrint(), recurseDir(), and rpmfts_new().

#define FTS_DP   6
 

postorder directory

Definition at line 144 of file fts.h.

Referenced by ftsPrint(), recurseDir(), rpmfts_initialize(), and rpmfts_new().

#define FTS_ERR   7
 

error; errno is set

Definition at line 145 of file fts.h.

Referenced by Fts_read(), ftsPrint(), recurseDir(), and rpmfts_new().

#define FTS_F   8
 

regular file

Definition at line 146 of file fts.h.

Referenced by ftsPrint(), recurseDir(), and rpmfts_new().

#define FTS_FOLLOW   2
 

follow symbolic link

Definition at line 160 of file fts.h.

Referenced by Fts_read(), Fts_set(), and rpmfts_new().

#define FTS_INIT   9
 

initialized only

Definition at line 147 of file fts.h.

Referenced by ftsPrint(), and recurseDir().

#define FTS_LOGICAL   0x0002
 

logical walk

Definition at line 98 of file fts.h.

Referenced by Fts_open(), fts_stat(), main(), rpmfts_initialize(), and rpmfts_new().

#define FTS_NAMEONLY   0x0100
 

(private) child names only

Definition at line 107 of file fts.h.

Referenced by Fts_children(), Fts_read(), and rpmfts_new().

#define FTS_NOCHDIR   0x0004
 

don't change directories

Definition at line 99 of file fts.h.

Referenced by fts_build(), Fts_children(), Fts_close(), Fts_open(), Fts_read(), fts_safe_changedir(), recurseDir(), and rpmfts_new().

#define FTS_NOINSTR   3
 

no instructions

Definition at line 161 of file fts.h.

Referenced by Fts_set(), and rpmfts_new().

#define FTS_NOSTAT   0x0008
 

don't get stat info

Definition at line 100 of file fts.h.

Referenced by fts_alloc(), fts_build(), fts_stat(), and rpmfts_new().

#define FTS_NS   10
 

stat(2) failed

Definition at line 148 of file fts.h.

Referenced by ftsPrint(), recurseDir(), and rpmfts_new().

#define FTS_NSOK   11
 

no stat(2) requested

Definition at line 149 of file fts.h.

Referenced by ftsPrint(), recurseDir(), and rpmfts_new().

#define FTS_OPTIONMASK   0x00ff
 

valid user option mask

Definition at line 105 of file fts.h.

Referenced by rpmfts_new().

#define FTS_PHYSICAL   0x0010
 

physical walk

Definition at line 101 of file fts.h.

Referenced by fts_build(), and rpmfts_new().

#define FTS_ROOTLEVEL   0
 

Definition at line 136 of file fts.h.

Referenced by fts_build(), Fts_children(), and rpmfts_new().

#define FTS_ROOTPARENTLEVEL   -1
 

Definition at line 135 of file fts.h.

Referenced by rpmfts_new().

#define FTS_SEEDOT   0x0020
 

return dot and dot-dot

Definition at line 102 of file fts.h.

Referenced by fts_build(), and rpmfts_new().

#define FTS_SKIP   4
 

discard node

Definition at line 162 of file fts.h.

Referenced by Fts_read(), ftsPrint(), and rpmfts_new().

#define FTS_SL   12
 

symbolic link

Definition at line 150 of file fts.h.

Referenced by Fts_read(), ftsPrint(), recurseDir(), and rpmfts_new().

#define FTS_SLNONE   13
 

symbolic link without target

Definition at line 151 of file fts.h.

Referenced by ftsPrint(), recurseDir(), and rpmfts_new().

#define FTS_STOP   0x0200
 

(private) unrecoverable error

Definition at line 108 of file fts.h.

Referenced by fts_build(), Fts_children(), Fts_read(), and rpmfts_new().

#define FTS_SYMFOLLOW   0x02
 

followed a symlink to get here

Definition at line 156 of file fts.h.

Referenced by rpmfts_new().

#define FTS_W   14
 

whiteout object

Definition at line 152 of file fts.h.

Referenced by ftsPrint(), recurseDir(), and rpmfts_new().

#define FTS_WHITEOUT   0x0080
 

return whiteout information

Definition at line 104 of file fts.h.

Referenced by fts_build(), and rpmfts_new().

#define FTS_XDEV   0x0040
 

don't cross devices

Definition at line 103 of file fts.h.

Referenced by Fts_read(), and rpmfts_new().


Typedef Documentation

typedef struct _ftsent FTSENT
 

Referenced by fts_alloc(), fts_build(), Fts_children(), Fts_close(), fts_lfree(), fts_load(), Fts_open(), fts_padjust(), Fts_read(), fts_safe_changedir(), Fts_set(), fts_sort(), fts_stat(), ftsPrint(), ftsStashLatest(), main(), recurseDir(), and rpmfts_state().


Function Documentation

FTSENT* Fts_children FTS sp,
int  instr
 

Return list of children of the current node.

< (private) child names only

< (private) unrecoverable error

< initialized only

< preorder directory

< (private) child names only

< (private) child names only

< don't change directories

Definition at line 571 of file fts.c.

References __close, __fchdir, __open, __set_errno, _ftsent::fts_accpath, fts_build(), FTS::fts_child, FTS::fts_cur, FTS_D, _ftsent::fts_info, _ftsent::fts_level, fts_lfree(), _ftsent::fts_link, FTS_NAMEONLY, FTS_NOCHDIR, FTS_ROOTLEVEL, FTS_STOP, FTSENT, ISSET, and SET.

Referenced by rpmfts_Children().

int Fts_close FTS sp  ) 
 

Destroy a file hierarchy traversal handle.

< don't change directories

Definition at line 297 of file fts.c.

References __close, __fchdir, __set_errno, errno, FTS::fts_array, FTS::fts_child, FTS::fts_cur, _ftsent::fts_level, fts_lfree(), _ftsent::fts_link, FTS_NOCHDIR, _ftsent::fts_parent, FTS::fts_path, FTS::fts_rfd, FTSENT, and ISSET.

Referenced by main(), recurseDir(), and rpmfts_state().

FTS* Fts_open char *const *  argv,
int  options,
int(*)(const FTSENT **, const FTSENT **)  compar
 

Create a handle for file hierarchy traversal.

< valid user option mask

< logical walk

< don't change directories

< don't change directories

< follow command line symlinks

< dot or dot-dot

< preorder directory

< initialized only

< don't change directories

< don't change directories

Definition at line 130 of file fts.c.

References __open, __set_errno, argv, _ftsent::fts_accpath, fts_alloc(), FTS_COMFOLLOW, _ftsent::fts_info, _ftsent::fts_level, fts_lfree(), _ftsent::fts_link, FTS_LOGICAL, fts_maxarglen(), _ftsent::fts_name, FTS_NOCHDIR, fts_palloc(), _ftsent::fts_parent, fts_sort(), fts_stat(), FTSENT, ISSET, MAX, MAXPATHLEN, SET, URL_IS_DASH, URL_IS_FTP, URL_IS_HTTP, URL_IS_PATH, URL_IS_UNKNOWN, and urlIsURL().

Referenced by main(), recurseDir(), and rpmfts_state().

FTSENT* Fts_read FTS sp  ) 
 

Return next node in the file hierarchy traversal.

< (private) unrecoverable error

< no instructions

< read node again

< follow symbolic link

< symbolic link

< symbolic link without target

< preorder directory

< don't change directories

< error; errno is set

< followed a symlink to get here

< preorder directory

< discard node

< don't cross devices

< followed a symlink to get here

< postorder directory

< (private) child names only

< (private) child names only

< don't chdir .. to the parent

< (private) unrecoverable error

< don't change directories

< (private) unrecoverable error

< discard node

< follow symbolic link

< preorder directory

< don't change directories

< error; errno is set

< followed a symlink to get here

< no instructions

< don't change directories

< (private) unrecoverable error

< followed a symlink to get here

< don't change directories

< (private) unrecoverable error

< don't chdir .. to the parent

< (private) unrecoverable error

< error; errno is set

< postorder directory

Definition at line 358 of file fts.c.

References __close, __open, __set_errno, BREAD, CLR, FCHDIR, _ftsent::fts_accpath, fts_build(), FTS::fts_child, FTS::fts_cur, FTS_D, FTS::fts_dev, _ftsent::fts_dev, FTS_ERR, _ftsent::fts_errno, _ftsent::fts_flags, FTS_FOLLOW, _ftsent::fts_info, _ftsent::fts_instr, _ftsent::fts_level, fts_lfree(), _ftsent::fts_link, fts_load(), _ftsent::fts_name, _ftsent::fts_namelen, FTS_NAMEONLY, FTS_NOCHDIR, _ftsent::fts_parent, FTS::fts_path, _ftsent::fts_pathlen, FTS::fts_rfd, fts_safe_changedir(), FTS_SKIP, FTS_SL, fts_stat(), FTS_STOP, _ftsent::fts_symfd, FTS_XDEV, FTSENT, ISSET, NAPPEND, and SET.

Referenced by main(), recurseDir(), and rpmfts_step().

int Fts_set FTS sp,
FTSENT p,
int  instr
 

Modify the traversal for a file set member.

< read node again

< follow symbolic link

< no instructions

< discard node

Definition at line 557 of file fts.c.

References __set_errno, FTS_AGAIN, FTS_FOLLOW, _ftsent::fts_instr, FTS_NOINSTR, and FTSENT.

Referenced by ftsPrint(), and rpmfts_Set().


Generated on Mon Oct 3 21:17:41 2011 for rpm by  doxygen 1.3.9.1