2 * (c) Copyright 1992, 1993 by Panagiotis Tsirigotis
3 * All rights reserved. The file named COPYRIGHT specifies the terms
4 * and conditions for redistribution.
9 * $Id: filelog.h,v 1.2 2003/03/09 19:29:21 steveg Exp $
18 * The file can be either open or closed.
19 * When the file is closed, the state is always FL_CLOSED.
20 * When the file is open, the state is:
21 * FL_OPEN: if everything is ok
22 * FL_SIZE: if the hard limit was exceeded
23 * FL_ERROR: if an error occured
25 typedef enum { FL_CLOSED = 0, FL_OPEN, FL_SIZE, FL_ERROR } filelog_state_e ;
30 filelog_state_e fl_state ;
31 int fl_error ; /* error code when in FL_ERROR */
32 bool_int fl_size_control ; /* enabled or not */
33 bool_int fl_issued_warning ; /* when the soft limit was exceeded */
34 unsigned fl_size ; /* current size */
35 unsigned fl_soft_limit ;
36 unsigned fl_hard_limit ;
39 #define FILELOG_ENABLE_SIZE_CONTROL( flp ) (flp)->fl_size_control = TRUE
40 #define FILELOG_DISABLE_SIZE_CONTROL( flp ) (flp)->fl_size_control = FALSE
41 #define FILELOG_SIZE_CONTROL( flp ) ( (flp)->fl_size_control )
43 #define FILELOG( xp ) ((struct filelog_s *)xp->xl_data)