amd64: varsym: increase varsym set size limit
[dragonfly.git] / sys / sys / varsym.h
CommitLineData
98a7f915
MD
1/*
2 * SYS/VARSYM.H
3 *
4 * Implements structures used for variant symlink support.
5 *
3df22e80 6 * $DragonFly: src/sys/sys/varsym.h,v 1.7 2008/02/23 00:59:23 swildner Exp $
98a7f915
MD
7 */
8
9#ifndef _SYS_VARSYM_H_
10#define _SYS_VARSYM_H_
11
12/*#if defined(_KERNEL) || defined(_KERNEL_STRUCTURES) FUTURE */
13#if 1
14
15#ifndef _SYS_QUEUE_H_
16#include <sys/queue.h> /* TAILQ_* macros */
17#endif
18
19struct varsym {
20 int vs_refs; /* a lot of sharing occurs */
21 int vs_namelen;
22 char *vs_name; /* variable name */
23 char *vs_data; /* variable contents */
24};
25
26typedef struct varsym *varsym_t;
27
28struct varsyment {
29 TAILQ_ENTRY(varsyment) ve_entry;
30 varsym_t ve_sym;
31};
32
33struct varsymset {
34 TAILQ_HEAD(, varsyment) vx_queue;
35 int vx_setsize;
36};
37
38#endif /* _KERNEL || _KERNEL_STRUCTURES */
39
40#define VARSYM_PROC 1
41#define VARSYM_USER 2
42#define VARSYM_SYS 3
dbc282df 43#define VARSYM_PRISON 4 /* used internally */
98a7f915
MD
44
45#define VARSYM_PROC_MASK (1 << VARSYM_PROC)
46#define VARSYM_USER_MASK (1 << VARSYM_USER)
47#define VARSYM_SYS_MASK (1 << VARSYM_SYS)
48#define VARSYM_ALL_MASK (VARSYM_PROC_MASK|VARSYM_USER_MASK|VARSYM_SYS_MASK)
49
50#define MAXVARSYM_NAME 64
51#define MAXVARSYM_DATA 256
92673705 52#define MAXVARSYM_SET 16384
98a7f915
MD
53
54#ifdef _KERNEL
55
56varsym_t varsymfind(int mask, const char *name, int namelen);
57int varsymmake(int level, const char *name, const char *data);
58void varsymdrop(varsym_t var);
59void varsymset_init(struct varsymset *varsymset, struct varsymset *copy);
60void varsymset_clean(struct varsymset *varsymset);
063147e5 61int varsymreplace(char *cp, int linklen, int maxlen);
98a7f915 62
3df22e80
SW
63#endif /* _KERNEL */
64
98a7f915 65#endif