Latest available version: IDA and decompilers v8.4.240320sp1 see all releases
Hex-Rays logo State-of-the-art binary code analysis tools
email icon
prodir.h File Reference

Unified interface to qfindfirst(),qfindnext(),qfindclose() functions. More...

Classes

struct  qffblk_t
 file statistics returned by qfind()-like functions More...
 
struct  qffblk64_t
 Common structure with 64-bit ff_fsize - see qffblk_t. More...
 

Macros

#define __FAT__
 
#define SDIRCHAR   "\\"
 
#define DIRCHAR   '\\'
 
#define DRVCHAR   ':'
 
#define EXTCHAR   '.'
 Extension character is '.' for all systems.
 
#define MAXPATH   260
 
#define FA_RDONLY   0x01
 
#define FA_DIREC   0x10
 
#define FA_ARCH   0x20
 
#define MAXDRIVE   _MAX_DRIVE
 
#define MAXDIR   _MAX_DIR
 
#define MAXFILE   _MAX_FNAME
 
#define MAXEXT   _MAX_EXT
 

Functions

idaman THREAD_SAFE int ida_export qfindfirst (const char *pattern, struct qffblk64_t *blk, int attr)
 Find first file that matches the pattern. More...
 
idaman THREAD_SAFE int ida_export qfindnext (struct qffblk64_t *blk)
 Find next file that matches the pattern. More...
 
idaman THREAD_SAFE void ida_export qfindclose (struct qffblk64_t *blk)
 Stop the file enumeration and free internal structures. More...
 

Detailed Description

Unified interface to qfindfirst(),qfindnext(),qfindclose() functions.

These are low level functions, it is better to use enumerate_files2().

Function Documentation

◆ qfindfirst()

idaman THREAD_SAFE int ida_export qfindfirst ( const char *  pattern,
struct qffblk64_t blk,
int  attr 
)

Find first file that matches the pattern.

Parameters
patternfile name pattern, usually with * and ? wildcards
blkstructure that will hold the answer. blk->ff_name will hold the file name, for example.
attrthe desired file types (#FA_DIREC for directories only or 0 for both directories and files)
Returns
0 if found a file, other values mean error (check qerrno)

◆ qfindnext()

idaman THREAD_SAFE int ida_export qfindnext ( struct qffblk64_t blk)

Find next file that matches the pattern.

Parameters
blkstructure that holds the current state. blk->ff_name will hold the next file name upon return.
Returns
0 if found the next file, other values mean error (check qerrno)

◆ qfindclose()

idaman THREAD_SAFE void ida_export qfindclose ( struct qffblk64_t blk)

Stop the file enumeration and free internal structures.

Note
usually there is no need to call this function manually, it is called from the qffblk64_t destructor.
Parameters
blkfile enumeration structure