Change sendfile() to use the new m_ext callback scheme for cleaning up after
[dragonfly.git] / sys / sys / varsym.h
CommitLineData
98a7f915
MD
1/*
2 * SYS/VARSYM.H
3 *
4 * Implements structures used for variant symlink support.
5 *
063147e5 6 * $DragonFly: src/sys/sys/varsym.h,v 1.2 2003/11/09 20:29:57 dillon 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
43
44#define VARSYM_PROC_MASK (1 << VARSYM_PROC)
45#define VARSYM_USER_MASK (1 << VARSYM_USER)
46#define VARSYM_SYS_MASK (1 << VARSYM_SYS)
47#define VARSYM_ALL_MASK (VARSYM_PROC_MASK|VARSYM_USER_MASK|VARSYM_SYS_MASK)
48
49#define MAXVARSYM_NAME 64
50#define MAXVARSYM_DATA 256
51#define MAXVARSYM_SET 8192
52
53#ifdef _KERNEL
54
55varsym_t varsymfind(int mask, const char *name, int namelen);
56int varsymmake(int level, const char *name, const char *data);
57void varsymdrop(varsym_t var);
58void varsymset_init(struct varsymset *varsymset, struct varsymset *copy);
59void varsymset_clean(struct varsymset *varsymset);
063147e5 60int varsymreplace(char *cp, int linklen, int maxlen);
98a7f915
MD
61
62#endif /* _KERNEL */
63
64#endif