Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

findfile.cpp File Reference

#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <sys/stat.h>
#include <print.h>
#include <helpfunc.h>

Functions

int _p_find_file_1 ( const char *base, bool allow_longer, char **match, const char *suff)
int find_file (const char *base, bool allow_longer, char **match, const char *suff, ...)
 Searches for files. More...


Function Documentation

int _p_find_file_1 ( const char * base,
bool allow_longer,
char ** match,
const char * suff )
 

int find_file ( const char * base,
bool allow_longer,
char ** match,
const char * suff,
... )
 

Searches for files.

Parameters:
base   basename of the file
allow_longer   whether files with longer names are also matched
match   the first match will be stored here, by malloc()ing *match
suff   Variable length argument list, terminated by NULL, containing all suffices to look for

Returns:
number of matches found

example:
 char *myresult;
 if(  find_file("nhood1", true, &myresult, "i-w", "w", NULL)   > 0 )
 {
   printf("found %s\n", myresult);
   free(myresult);
 };

Function requires that either _GLUE_USE_POSIX_DIRS or _GLUE_USE_WIN_DIRS is defined.


Generated at Fri Jul 26 09:33:57 2002 for rvtmod/rvglue by doxygen1.2.0 written by Dimitri van Heesch, © 1997-2000