fsautoproc
Basic file transformation automation management utility
Loading...
Searching...
No Matches
deng.h File Reference

Differential file search comparison function and hook structure. More...

#include <signal.h>
#include <stdbool.h>
Include dependency graph for deng.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  deng_hooks_s
 Hook functions for file system search events. More...
 
struct  deng_params_s
 Parameters for the differential file search process. More...
 

Typedefs

typedef bool(* deng_filter_t) (const char *fp)
 Filter function for ignoring files during the search process.
 

Enumerations

enum  deng_notif_t { DENG_NOTIF_FILE_FOUND , DENG_NOTIF_STAGE_DONE }
 Notification events for the file search process. More...
 
enum  deng_fevent_t { DENG_FEVENT_NEW , DENG_FEVENT_DEL , DENG_FEVENT_MOD }
 File change event types for the file comparison process. More...
 

Functions

int dengsearch (const struct deng_params_s *p, const volatile sig_atomic_t *stop)
 Recursively scans directory sd and compares the file system state with a previously saved index. Any new, modified, deleted, or unmodified files are reported to the caller via the provided hooks structure, hooks. The index state new is then updated with the current file system state.
 

Detailed Description

Differential file search comparison function and hook structure.

Typedef Documentation

◆ deng_filter_t

deng_filter_t

Filter function for ignoring files during the search process.

Parameters
fpThe file path to filter
Returns
true if the file should be ignored, otherwise false

Enumeration Type Documentation

◆ deng_fevent_t

File change event types for the file comparison process.

Enumerator
DENG_FEVENT_NEW 

New file event.

DENG_FEVENT_DEL 

Deleted file event.

DENG_FEVENT_MOD 

Modified file event.

◆ deng_notif_t

Notification events for the file search process.

Enumerator
DENG_NOTIF_FILE_FOUND 

Occurs when a file will be processed.

DENG_NOTIF_STAGE_DONE 

Occurs when a stage has been fully processed.

Function Documentation

◆ dengsearch()

int dengsearch ( const struct deng_params_s p,
const volatile sig_atomic_t *  stop 
)

Recursively scans directory sd and compares the file system state with a previously saved index. Any new, modified, deleted, or unmodified files are reported to the caller via the provided hooks structure, hooks. The index state new is then updated with the current file system state.

Parameters
pThe differential search parameters
stopAn atomic integer which can be set to a non-zero value to interrupt the search process (can be NULL to ignore)
Returns
0 if successful, otherwise a non-zero error code.
Here is the call graph for this function:
Here is the caller graph for this function: