xref: /minix3/usr.bin/menuc/defs.h (revision 84d9c625bfea59e274550651111ae9edfdc40fbd)
1*84d9c625SLionel Sambuc /*	$NetBSD: defs.h,v 1.10 2013/10/18 20:19:36 christos Exp $	 */
2525a267eSThomas Cort 
3525a267eSThomas Cort /*
4525a267eSThomas Cort  * Copyright 1997 Piermont Information Systems Inc.
5525a267eSThomas Cort  * All rights reserved.
6525a267eSThomas Cort  *
7525a267eSThomas Cort  * Written by Philip A. Nelson for Piermont Information Systems Inc.
8525a267eSThomas Cort  *
9525a267eSThomas Cort  * Redistribution and use in source and binary forms, with or without
10525a267eSThomas Cort  * modification, are permitted provided that the following conditions
11525a267eSThomas Cort  * are met:
12525a267eSThomas Cort  * 1. Redistributions of source code must retain the above copyright
13525a267eSThomas Cort  *    notice, this list of conditions and the following disclaimer.
14525a267eSThomas Cort  * 2. Redistributions in binary form must reproduce the above copyright
15525a267eSThomas Cort  *    notice, this list of conditions and the following disclaimer in the
16525a267eSThomas Cort  *    documentation and/or other materials provided with the distribution.
17525a267eSThomas Cort  * 3. The name of Piermont Information Systems Inc. may not be used to endorse
18525a267eSThomas Cort  *    or promote products derived from this software without specific prior
19525a267eSThomas Cort  *    written permission.
20525a267eSThomas Cort  *
21525a267eSThomas Cort  * THIS SOFTWARE IS PROVIDED BY PIERMONT INFORMATION SYSTEMS INC. ``AS IS''
22525a267eSThomas Cort  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23525a267eSThomas Cort  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24525a267eSThomas Cort  * ARE DISCLAIMED. IN NO EVENT SHALL PIERMONT INFORMATION SYSTEMS INC. BE
25525a267eSThomas Cort  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26525a267eSThomas Cort  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27525a267eSThomas Cort  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28525a267eSThomas Cort  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29525a267eSThomas Cort  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30525a267eSThomas Cort  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
31525a267eSThomas Cort  * THE POSSIBILITY OF SUCH DAMAGE.
32525a267eSThomas Cort  *
33525a267eSThomas Cort  */
34525a267eSThomas Cort 
35525a267eSThomas Cort /* defs.h: definitions needed for the menu system. */
36525a267eSThomas Cort 
37525a267eSThomas Cort #if HAVE_NBTOOL_CONFIG_H
38525a267eSThomas Cort #include "nbtool_config.h"
39525a267eSThomas Cort #endif
40525a267eSThomas Cort 
41525a267eSThomas Cort #include <stdio.h>
42525a267eSThomas Cort 
43525a267eSThomas Cort #include "mdb.h"
44525a267eSThomas Cort 
45525a267eSThomas Cort #ifdef MAIN
46525a267eSThomas Cort #define EXTERN
47525a267eSThomas Cort #define INIT(x) = x
48525a267eSThomas Cort #else
49525a267eSThomas Cort #define EXTERN extern
50525a267eSThomas Cort #define INIT(x)
51525a267eSThomas Cort #endif
52525a267eSThomas Cort 
53*84d9c625SLionel Sambuc #ifndef TRUE
54525a267eSThomas Cort #define TRUE	1
55*84d9c625SLionel Sambuc #endif
56*84d9c625SLionel Sambuc #ifndef FALSE
57525a267eSThomas Cort #define FALSE	0
58*84d9c625SLionel Sambuc #endif
59525a267eSThomas Cort /* Global variables .. to be defined in main.c, extern elsewhere. */
60525a267eSThomas Cort 
61525a267eSThomas Cort EXTERN char *prog_name;
62525a267eSThomas Cort EXTERN char *src_name;
63525a267eSThomas Cort EXTERN char *out_name INIT("menu_defs");
64525a267eSThomas Cort EXTERN char *sys_name INIT("menu_sys.def");
65525a267eSThomas Cort 
66525a267eSThomas Cort EXTERN int do_dynamic INIT(0);
67525a267eSThomas Cort EXTERN int do_msgxlat INIT(0);
68525a267eSThomas Cort EXTERN int line_no INIT(1);
69525a267eSThomas Cort EXTERN int had_errors INIT(FALSE);
70525a267eSThomas Cort EXTERN int max_strlen INIT(1);
71525a267eSThomas Cort 
72525a267eSThomas Cort EXTERN id_rec *root INIT(NULL);
73525a267eSThomas Cort 
74525a267eSThomas Cort EXTERN struct menu_info default_info;
75525a267eSThomas Cort EXTERN id_rec default_menu;
76525a267eSThomas Cort 
77525a267eSThomas Cort EXTERN action error_act INIT({NULL});
78525a267eSThomas Cort 
79525a267eSThomas Cort /* Prototypes. */
80525a267eSThomas Cort 
81525a267eSThomas Cort /* From util.c */
82525a267eSThomas Cort void yyerror(const char *, ...)
83525a267eSThomas Cort      __attribute__((__format__(__printf__, 1, 2)));
84525a267eSThomas Cort void buff_add_ch(char);
85525a267eSThomas Cort char *buff_copy(void);
86525a267eSThomas Cort 
87525a267eSThomas Cort /* from scan.l */
88525a267eSThomas Cort int yylex(void);
89525a267eSThomas Cort 
90525a267eSThomas Cort /* from parse.y */
91525a267eSThomas Cort int yyparse(void);
92525a267eSThomas Cort 
93525a267eSThomas Cort /* Vars not defined in main.c */
94525a267eSThomas Cort extern FILE *yyin;
95525a267eSThomas Cort 
96525a267eSThomas Cort /* from avl.c */
97525a267eSThomas Cort id_rec *find_id(id_rec *, char *);
98525a267eSThomas Cort int insert_id(id_rec **, id_rec *);
99525a267eSThomas Cort 
100525a267eSThomas Cort /* from mdb.c */
101525a267eSThomas Cort id_rec *get_menu(char *);
102525a267eSThomas Cort void check_defined(void);
103525a267eSThomas Cort void write_menu_file(char *);
104525a267eSThomas Cort 
105