PageRenderTime 9ms CodeModel.GetById 2ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 1ms

/contrib/ntp/include/ntp_filegen.h

https://bitbucket.org/freebsd/freebsd-head/
C++ Header | 51 lines | 23 code | 8 blank | 20 comment | 0 complexity | 2e80cacd3ee8c355491b82451bbe3aba MD5 | raw file
 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
37typedef 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
48extern	void	filegen_setup	P((FILEGEN *, u_long));
49extern	void	filegen_config	P((FILEGEN *, char *, u_int, u_int));
50extern	FILEGEN *filegen_get	P((char *));
51extern	void	filegen_register P((char *, const char *, FILEGEN *));