bx-lib : the Basic X11 Library tuned for C beginners  1.0
Functions
Directories (how to inspect file system easily)

Functions

bx_dir bx_open_dir (char const path[])
bx_dir bx_open_dir_f (char const format[],...)
void bx_close_dir (bx_dir dir)
int bx_dir_length (bx_dir dir)
char * bx_dir_filename (bx_dir dir, int index)

Detailed Description

Function Documentation

bx_dir bx_open_dir ( char const  path[])

Opens a directory given a path name.

Parameters
paththe path name of the directory
Returns
the opened directory
bx_dir bx_open_dir_f ( char const  format[],
  ... 
)

Opens a directory given a path format like printf() function families.

Parameters
formatthe printf()-like format yielding the directory path name
...the arguments needed by the format specifiers
Returns
the opened directory
void bx_close_dir ( bx_dir  dir)

Closes an opened directory after usage. This is necessary in order to clean the allocated resources.

Parameters
dirthe opened directory to close
Returns
nothing.
int bx_dir_length ( bx_dir  dir)

Gets the length of an opened directory, that is, the number of filenames it contains.

Parameters
dirthe opened directory
Returns
the directory length
char* bx_dir_filename ( bx_dir  dir,
int  index 
)

Gets the filename at a given location index insde an opened directory. The index should be in the range 0...bx_dir_length()-1.

Parameters
dirthe opened directory
indexa location in the directory
Returns
the queried filename. This points to a string owned by the function. You cannot free it and its contents change after each call of the function.