xref: /freebsd/sbin/devfs/extern.h (revision b3e76948)
1a1dc2096SDima Dorfman /*-
24d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
31de7b4b8SPedro F. Giffuni  *
4a1dc2096SDima Dorfman  * Copyright (c) 2002 Dima Dorfman.
5a1dc2096SDima Dorfman  * All rights reserved.
6a1dc2096SDima Dorfman  *
7a1dc2096SDima Dorfman  * Redistribution and use in source and binary forms, with or without
8a1dc2096SDima Dorfman  * modification, are permitted provided that the following conditions
9a1dc2096SDima Dorfman  * are met:
10a1dc2096SDima Dorfman  * 1. Redistributions of source code must retain the above copyright
11a1dc2096SDima Dorfman  *    notice, this list of conditions and the following disclaimer.
12a1dc2096SDima Dorfman  * 2. Redistributions in binary form must reproduce the above copyright
13a1dc2096SDima Dorfman  *    notice, this list of conditions and the following disclaimer in the
14a1dc2096SDima Dorfman  *    documentation and/or other materials provided with the distribution.
15a1dc2096SDima Dorfman  *
16a1dc2096SDima Dorfman  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17a1dc2096SDima Dorfman  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18a1dc2096SDima Dorfman  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19a1dc2096SDima Dorfman  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20a1dc2096SDima Dorfman  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21a1dc2096SDima Dorfman  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22a1dc2096SDima Dorfman  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23a1dc2096SDima Dorfman  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24a1dc2096SDima Dorfman  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25a1dc2096SDima Dorfman  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26a1dc2096SDima Dorfman  * SUCH DAMAGE.
27a1dc2096SDima Dorfman  */
28a1dc2096SDima Dorfman 
29a1dc2096SDima Dorfman #ifndef __DEVFS_H__
30a1dc2096SDima Dorfman #define	__DEVFS_H__
31a1dc2096SDima Dorfman 
32a1dc2096SDima Dorfman #include <fs/devfs/devfs.h>
33a1dc2096SDima Dorfman 
34a1dc2096SDima Dorfman struct intstr {
35a1dc2096SDima Dorfman 	const char *s;
36a1dc2096SDima Dorfman 	int i;
37a1dc2096SDima Dorfman };
38a1dc2096SDima Dorfman 
39a1dc2096SDima Dorfman typedef int (command_t)(int, char **);
40a1dc2096SDima Dorfman struct cmd {
41a1dc2096SDima Dorfman 	const char *name;
42a1dc2096SDima Dorfman 	command_t *handler;
43a1dc2096SDima Dorfman };
44d77f297fSStefan Farfeleder typedef struct cmd ctbl_t[];
45a1dc2096SDima Dorfman 
46a1dc2096SDima Dorfman command_t rule_main, ruleset_main;
47a1dc2096SDima Dorfman 
48a1dc2096SDima Dorfman int atonum(const char *, uint16_t *);
49a1dc2096SDima Dorfman int eatoi(const char *);
50a1dc2096SDima Dorfman uint16_t eatonum(const char *);
51072af151SDima Dorfman size_t efgetln(FILE *, char **);
52072af151SDima Dorfman void tokenize(const char *, int *, char ***);
53a1dc2096SDima Dorfman void usage(void) __dead2;
54a1dc2096SDima Dorfman 
55a1dc2096SDima Dorfman extern int mpfd;		/* Mount-point file descriptor. */
56a1dc2096SDima Dorfman 
57a1dc2096SDima Dorfman #endif /* !__DEVFS_H__ */
58