Synesis Software

Main Page   Compound List   File List   Compound Members   File Members  

/freelibs/unixem/include/glob.h File Reference

Go to the source code of this file.

Compounds

struct  glob_t
 Result structure for glob(). More...


Defines

#define GLOB_NOSPACE   (1)
#define GLOB_ABORTED   (2)
#define GLOB_NOMATCH   (3)
#define GLOB_NOSYS   (4)
#define GLOB_ABEND   GLOB_ABORTED
#define GLOB_ERR   0x00000001
#define GLOB_MARK   0x00000002
#define GLOB_NOSORT   0x00000004
#define GLOB_DOOFFS   0x00000008
#define GLOB_NOCHECK   0x00000010
#define GLOB_APPEND   0x00000020
#define GLOB_NOESCAPE   0x00000040
#define GLOB_PERIOD   0x00000080
#define GLOB_MAGCHAR   0x00000100
#define GLOB_ALTDIRFUNC   0x00000200
#define GLOB_BRACE   0x00000400
#define GLOB_NOMAGIC   0x00000800
#define GLOB_TILDE   0x00001000
#define GLOB_ONLYDIR   0x00002000
#define GLOB_TILDE_CHECK   0x00004000

Functions

int glob (char const *pattern, int flags, const int(*errfunc)(char const *, int), glob_t *pglob)
 Generates pathnames matching a pattern.

void globfree (glob_t *pglob)
 Frees the results of a call to glob.


Define Documentation

#define GLOB_ABEND   GLOB_ABORTED
 

(Error result code:) .

#define GLOB_ABORTED   (2)
 

(Error result code:) The scan was stopped because an error was encountered and either GLOB_ERR was set or (*errfunc)() returned non-zero.

#define GLOB_ALTDIRFUNC   0x00000200
 

Use gl_opendir et al functions.

#define GLOB_APPEND   0x00000020
 

Append to results of a previous call.

#define GLOB_BRACE   0x00000400
 

Expand "{a,b}" to "a" "b".

#define GLOB_DOOFFS   0x00000008
 

Insert PGLOB->gl_offs NULLs.

#define GLOB_ERR   0x00000001
 

Return on read errors.

#define GLOB_MAGCHAR   0x00000100
 

Set in gl_flags if any metachars seen.

#define GLOB_MARK   0x00000002
 

Append a slash to each name.

#define GLOB_NOCHECK   0x00000010
 

If nothing matches, return the pattern.

#define GLOB_NOESCAPE   0x00000040
 

Backslashes don't quote metacharacters.

#define GLOB_NOMAGIC   0x00000800
 

If no magic chars, return the pattern.

#define GLOB_NOMATCH   (3)
 

(Error result code:) The pattern does not match any existing pathname, and GLOB_NOCHECK was not set int flags.

#define GLOB_NOSORT   0x00000004
 

Don't sort the names.

#define GLOB_NOSPACE   (1)
 

(Error result code:) An attempt to allocate memory failed, or if errno was 0 GLOB_LIMIT was specified in the flags and ARG_MAX patterns were matched.

#define GLOB_NOSYS   (4)
 

(Error result code:) .

#define GLOB_ONLYDIR   0x00002000
 

Match only directories.

#define GLOB_PERIOD   0x00000080
 

Leading `.' can be matched by metachars.

#define GLOB_TILDE   0x00001000
 

Expand ~user and ~ to home directories.

#define GLOB_TILDE_CHECK   0x00004000
 

Like GLOB_TILDE but return an error


Function Documentation

int glob char const *    pattern,
int    flags,
const int(*    errfunc)(char const *, int),
glob_t   pglob
 

Generates pathnames matching a pattern.

This function is a pathname generator that implements the rules for file name pattern matching used by the UNIX shell.

Parameters:
pattern  The pattern controlling the search
flags  A combination of the GLOB_* flags
errfunc  [Not currently supported. Must be NULL]
pglob  Pointer to a glob_t structure to receive the search results
Returns:
0 on success, otherwise one of the GLOB_* error codes

void globfree glob_t   pglob
 

Frees the results of a call to glob.

This function releases any memory allocated in a call to glob. It must always be called for a successful call to glob.

Parameters:
pglob  Pointer to a glob_t structure to receive the search results

UNIX Emulation for Win32 Libraries documentation © Synesis Software Pty Ltd, 2001-2003