4 * ntp_filegen.h,v 3.9 1996/12/01 16:02:45 kardel Exp
6 * definitions for NTP file generations support
9 * Copyright (C) 1992, 1996 by Rainer Pruy
10 * Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
12 * This code may be modified and used freely
13 * provided the credits remain intact.
16 #include "ntp_types.h"
19 * supported file generation types
22 #define FILEGEN_NONE 255 /* no generations - use plain file name */
23 #define FILEGEN_PID 1 /* one filegen per process incarnation */
24 #define FILEGEN_DAY 2 /* one filegen per day */
25 #define FILEGEN_WEEK 3 /* one filegen per week */
26 #define FILEGEN_MONTH 4 /* one filegen per month */
27 #define FILEGEN_YEAR 5 /* one filegen per year */
28 #define FILEGEN_AGE 6 /* change filegen each FG_AGE_SECS */
31 * supported file generation flags
34 #define FGEN_FLAG_LINK 0x01 /* make a link to base name */
36 #define FGEN_FLAG_ENABLED 0x80 /* set this to really create files */
37 /* without this, open is suppressed */
39 typedef struct FILEGEN
41 FILE * fp
; /* file referring to current generation */
42 const char * prefix
; /* filename prefix and basename to be used*/
43 char * basename
; /* for constructing filename of generation file */
44 /* WARNING: must be malloced !!! will be fed to free()*/
45 u_long id
; /* id of current generation */
46 u_char type
; /* type of file generation */
47 u_char flag
; /* flags modifying processing of file generation */
50 extern void filegen_setup (FILEGEN
*, u_long
);
51 extern void filegen_config (FILEGEN
*, const char *, u_int
, u_int
);
52 extern FILEGEN
*filegen_get (const char *);
53 extern void filegen_register (const char *, const char *, FILEGEN
*);
55 extern void filegen_unregister(char *);