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