BRL-CAD

In-progress API, not ready for general use. More...

Collaboration diagram for EXPERIMENTAL:

Files

file  glob.h
 

Data Structures

struct  bu_dirent
 
struct  bu_stat
 
struct  bu_glob_context
 

Macros

#define BU_GLOB_INIT_ZERO   {0, 0, 0, NULL, (struct bu_glob_context *(*)(const char *))NULL, (int(*)(struct bu_dirent *, struct bu_glob_context *))NULL, (void(*)(struct bu_glob_context *))NULL, (int(*)(const char *, struct bu_stat *, struct bu_glob_context *))NULL, (int(*)(const char *, struct bu_stat *, struct bu_glob_context *))NULL, (int(*)(const char *, int, struct bu_glob_context *))NULL, NULL, NULL}
 

Typedefs

typedef struct bu_glob_context bu_glob_t
 

Functions

struct bu_glob_contextbu_glob_init (void)
 
void bu_glob_free (struct bu_glob_context *)
 
int bu_glob (const char *pattern, int flags, struct bu_glob_context *context)
 

Detailed Description

In-progress API, not ready for general use.

Routines and structures for getting a list of entities that match a given pattern.

NOTE - the glob API below is a work in progress - until this notice is removed it should not be considered functional, much less stable!

Macro Definition Documentation

◆ BU_GLOB_INIT_ZERO

#define BU_GLOB_INIT_ZERO   {0, 0, 0, NULL, (struct bu_glob_context *(*)(const char *))NULL, (int(*)(struct bu_dirent *, struct bu_glob_context *))NULL, (void(*)(struct bu_glob_context *))NULL, (int(*)(const char *, struct bu_stat *, struct bu_glob_context *))NULL, (int(*)(const char *, struct bu_stat *, struct bu_glob_context *))NULL, (int(*)(const char *, int, struct bu_glob_context *))NULL, NULL, NULL}

declaration statement initialization of a bu_glob struct

Definition at line 109 of file glob.h.

Typedef Documentation

◆ bu_glob_t

typedef struct bu_glob_context bu_glob_t

Definition at line 103 of file glob.h.

Function Documentation

◆ bu_glob_init()

struct bu_glob_context * bu_glob_init ( void  )

initialize a globbing context for use prior to calling bu_glob()

◆ bu_glob_free()

void bu_glob_free ( struct bu_glob_context )

release any resources allocated during bu_glob(), including any returned paths

◆ bu_glob()

int bu_glob ( const char *  pattern,
int  flags,
struct bu_glob_context context 
)

match a pattern against a set of elements.

This interface is a somewhat simplified and abstracted version of UNIX glob matching, based loosely on the interface specified in POSIX.2. It supports user specified callback functions allowing callers to glob nearly any named storage structure. By default, globbing will map to the local filesystem.

Function takes an input pattern, a set of flags, and a globbing context from bu_glob_alloc().

Returns zero on success, non-zero on failure.

gl_pathc will contain the total number of paths matched. This will increment previous glob counts if GLOB_APPEND is specified.

gl_matchc will contain the number of matched paths for this invocation of bu_glob().

gl_pathv contains a list of matched paths.