3 * Watch a file for changes
5 * (c) 2001 Straylight/Edgeware
8 /*----- Licensing notice --------------------------------------------------*
10 * This file is part of the mLib utilities library.
12 * mLib is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU Library General Public License as
14 * published by the Free Software Foundation; either version 2 of the
15 * License, or (at your option) any later version.
17 * mLib is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU Library General Public License for more details.
22 * You should have received a copy of the GNU Library General Public
23 * License along with mLib; if not, write to the Free
24 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
35 /*----- Header files ------------------------------------------------------*/
37 #include <sys/types.h>
40 /*----- Data structures ---------------------------------------------------*/
42 typedef struct fwatch {
53 /*----- Functions provided ------------------------------------------------*/
55 /* --- @fwatch_init@, @fwatch_update@, etc --- *
57 * Arguments: @fwatch *f@ = pointer to an @fwatch@ structure
58 * @const char *name@ = name of the file to watch
59 * @int fd@ = a file descriptor to watch
61 * Returns: The @update@ functions return nonzero if the file has
64 * Use: Stores information about a file which can be used to watch
65 * for changes. The structures may be freed without telling
69 extern void fwatch_init(fwatch */*f*/, const char */*name*/);
70 extern void fwatch_initfd(fwatch */*f*/, int /*fd*/);
71 extern int fwatch_update(fwatch */*f*/, const char */*name*/);
72 extern int fwatch_updatefd(fwatch */*f*/, int /*fd*/);
74 /*----- That's all, folks -------------------------------------------------*/