You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
90 lines
3.0 KiB
90 lines
3.0 KiB
#ifndef _FAM_
|
|
#define _FAM_
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#include <limits.h>
|
|
|
|
typedef struct FAMConnection {
|
|
int fd;
|
|
void *client;
|
|
} FAMConnection;
|
|
|
|
#define FAMCONNECTION_GETFD(fc) ((fc)->fd)
|
|
|
|
typedef struct FAMRequest {
|
|
int reqnum;
|
|
} FAMRequest;
|
|
|
|
enum FAMCodes { FAMChanged=1, FAMDeleted=2, FAMStartExecuting=3,
|
|
FAMStopExecuting=4, FAMCreated=5, FAMMoved=6,
|
|
FAMAcknowledge=7, FAMExists=8, FAMEndExist=9 };
|
|
|
|
typedef struct FAMEvent {
|
|
FAMConnection* fc; /* The fam connection that event occurred on */
|
|
FAMRequest fr; /* Corresponds to the FamRequest from monitor */
|
|
char *hostname; /* host and filename - pointer to which */
|
|
char filename[PATH_MAX]; /* file changed */
|
|
void *userdata; /* userdata associated with this monitor req. */
|
|
enum FAMCodes code; /* What happened to file - see above */
|
|
} FAMEvent;
|
|
|
|
extern int FAMErrno;
|
|
extern char *FamErrlist[];
|
|
|
|
extern int FAMOpen(FAMConnection* fc);
|
|
extern int FAMOpen2(FAMConnection* fc, const char* appName);
|
|
extern int FAMClose(FAMConnection* fc);
|
|
|
|
extern int FAMMonitorDirectory(FAMConnection *fc,
|
|
const char *filename,
|
|
FAMRequest* fr,
|
|
void* userData);
|
|
extern int FAMMonitorFile(FAMConnection *fc,
|
|
const char *filename,
|
|
FAMRequest* fr,
|
|
void* userData);
|
|
extern int FAMMonitorCollection(FAMConnection *fc,
|
|
const char *filename,
|
|
FAMRequest* fr,
|
|
void* userData,
|
|
int depth,
|
|
const char* mask);
|
|
|
|
extern int FAMMonitorDirectory2(FAMConnection *fc,
|
|
const char *filename,
|
|
FAMRequest* fr);
|
|
extern int FAMMonitorFile2(FAMConnection *fc,
|
|
const char *filename,
|
|
FAMRequest* fr);
|
|
|
|
extern int FAMMonitorRemoteDirectory(FAMConnection *fc,
|
|
const char *hostname,
|
|
const char *filename,
|
|
FAMRequest* fr,
|
|
void* userdata);
|
|
extern int FAMMonitorRemoteFile(FAMConnection *fc,
|
|
const char *hostname,
|
|
const char *filename,
|
|
FAMRequest* fr,
|
|
void* userdata);
|
|
|
|
int FAMSuspendMonitor(FAMConnection *fc, const FAMRequest *fr);
|
|
int FAMResumeMonitor(FAMConnection *fc, const FAMRequest *fr);
|
|
|
|
int FAMCancelMonitor(FAMConnection *fc, const FAMRequest *fr);
|
|
|
|
int FAMNextEvent(FAMConnection *fc, FAMEvent *fe);
|
|
int FAMPending(FAMConnection* fc);
|
|
|
|
#define FAM_DEBUG_OFF 0
|
|
#define FAM_DEBUG_ON 1
|
|
#define FAM_DEBUG_VERBOSE 2
|
|
|
|
int FAMDebugLevel(FAMConnection *fc, int debugLevel);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
#endif /* _FAM_ */
|
|
|