Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

watcher.h File Reference


Detailed Description

File watcher.

Author:
Raphael Manfredi
Date:
2004

#include <glib.h>
#include "file.h"

Go to the source code of this file.

Typedefs

typedef void(* watcher_cb_t )(const gchar *filename, gpointer udata)
 The callback invoked when a monitored file changes.


Functions

void watcher_init (void)
 Initialization.

void watcher_close (void)
 Final cleanup.

void watcher_register (const gchar *filename, watcher_cb_t cb, gpointer udata)
 Register new file to be monitored.

void watcher_unregister (const gchar *filename)
 Cancel monitoring of specified file.

void watcher_register_path (const file_path_t *fp, watcher_cb_t cb, gpointer udata)
 Same as watcher_register() but a path, i.e.

void watcher_unregister_path (const file_path_t *fp)
 Same as watcher_unregister() but a path, i.e.


Typedef Documentation

typedef void(* watcher_cb_t)(const gchar *filename, gpointer udata)
 

The callback invoked when a monitored file changes.


Function Documentation

void watcher_close void   ) 
 

Final cleanup.

void watcher_init void   ) 
 

Initialization.

void watcher_register const gchar *  filename,
watcher_cb_t  cb,
gpointer  udata
 

Register new file to be monitored.

If the file was already monitored, cancel the previous monitoring action and replace it with this one.

Parameters:
filename the file to monitor (string duplicated)
cb the callback to invoke when the file changes
udata extra data to pass to the callback, along with filename

void watcher_register_path const file_path_t fp,
watcher_cb_t  cb,
gpointer  udata
 

Same as watcher_register() but a path, i.e.

a (dir, base) tuple is given instead of a complete filename.

void watcher_unregister const gchar *  filename  ) 
 

Cancel monitoring of specified file.

void watcher_unregister_path const file_path_t fp  ) 
 

Same as watcher_unregister() but a path, i.e.

a (dir, base) tuple is given instead of a complete filename.


Generated on Sun Feb 12 10:50:10 2006 for Gtk-Gnutella by doxygen 1.3.6