3 * $Id: fwatch.h,v 1.1 2001/02/03 18:43:56 mdw Exp $
5 * Watch a file for changes
7 * (c) 2001 Straylight/Edgeware
10 /*----- Licensing notice --------------------------------------------------*
12 * This file is part of the mLib utilities library.
14 * mLib is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU Library General Public License as
16 * published by the Free Software Foundation; either version 2 of the
17 * License, or (at your option) any later version.
19 * mLib is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU Library General Public License for more details.
24 * You should have received a copy of the GNU Library General Public
25 * License along with mLib; if not, write to the Free
26 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
30 /*----- Revision history --------------------------------------------------*
33 * Revision 1.1 2001/02/03 18:43:56 mdw
34 * New feature: watch a file for changes.
45 /*----- Header files ------------------------------------------------------*/
47 #include <sys/types.h>
50 /*----- Data structures ---------------------------------------------------*/
52 typedef struct fwatch
{
63 /*----- Functions provided ------------------------------------------------*/
65 /* --- @fwatch_init@, @fwatch_update@, etc --- *
67 * Arguments: @fwatch *f@ = pointer to an @fwatch@ structure
68 * @const char *name@ = name of the file to watch
69 * @int fd@ = a file descriptor to watch
71 * Returns: The @update@ functions return nonzero if the file has
74 * Use: Stores information about a file which can be used to watch
75 * for changes. The structures may be freed without telling
79 extern void fwatch_init(fwatch */
*f*/
, const char */
*name*/
);
80 extern void fwatch_initfd(fwatch */
*f*/
, int /*fd*/);
81 extern int fwatch_update(fwatch */
*f*/
, const char */
*name*/
);
82 extern int fwatch_updatefd(fwatch */
*f*/
, int /*fd*/);
84 /*----- That's all, folks -------------------------------------------------*/