Open System Services Library Calls Reference Manual (G06.27+, H06.04+)

glob(3) OSS Library Calls Reference Manual
gl_pathv A pointer to the list of matching pathnames.
gl_offs The number of entries in the gl_pathv list reserved for matching pathnames.
gl_padr A pointer to the structure that contains the addresses of matching pathnames.
gl_ptx A pointer to the rst text buffer containing a matching pathname.
The matching pathnames are sorted, based on the setting of the LC_COLLATE category in the
current locale. The rst pointer after the pointer to the last pathname is a null pointer.
If the pattern does not match any pathnames, the returned number of matched pathnames is 0
(zero).
The ags parameter is used to control the behavior of the glob() function. The ags value is the
bitwise inclusive OR ( | ) of any of the following constants, which are dened in the glob.h
header le.
GLOB_APPEND
Appends pathnames located with this call to any pathnames previously located.
GLOB_DOOFFS
Uses the gl_offs eld in the structure pointed to by the pglob parameter to
specify the number of null pointers to add to the beginning of the gl_pathv com-
ponent of the structure.
GLOB_ERR Causes the glob() function to return when it encounters a directory that it cannot
open or read. If the GLOB_ERR ag is not set, the glob() function continues to
look for matches if it encounters a directory that it cannot open or read.
GLOB_MARK
Species that each pathname that is a directory should have a / (slash)
appended.
GLOB_NOCHECK
If the pattern parameter does not match any pathname, causes the glob() func-
tion to return a list consisting only of the pattern parameter, and the number of
matched patterns is 1.
GLOB_NOESCAPE
Indicates that a \ (backslash) cannot be used to escape metacharacters.
GLOB_NOSORT
Species that the list of pathnames need not be sorted. If the GLOB_NOSORT
ag is not set, pathnames are sorted according to the current locale.
The GLOB_APPEND ag can be used to append a new set of pathnames to those found in a
previous call to the glob() function. The following rules apply when two or more calls to the
glob() function are made with the same value of the pglob parameter and without intervening
calls to the glob() function:
The rst call to the glob() function must not set GLOB_APPEND.
If the application set the GLOB_DOOFFS ag in the rst call to the glob() function,
then the ag is also set in the second call, and the value of the gl_offs eld of the struc-
ture pointed to by the pglob parameter is not modied between the calls.
388 Hewlett-Packard Company 527187-004