Archived
1
0
Fork 0
This repository has been archived on 2026-05-10. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
archived/src/event.h
2010-11-03 08:35:58 +01:00

47 lines
1.4 KiB
C

/* event.h - event data structure and operation's for notify API
*
* (C) Copyright 2010 Henrik Hautakoski <henrik@fiktivkod.org>
* (C) Copyright 2010 Fredric Nilsson <fredric@fiktivkod.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*/
#ifndef __EVENT_H
#define __EVENT_H
#include <stdint.h>
/* event types */
#define NOTIFY_UNKNOWN (1 << 0)
#define NOTIFY_CREATE (1 << 1)
#define NOTIFY_DELETE (1 << 2)
#define NOTIFY_MOVE_FROM (1 << 3)
#define NOTIFY_MOVE_TO (1 << 4)
typedef struct {
uint8_t type; /* type of event */
uint8_t dir; /* non zero if event is triggered on a directory */
char *path; /* path of the triggered event */
char *filename; /* the filename event was triggered on */
} notify_event;
notify_event* notify_event_new();
void notify_event_del(notify_event *event);
void notify_event_clear(notify_event *event);
void notify_event_set_path(notify_event *event, const char *path);
void notify_event_set_filename(notify_event *event, const char *filename);
void notify_event_set_dir(notify_event *event, uint8_t dir);
void notify_event_set_type(notify_event *event, uint8_t type);
const char* notify_event_typetostr(notify_event *event);
#endif /* __EVENT_H */