Coda Distributed File System
Macros | Functions
coda_fts.c File Reference
#include <sys/types.h>
#include <sys/param.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <dirent.h>
#include <errno.h>
#include <coda_fts.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
Include dependency graph for coda_fts.c:

Macros

#define USHRT_MAX   65535 /* max of "unsigned short int" */
 
#define _D_EXACT_NAMLEN(dp)   strlen(dp->d_name)+1
 
#define ALIGNBYTES   (__alignof__ (long double) - 1)
 
#define ALIGN(p)   (((unsigned long int) (p) + ALIGNBYTES) & ~ALIGNBYTES)
 
#define __P(x)   x
 
#define MAX(a, b)
 
#define ISDOT(a)   (a[0] == '.' && (!a[1] || (a[1] == '.' && !a[2])))
 
#define CLR(opt)   (sp->fts_options &= ~(opt))
 
#define ISSET(opt)   (sp->fts_options & (opt))
 
#define SET(opt)   (sp->fts_options |= (opt))
 
#define FCHDIR(sp, fd)   (!ISSET(FTS_NOCHDIR) && fchdir(fd))
 
#define BCHILD   1 /* fts_children */
 
#define BNAMES   2 /* fts_children, names only */
 
#define BREAD   3 /* fts_read */
 
#define MAXPATHLEN   1024
 
#define NAPPEND(p)
 
#define __opendir2(path, flag)   opendir(path)
 
#define ADJUST(p)
 

Functions

FTSfts_open (char *const *argv, int options, int *compar)
 
int fts_close (FTS *sp)
 
FTSENTfts_read (FTS *sp)
 
int fts_set (FTS *sp, FTSENT *p, int instr)
 
FTSENTfts_children (FTS *sp, int instr)
 

Macro Definition Documentation

◆ __opendir2

#define __opendir2 (   path,
  flag 
)    opendir(path)

◆ __P

#define __P (   x)    x

◆ _D_EXACT_NAMLEN

#define _D_EXACT_NAMLEN (   dp)    strlen(dp->d_name)+1

◆ ADJUST

#define ADJUST (   p)
Value:
do { \
if ((p)->fts_accpath != (p)->fts_name) { \
(p)->fts_accpath = \
(char *)addr + ((p)->fts_accpath - (p)->fts_path); \
} \
(p)->fts_path = addr; \
} while (0)

◆ ALIGN

#define ALIGN (   p)    (((unsigned long int) (p) + ALIGNBYTES) & ~ALIGNBYTES)

◆ ALIGNBYTES

#define ALIGNBYTES   (__alignof__ (long double) - 1)

◆ BCHILD

#define BCHILD   1 /* fts_children */

◆ BNAMES

#define BNAMES   2 /* fts_children, names only */

◆ BREAD

#define BREAD   3 /* fts_read */

◆ CLR

#define CLR (   opt)    (sp->fts_options &= ~(opt))

◆ FCHDIR

#define FCHDIR (   sp,
  fd 
)    (!ISSET(FTS_NOCHDIR) && fchdir(fd))

◆ ISDOT

#define ISDOT (   a)    (a[0] == '.' && (!a[1] || (a[1] == '.' && !a[2])))

◆ ISSET

#define ISSET (   opt)    (sp->fts_options & (opt))

◆ MAX

#define MAX (   a,
 
)
Value:
({ __typeof__ (a) _a = (a); \
__typeof__ (b) _b = (b); \
_a > _b ? _a : _b; })

◆ MAXPATHLEN

#define MAXPATHLEN   1024

◆ NAPPEND

#define NAPPEND (   p)
Value:
(p->fts_path[p->fts_pathlen - 1] == '/' \
? p->fts_pathlen - 1 : p->fts_pathlen)

◆ SET

#define SET (   opt)    (sp->fts_options |= (opt))

◆ USHRT_MAX

#define USHRT_MAX   65535 /* max of "unsigned short int" */

Function Documentation

◆ fts_children()

FTSENT * fts_children ( FTS sp,
int  instr 
)

◆ fts_close()

int fts_close ( FTS sp)

◆ fts_open()

FTS * fts_open ( char * const *  argv,
int  options,
int *  compar 
)

◆ fts_read()

FTSENT * fts_read ( FTS sp)

◆ fts_set()

int fts_set ( FTS sp,
FTSENT p,
int  instr 
)