Back to index

glibc  2.9
Classes | Defines | Functions
glob.h File Reference
#include <sys/cdefs.h>
#include <stddef.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  glob_t

Defines

#define __size_t   size_t
#define GLOB_ERR   (1 << 0)/* Return on read errors. */
#define GLOB_MARK   (1 << 1)/* Append a slash to each name. */
#define GLOB_NOSORT   (1 << 2)/* Don't sort the names. */
#define GLOB_DOOFFS   (1 << 3)/* Insert PGLOB->gl_offs NULLs. */
#define GLOB_NOCHECK   (1 << 4)/* If nothing matches, return the pattern. */
#define GLOB_APPEND   (1 << 5)/* Append to results of a previous call. */
#define GLOB_NOESCAPE   (1 << 6)/* Backslashes don't quote metacharacters. */
#define GLOB_PERIOD   (1 << 7)/* Leading `.' can be matched by metachars. */
#define GLOB_MAGCHAR   (1 << 8)/* Set in gl_flags if any metachars seen. */
#define GLOB_ALTDIRFUNC   (1 << 9)/* Use gl_opendir et al functions. */
#define GLOB_BRACE   (1 << 10)/* Expand "{a,b}" to "a" "b". */
#define GLOB_NOMAGIC   (1 << 11)/* If no magic chars, return the pattern. */
#define GLOB_TILDE   (1 << 12)/* Expand ~user and ~ to home directories. */
#define GLOB_ONLYDIR   (1 << 13)/* Match only directories. */
#define GLOB_TILDE_CHECK
#define __GLOB_FLAGS
#define GLOB_NOSPACE   1 /* Ran out of memory. */
#define GLOB_ABORTED   2 /* Read error. */
#define GLOB_NOMATCH   3 /* No matches found. */
#define GLOB_NOSYS   4 /* Not implemented. */

Functions

int glob (__const char *__restrict __pattern, int __flags, int(*__errfunc)(__const char *, int), glob_t *__restrict __pglob) __THROW
void globfree (glob_t *__pglob) __THROW

Define Documentation

#define __GLOB_FLAGS
Value:

Definition at line 64 of file glob.h.

#define __size_t   size_t

Definition at line 36 of file glob.h.

#define GLOB_ABORTED   2 /* Read error. */

Definition at line 76 of file glob.h.

#define GLOB_ALTDIRFUNC   (1 << 9)/* Use gl_opendir et al functions. */

Definition at line 58 of file glob.h.

#define GLOB_APPEND   (1 << 5)/* Append to results of a previous call. */

Definition at line 52 of file glob.h.

#define GLOB_BRACE   (1 << 10)/* Expand "{a,b}" to "a" "b". */

Definition at line 59 of file glob.h.

#define GLOB_DOOFFS   (1 << 3)/* Insert PGLOB->gl_offs NULLs. */

Definition at line 50 of file glob.h.

#define GLOB_ERR   (1 << 0)/* Return on read errors. */

Definition at line 47 of file glob.h.

#define GLOB_MAGCHAR   (1 << 8)/* Set in gl_flags if any metachars seen. */

Definition at line 57 of file glob.h.

#define GLOB_MARK   (1 << 1)/* Append a slash to each name. */

Definition at line 48 of file glob.h.

#define GLOB_NOCHECK   (1 << 4)/* If nothing matches, return the pattern. */

Definition at line 51 of file glob.h.

#define GLOB_NOESCAPE   (1 << 6)/* Backslashes don't quote metacharacters. */

Definition at line 53 of file glob.h.

#define GLOB_NOMAGIC   (1 << 11)/* If no magic chars, return the pattern. */

Definition at line 60 of file glob.h.

#define GLOB_NOMATCH   3 /* No matches found. */

Definition at line 77 of file glob.h.

#define GLOB_NOSORT   (1 << 2)/* Don't sort the names. */

Definition at line 49 of file glob.h.

#define GLOB_NOSPACE   1 /* Ran out of memory. */

Definition at line 75 of file glob.h.

#define GLOB_NOSYS   4 /* Not implemented. */

Definition at line 78 of file glob.h.

#define GLOB_ONLYDIR   (1 << 13)/* Match only directories. */

Definition at line 62 of file glob.h.

#define GLOB_PERIOD   (1 << 7)/* Leading `.' can be matched by metachars. */

Definition at line 54 of file glob.h.

#define GLOB_TILDE   (1 << 12)/* Expand ~user and ~ to home directories. */

Definition at line 61 of file glob.h.

Value:
(1 << 14)/* Like GLOB_TILDE but return an error
                                  if the user name is not available.  */

Definition at line 63 of file glob.h.


Function Documentation

int glob ( __const char *__restrict  __pattern,
int  __flags,
int(*)(__const char *, int __errfunc,
glob_t *__restrict  __pglob 
)
void globfree ( glob_t __pglob)

Definition at line 1071 of file glob.c.

{
  if (pglob->gl_pathv != NULL)
    {
      size_t i;
      for (i = 0; i < pglob->gl_pathc; ++i)
       free (pglob->gl_pathv[pglob->gl_offs + i]);
      free (pglob->gl_pathv);
      pglob->gl_pathv = NULL;
    }
}