Documentation from dir.h

ROV

Introduction

[top]

ROV - Easy applications from C

Copyright - © Jason Tribbeck / 7th ARM 1994-2001

Contributing authors - Jason Tribbeck

File - dir.h

Type - helper

Description

The dir functions are designed to scan directories, either recursively, or individually reporting files, directories and/or image directories.

dirscan_proc (function pointer)

[top]

Called by dirscan to indicate that an object meeting the criteria has been found.

Parameters:

 - char *name - the name of the object.
 - int type - the type of the object.
 - int size - the size of the object.

typedef void (* dirscan_proc)(char *name,
			      int type,
			      int size);

See also: dir_scan, dir_scan2, dirscan2_proc

dirscan2_proc (function pointer)

[top]

Called by dirscan2 to indiacte that an object meeting the criteria has been found.

Parameters:

 - char *name - the name of the object.
 - int type - the type of the object.
 - int size - the size of the object.

Returns:

 -  a flag indicating what should happen. DIRSCAN_CONTINUE indicates that searching should continue, DIRSCAN_BACKBYONE indicates that searching should continue from the object before, DIRSCAN_RESTARTDIR indicates that the directory should be restart at the beginning. The different return types can be used if a recursive deletion is taking place, for example.

typedef int (* dirscan2_proc)(char *name,
			      int type,
			      int size);

See also: Scanning response codes, dir_scan, dir_scan2, dirscan_proc

dir_scan

[top]

Used to scan directories to look for objects that match certain criteria

Parameters:

 - char *dir_name - the name of the directory to search in.
 - int flags - the find and search criteria.
 - char *wildcard - the wildcard to use.
 - dirscan_proc proc - the function to call when a match is found.

Returns:

 -  success flag. Non-zero means success.

int dir_scan(char *dir_name,
	     int flags,
	     char *wildcard,
	     dirscan_proc proc);

See also: Find and search flags, dirscan2_proc

dir_scan2

[top]

Used to scan directories to look for objects that match certain criteria

Parameters:

 - char *dir_name - the name of the directory to search in.
 - int flags - the find and search criteria.
 - char *wildcard - the wildcard to use.
 - dirscan2_proc proc - the function to call when a match is found.

Returns:

 -  success flag. Non-zero means success.

int dir_scan2(char *dir_name,
	      int flags,
	      char *wildcard,
	      dirscan2_proc proc);

See also: Find and search flags, Scanning response codes, dirscan2_proc

Find and search flags

[top]
#define DIRSCAN_RECURSE		(1<<0)
#define DIRSCAN_FILES		(1<<1)
#define DIRSCAN_DIRS		(1<<2)
#define DIRSCAN_IMAGEDIRS	(1<<3)
#define DIRSCAN_RECURSEIMAGEDIRS (1<<4)

Scanning response codes

[top]

These are returned by the dirscan2_proc handler.

#define DIRSCAN_CONTINUE	(0)
#define DIRSCAN_BACKBYONE	(1)
#define DIRSCAN_RESTARTDIR	(2)

See also: dirscan2_proc


Generated Thu Feb 7 23:22:51 2002