Blame include/parse_subs.h

Packit 8480eb
/* ----------------------------------------------------------------------- *
Packit 8480eb
 *   
Packit 8480eb
 *  parse_subs.c - misc parser subroutines
Packit 8480eb
 *                automounter map
Packit 8480eb
 * 
Packit 8480eb
 *   Copyright 1997 Transmeta Corporation - All Rights Reserved
Packit 8480eb
 *   Copyright 2000 Jeremy Fitzhardinge <jeremy@goop.org>
Packit 8480eb
 *   Copyright 2004-2006 Ian Kent <raven@themaw.net>
Packit 8480eb
 *
Packit 8480eb
 *   This program is free software; you can redistribute it and/or modify
Packit 8480eb
 *   it under the terms of the GNU General Public License as published by
Packit 8480eb
 *   the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139,
Packit 8480eb
 *   USA; either version 2 of the License, or (at your option) any later
Packit 8480eb
 *   version; incorporated herein by reference.
Packit 8480eb
 *
Packit 8480eb
 * ----------------------------------------------------------------------- */
Packit 8480eb
Packit 8480eb
#ifndef PARSE_SUBS_H
Packit 8480eb
#define PARSE_SUBS_H
Packit 8480eb
Packit 8480eb
#define PROXIMITY_ERROR		0x0000
Packit 8480eb
#define PROXIMITY_LOCAL         0x0001
Packit 8480eb
#define PROXIMITY_SUBNET        0x0002
Packit 8480eb
#define PROXIMITY_NET           0x0004
Packit 8480eb
#define PROXIMITY_OTHER         0x0008
Packit 8480eb
#define PROXIMITY_UNSUPPORTED   0x0010
Packit 8480eb
Packit 8480eb
#define SEL_ARCH		0x00000001
Packit 8480eb
#define SEL_KARCH		0x00000002
Packit 8480eb
#define SEL_OS			0x00000004
Packit 8480eb
#define SEL_OSVER		0x00000008
Packit 8480eb
#define SEL_FULL_OS		0x00000010
Packit 8480eb
#define SEL_VENDOR		0x00000020
Packit 8480eb
#define SEL_HOST		0x00000040
Packit 8480eb
#define SEL_HOSTD		0x00000080
Packit 8480eb
#define SEL_XHOST		0x00000100
Packit 8480eb
#define SEL_DOMAIN		0x00000200
Packit 8480eb
#define SEL_BYTE		0x00000400
Packit 8480eb
#define SEL_CLUSTER		0x00000800
Packit 8480eb
#define SEL_NETGRP		0x00001000
Packit 8480eb
#define SEL_NETGRPD		0x00002000
Packit 8480eb
#define SEL_IN_NETWORK		0x00004000
Packit 8480eb
#define SEL_UID			0x00008000
Packit 8480eb
#define SEL_GID			0x00010000
Packit 8480eb
#define SEL_KEY			0x00020000
Packit 8480eb
#define SEL_MAP			0x00040000
Packit 8480eb
#define SEL_PATH		0x00080000
Packit 8480eb
#define SEL_EXISTS		0x00100000
Packit 8480eb
#define SEL_AUTODIR		0x00200000
Packit 8480eb
#define SEL_DOLLAR		0x00400000
Packit 8480eb
#define SEL_TRUE		0x00800000
Packit 8480eb
#define SEL_FALSE		0x01000000
Packit 8480eb
Packit 8480eb
#define SEL_COMP_NONE		0x0000
Packit 8480eb
#define SEL_COMP_EQUAL		0x0001
Packit 8480eb
#define SEL_COMP_NOTEQUAL	0x0002
Packit 8480eb
#define SEL_COMP_NOT		0x0004
Packit 8480eb
Packit 8480eb
#define SEL_FLAG_MACRO		0x0001
Packit 8480eb
#define SEL_FLAG_FUNC1		0x0002
Packit 8480eb
#define SEL_FLAG_FUNC2		0x0004
Packit 8480eb
#define SEL_FLAG_STR		0x0100
Packit 8480eb
#define SEL_FLAG_NUM		0x0200
Packit 8480eb
#define SEL_FLAG_BOOL		0x0400
Packit 8480eb
Packit 8480eb
#define SEL_FLAGS_TYPE_MASK	0x00FF
Packit 8480eb
#define SEL_FLAGS_VALUE_MASK	0xFF00
Packit 8480eb
#define SEL_FREE_VALUE_MASK	(SEL_FLAG_MACRO|SEL_FLAG_STR|SEL_FLAG_NUM)
Packit 8480eb
#define SEL_FREE_ARG1_MASK	(SEL_FLAG_FUNC1)
Packit 8480eb
#define SEL_FREE_ARG2_MASK	(SEL_FLAG_FUNC2)
Packit 8480eb
Packit 8480eb
struct type_compare {
Packit 8480eb
	char	*value;
Packit 8480eb
};
Packit 8480eb
Packit 8480eb
struct type_function {
Packit 8480eb
	char *arg1;
Packit 8480eb
	char *arg2;
Packit 8480eb
};
Packit 8480eb
Packit 8480eb
struct sel {
Packit 8480eb
	unsigned long selector;
Packit 8480eb
	const char *name;
Packit 8480eb
	unsigned int flags;
Packit 8480eb
	struct sel *next;
Packit 8480eb
};
Packit 8480eb
Packit 8480eb
struct selector {
Packit 8480eb
	struct sel *sel;
Packit 8480eb
	unsigned int compare;
Packit 8480eb
Packit 8480eb
	union {
Packit 8480eb
		struct type_compare	comp;
Packit 8480eb
		struct type_function	func;
Packit 8480eb
	};
Packit 8480eb
Packit 8480eb
	struct selector *next;
Packit 8480eb
};
Packit 8480eb
Packit 8480eb
void sel_hash_init(void);
Packit 8480eb
struct sel *sel_lookup(const char *);
Packit 8480eb
struct selector *get_selector(char *);
Packit 8480eb
void free_selector(struct selector *);
Packit 8480eb
Packit 8480eb
struct mapent;
Packit 8480eb
Packit 8480eb
struct map_type_info {
Packit 8480eb
	char *type;
Packit 8480eb
	char *format;
Packit 8480eb
	char *map;
Packit 8480eb
};
Packit 8480eb
Packit 8480eb
unsigned int get_proximity(struct sockaddr *);
Packit 8480eb
unsigned int get_network_proximity(const char *);
Packit 8480eb
unsigned int in_network(char *);
Packit 8480eb
struct mapent *match_cached_key(struct autofs_point *, const char *,
Packit 8480eb
				struct map_source *, const char *);
Packit 8480eb
const char *skipspace(const char *);
Packit 8480eb
int check_colon(const char *);
Packit 8480eb
int chunklen(const char *, int);
Packit 8480eb
int strmcmp(const char *, const char *, int);
Packit 8480eb
char *dequote(const char *, int, unsigned int);
Packit 8480eb
int span_space(const char *, unsigned int);
Packit 8480eb
char *sanitize_path(const char *, int, unsigned int, unsigned int);
Packit 8480eb
char *merge_options(const char *, const char *);
Packit 8480eb
int expandamdent(const char *, char *, const struct substvar *);
Packit 8480eb
int expand_selectors(struct autofs_point *, const char *, char **, struct substvar *);
Packit 8480eb
int construct_argv(char *, char **, char ***);
Packit 8480eb
void free_map_type_info(struct map_type_info *);
Packit 8480eb
struct map_type_info *parse_map_type_info(const char *);
Packit 8480eb
Packit 8480eb
#endif