4 * Implements structures used for variant symlink support.
6 * $DragonFly: src/sys/sys/varsym.h,v 1.3 2005/01/14 02:25:08 joerg Exp $
10 #define _SYS_VARSYM_H_
12 /*#if defined(_KERNEL) || defined(_KERNEL_STRUCTURES) FUTURE */
16 #include <sys/queue.h> /* TAILQ_* macros */
20 int vs_refs
; /* a lot of sharing occurs */
22 char *vs_name
; /* variable name */
23 char *vs_data
; /* variable contents */
26 typedef struct varsym
*varsym_t
;
29 TAILQ_ENTRY(varsyment
) ve_entry
;
34 TAILQ_HEAD(, varsyment
) vx_queue
;
38 #endif /* _KERNEL || _KERNEL_STRUCTURES */
43 #define VARSYM_PRISON 4 /* used internally */
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)
50 #define MAXVARSYM_NAME 64
51 #define MAXVARSYM_DATA 256
52 #define MAXVARSYM_SET 8192
56 varsym_t
varsymfind(int mask
, const char *name
, int namelen
);
57 int varsymmake(int level
, const char *name
, const char *data
);
58 void varsymdrop(varsym_t var
);
59 void varsymset_init(struct varsymset
*varsymset
, struct varsymset
*copy
);
60 void varsymset_clean(struct varsymset
*varsymset
);
61 int varsymreplace(char *cp
, int linklen
, int maxlen
);