rpm  5.2.1
Defines | Functions
rpmio/glob.c File Reference
#include "system.h"
#include <stddef.h>
#include <assert.h>
#include <errno.h>
Include dependency graph for glob.c:

Go to the source code of this file.

Defines

#define __alloca   alloca
#define __stat   stat
#define NAMLEN(_d)   NLENGTH(_d)
#define CONVERT_D_NAMLEN(d64, d32)   (d64)->d_namlen = (d32)->d_namlen;
#define CONVERT_D_INO(d64, d32)   (d64)->d_ino = (d32)->d_ino;
#define CONVERT_D_TYPE(d64, d32)
#define CONVERT_DIRENT_DIRENT64(d64, d32)
#define REAL_DIR_ENTRY(dp)   (dp->d_ino != 0)
#define __set_errno(val)   errno = (val)
#define GLOB_INTERFACE_VERSION   1
#define DIRSEP_CHAR   '/'

Functions

static const char *next_brace_sub __P ((const char *begin))
static int glob_in_dir __P ((const char *pattern, const char *directory, int flags, int(*errfunc)(const char *, int), glob_t *pglob))
static int prefix_array __P ((const char *prefix, char **array, size_t n))
static int collated_compare __P ((const __ptr_t, const __ptr_t))
static const char * next_brace_sub (const char *begin)
static int __glob_pattern_p (const char *pattern, int quote)
int glob (const char *pattern, int flags, int(*errfunc) __P((const char *, int)), glob_t *pglob)
void globfree (glob_t *pglob)
static int collated_compare (const __ptr_t a, const __ptr_t b)
static int prefix_array (const char *dirname, char **array, size_t n)
static int glob_in_dir (const char *pattern, const char *directory, int flags, int(*errfunc) __P((const char *, int)), glob_t *pglob)

Define Documentation

#define __alloca   alloca

Definition at line 56 of file glob.c.

Referenced by glob(), and glob_in_dir().

#define __set_errno (   val)    errno = (val)

Definition at line 98 of file glob.c.

Referenced by glob(), and glob_in_dir().

#define __stat   stat

Definition at line 57 of file glob.c.

Referenced by glob(), and glob_in_dir().

#define CONVERT_D_INO (   d64,
  d32 
)    (d64)->d_ino = (d32)->d_ino;

Definition at line 71 of file glob.c.

#define CONVERT_D_NAMLEN (   d64,
  d32 
)    (d64)->d_namlen = (d32)->d_namlen;

Definition at line 64 of file glob.c.

#define CONVERT_D_TYPE (   d64,
  d32 
)

Definition at line 79 of file glob.c.

#define CONVERT_DIRENT_DIRENT64 (   d64,
  d32 
)
Value:
memcpy ((d64)->d_name, (d32)->d_name, NAMLEN (d32) + 1);                      \
  CONVERT_D_NAMLEN (d64, d32)                                                 \
  CONVERT_D_INO (d64, d32)                                                    \
  CONVERT_D_TYPE (d64, d32)

Definition at line 82 of file glob.c.

Referenced by glob_in_dir().

#define DIRSEP_CHAR   '/'

Referenced by prefix_array().

#define GLOB_INTERFACE_VERSION   1

Definition at line 104 of file glob.c.

#define NAMLEN (   _d)    NLENGTH(_d)

Definition at line 58 of file glob.c.

Referenced by glob_in_dir().

#define REAL_DIR_ENTRY (   dp)    (dp->d_ino != 0)

Definition at line 93 of file glob.c.

Referenced by glob_in_dir().


Function Documentation

static int __glob_pattern_p ( const char *  pattern,
int  quote 
) [static]

Definition at line 973 of file glob.c.

Referenced by glob(), and glob_in_dir().

static const char* next_brace_sub __P ( (const char *begin)  ) [inline, static]
static int glob_in_dir __P ( (const char *pattern, const char *directory, int flags, int(*errfunc)(const char *, int), glob_t *pglob)  ) [static]
static int prefix_array __P ( (const char *prefix, char **array, size_t n)  ) [static]
static int collated_compare __P ( (const __ptr_t, const __ptr_t ) [static]
static int collated_compare ( const __ptr_t  a,
const __ptr_t  b 
) [static]

Definition at line 888 of file glob.c.

Referenced by glob().

int glob ( const char *  pattern,
int  flags,
int *errfunc   __P(const char *, int),
glob_t pglob 
)
static int glob_in_dir ( const char *  pattern,
const char *  directory,
int  flags,
int *errfunc   __P(const char *, int),
glob_t pglob 
) [static]
void globfree ( glob_t pglob)

Definition at line 873 of file glob.c.

References __ptr_t, glob_t::gl_pathc, and glob_t::gl_pathv.

Referenced by glob(), and Globfree().

static const char* next_brace_sub ( const char *  begin) [inline, static]

Definition at line 124 of file glob.c.

Referenced by glob().

static int prefix_array ( const char *  dirname,
char **  array,
size_t  n 
) [static]

Definition at line 908 of file glob.c.

References __ptr_t, DIRSEP_CHAR, and xmalloc().

Referenced by glob().