File: config.h

package info (click to toggle)
sn 0.3.8-12
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 976 kB
  • sloc: ansic: 9,255; sh: 467; makefile: 210
file content (101 lines) | stat: -rw-r--r-- 2,181 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/*
 * This file is part of the sn package.
 * Distribution of sn is covered by the GNU GPL. See file COPYING.
 * Copyright � 1998-2000 Harold Tay.
 * Copyright � 2000- Patrik R�dman.
 */

#ifndef CONFIG_H
#define CONFIG_H

/*
 *  Before editing this, edit Makefile for SNROOT.
 */

/*
 * How many articles per file.  10 is good.  The theory is:
 * ARTSPERFILE = (system page size in bytes)/(ave. size of news header)
 * This is also the granularity of expiration; a multiple of this
 * many articles will be expired at a time.  Do NOT make it 1;
 * things will break.
 */

#define ARTSPERFILE 10

/*
 * How large the hash table should be.  Currently this size is
 * static.  Figure about 1000 articles per group, so the following
 * should be good for 10-40 groups.
 */

#define DH_SIZE 10240

/*
 * Default expiration age, in seconds.
 */

#define DEFAULT_EXP 60*60*24*7

/*
 * MAX_POST_AGE is the time in seconds a posting can remain unposted
 * before it is deleted.  Refers to global groups only.
 */

#define MAX_POST_AGE 60*60*24*7

/*
 * Nothing more to edit for general configuration.
 */

#define version() writef(2, "%s version " VERSION /*" %s"*/ "\n", progname/*, rcsid*/)
#define log_with_pid() \
do { char * p; int i; \
  if ((p = malloc(i = strlen(progname) + 32))) \
  formats(p, i-1, "%s[%u]", progname, getpid()); \
  progname = p; } while (0)

/*
 * Alignment on your machine.  For i386, leave at 4.  For others, I
 * don't know.
 */

#define ALLO_ALIGNMENT 4

/*
 * You can stop editing now.
 */

#ifdef __sun__   /* For Solaris */
#define DONT_HAVE_DIRFD
#endif

extern int debug;

#define LOG log_
#define LOG1 if (debug >= 1) log_
#define LOG2 if (debug >= 2) log_
#define LOG3 if (debug >= 3) log_
#define FAIL fail

#include <sys/param.h>

#ifndef NAME_MAX   /* For Solaris */
#define NAME_MAX (MAXNAMELEN - 1)
#endif
#if NAME_MAX > 512
#define GROUPNAMELEN 512
#else
#define GROUPNAMELEN NAME_MAX
#endif

#ifndef MAP_FAILED   /* For Linux libc5 and HP-UX 10 */
#define MAP_FAILED ((void *) -1)
#endif

#define JUNK_GROUP "=junk"

#undef FALSE   /* Mac OS X apparently defines these */
#undef TRUE
typedef enum { FALSE, TRUE } bool;

#endif /* CONFIG_H */