clsync
Data Structures | Typedefs | Enumerations | Functions | Variables
mon_kqueue.c File Reference
#include "common.h"
#include <glib.h>
#include "error.h"
#include "sync.h"
#include "indexes.h"
#include "fileutils.h"
#include "calc.h"
#include "glibex.h"
#include "mon_kqueue.h"
Include dependency graph for mon_kqueue.c:

Go to the source code of this file.

Data Structures

struct  monobj
 
struct  kqueue_data
 
struct  recognize_event_return
 

Typedefs

typedef struct monobj monobj_t
 

Enumerations

enum  kqueue_status { KQUEUE_STATUS_UNKNOWN, KQUEUE_STATUS_RUNNING, KQUEUE_STATUS_DEINIT, KQUEUE_STATUS_DEAD }
 

Functions

static uint32_t recognize_event (uint32_t event, int is_dir)
 
int kqueue_sync (ctx_t *ctx_p, indexes_t *indexes_p, struct kevent *ev_p, monobj_t *obj_p)
 
int kqueue_unmark (ctx_t *ctx_p, monobj_t *obj_p)
 
void unmarkchild (gpointer _obj_p)
 
gboolean unmarkchild_for_foreach (gpointer _obj_p, gpointer _value, gpointer _ctx_p)
 
void monobj_free (void *monobj_p)
 
static gint monobj_filecmp (gconstpointer _a, gconstpointer _b, gpointer _ctx_p)
 
static int monobj_fdcmp (gconstpointer a, gconstpointer b, gpointer _ctx_p)
 
int kqueue_init (ctx_t *_ctx_p)
 
int kqueue_mark (ctx_t *ctx_p, monobj_t *obj_p)
 
void child_free (monobj_t *node)
 
monobj_tkqueue_start_watch (ctx_t *ctx_p, ino_t inode, dev_t device, int dir_fd, const char *const fname, size_t name_len, unsigned char type)
 
monobj_tkqueue_add_watch_direntry (ctx_t *ctx_p, indexes_t *indexes_p, struct dirent *entry, monobj_t *dir_obj_p)
 
monobj_tkqueue_add_watch_path (ctx_t *ctx_p, indexes_t *indexes_p, const char *const path)
 
int kqueue_add_watch_dir (ctx_t *ctx_p, indexes_t *indexes_p, const char *const accpath)
 
int kqueue_wait (ctx_t *ctx_p, struct indexes *indexes_p, struct timeval *tv_p)
 
char * kqueue_getpath (ctx_t *ctx_p, indexes_t *indexes_p, monobj_t *obj_p)
 
static int _kqueue_handle_oneevent_dircontent_item (struct kqueue_data *dat, ctx_t *ctx_p, indexes_t *indexes_p, monobj_t *dir_obj_p, struct dirent *entry, void *children_notfound)
 
void monobj_freedup (gpointer _obj_p)
 
gpointer monobj_dup (gpointer _obj_p)
 
gboolean unmarkdupchild (gpointer _obj_p, gpointer value, gpointer _ctx_p)
 
int _kqueue_handle_oneevent_dircontent (ctx_t *ctx_p, indexes_t *indexes_p, monobj_t *obj_p)
 
int kqueue_handle_oneevent (ctx_t *ctx_p, indexes_t *indexes_p, struct kevent *ev_p, monobj_t *obj_p)
 
int kqueue_handle (ctx_t *ctx_p, indexes_t *indexes_p)
 
int kqueue_deinit (ctx_t *ctx_p)
 

Variables

enum kqueue_status kqueue_status = KQUEUE_STATUS_UNKNOWN
 
ctx_tctx_p
 

Typedef Documentation

◆ monobj_t

typedef struct monobj monobj_t

Definition at line 60 of file mon_kqueue.c.

Enumeration Type Documentation

◆ kqueue_status

Enumerator
KQUEUE_STATUS_UNKNOWN 
KQUEUE_STATUS_RUNNING 
KQUEUE_STATUS_DEINIT 
KQUEUE_STATUS_DEAD 

Definition at line 32 of file mon_kqueue.c.

Function Documentation

◆ _kqueue_handle_oneevent_dircontent()

int _kqueue_handle_oneevent_dircontent ( ctx_t ctx_p,
indexes_t indexes_p,
monobj_t obj_p 
)

Definition at line 701 of file mon_kqueue.c.

◆ _kqueue_handle_oneevent_dircontent_item()

static int _kqueue_handle_oneevent_dircontent_item ( struct kqueue_data dat,
ctx_t ctx_p,
indexes_t indexes_p,
monobj_t dir_obj_p,
struct dirent *  entry,
void *  children_notfound 
)
inlinestatic

Definition at line 634 of file mon_kqueue.c.

◆ child_free()

void child_free ( monobj_t node)

Definition at line 275 of file mon_kqueue.c.

Here is the call graph for this function:

◆ kqueue_add_watch_dir()

int kqueue_add_watch_dir ( ctx_t ctx_p,
indexes_t indexes_p,
const char *const  accpath 
)

Definition at line 491 of file mon_kqueue.c.

Here is the caller graph for this function:

◆ kqueue_add_watch_direntry()

monobj_t* kqueue_add_watch_direntry ( ctx_t ctx_p,
indexes_t indexes_p,
struct dirent *  entry,
monobj_t dir_obj_p 
)

Definition at line 383 of file mon_kqueue.c.

◆ kqueue_add_watch_path()

monobj_t* kqueue_add_watch_path ( ctx_t ctx_p,
indexes_t indexes_p,
const char *const  path 
)

Definition at line 414 of file mon_kqueue.c.

◆ kqueue_deinit()

int kqueue_deinit ( ctx_t ctx_p)

Definition at line 827 of file mon_kqueue.c.

Here is the caller graph for this function:

◆ kqueue_getpath()

char* kqueue_getpath ( ctx_t ctx_p,
indexes_t indexes_p,
monobj_t obj_p 
)

Definition at line 549 of file mon_kqueue.c.

◆ kqueue_handle()

int kqueue_handle ( ctx_t ctx_p,
indexes_t indexes_p 
)

Definition at line 782 of file mon_kqueue.c.

Here is the caller graph for this function:

◆ kqueue_handle_oneevent()

int kqueue_handle_oneevent ( ctx_t ctx_p,
indexes_t indexes_p,
struct kevent *  ev_p,
monobj_t obj_p 
)

Definition at line 752 of file mon_kqueue.c.

◆ kqueue_init()

int kqueue_init ( ctx_t _ctx_p)

Definition at line 200 of file mon_kqueue.c.

Here is the caller graph for this function:

◆ kqueue_mark()

int kqueue_mark ( ctx_t ctx_p,
monobj_t obj_p 
)

Definition at line 220 of file mon_kqueue.c.

◆ kqueue_start_watch()

monobj_t* kqueue_start_watch ( ctx_t ctx_p,
ino_t  inode,
dev_t  device,
int  dir_fd,
const char *const  fname,
size_t  name_len,
unsigned char  type 
)

Definition at line 325 of file mon_kqueue.c.

◆ kqueue_sync()

int kqueue_sync ( ctx_t ctx_p,
indexes_t indexes_p,
struct kevent *  ev_p,
monobj_t obj_p 
)

Definition at line 591 of file mon_kqueue.c.

Here is the caller graph for this function:

◆ kqueue_unmark()

int kqueue_unmark ( ctx_t ctx_p,
monobj_t obj_p 
)

Definition at line 279 of file mon_kqueue.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kqueue_wait()

int kqueue_wait ( ctx_t ctx_p,
struct indexes indexes_p,
struct timeval *  tv_p 
)

Definition at line 532 of file mon_kqueue.c.

Here is the caller graph for this function:

◆ monobj_dup()

gpointer monobj_dup ( gpointer  _obj_p)

Definition at line 681 of file mon_kqueue.c.

◆ monobj_fdcmp()

static int monobj_fdcmp ( gconstpointer  a,
gconstpointer  b,
gpointer  _ctx_p 
)
static

Definition at line 195 of file mon_kqueue.c.

◆ monobj_filecmp()

static gint monobj_filecmp ( gconstpointer  _a,
gconstpointer  _b,
gpointer  _ctx_p 
)
static

Definition at line 159 of file mon_kqueue.c.

◆ monobj_free()

void monobj_free ( void *  monobj_p)

Definition at line 131 of file mon_kqueue.c.

Here is the call graph for this function:

◆ monobj_freedup()

void monobj_freedup ( gpointer  _obj_p)

Definition at line 673 of file mon_kqueue.c.

◆ recognize_event()

static uint32_t recognize_event ( uint32_t  event,
int  is_dir 
)
inlinestatic

Definition at line 88 of file mon_kqueue.c.

◆ unmarkchild()

void unmarkchild ( gpointer  _obj_p)

Definition at line 113 of file mon_kqueue.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unmarkchild_for_foreach()

gboolean unmarkchild_for_foreach ( gpointer  _obj_p,
gpointer  _value,
gpointer  _ctx_p 
)

Definition at line 125 of file mon_kqueue.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unmarkdupchild()

gboolean unmarkdupchild ( gpointer  _obj_p,
gpointer  value,
gpointer  _ctx_p 
)

Definition at line 692 of file mon_kqueue.c.

Here is the call graph for this function:

Variable Documentation

◆ ctx_p

ctx_t* ctx_p

Definition at line 85 of file mon_kqueue.c.

◆ kqueue_status

Definition at line 38 of file mon_kqueue.c.