xref: /minix3/usr.bin/msgc/defs.h (revision 84d9c625bfea59e274550651111ae9edfdc40fbd)
1*84d9c625SLionel Sambuc /*	$NetBSD: defs.h,v 1.6 2013/10/18 20:19:36 christos Exp $	*/
2d44a5ed1SThomas Cort 
3d44a5ed1SThomas Cort /*
4d44a5ed1SThomas Cort  * Copyright 1997 Piermont Information Systems Inc.
5d44a5ed1SThomas Cort  * All rights reserved.
6d44a5ed1SThomas Cort  *
7d44a5ed1SThomas Cort  * Written by Philip A. Nelson for Piermont Information Systems Inc.
8d44a5ed1SThomas Cort  *
9d44a5ed1SThomas Cort  * Redistribution and use in source and binary forms, with or without
10d44a5ed1SThomas Cort  * modification, are permitted provided that the following conditions
11d44a5ed1SThomas Cort  * are met:
12d44a5ed1SThomas Cort  * 1. Redistributions of source code must retain the above copyright
13d44a5ed1SThomas Cort  *    notice, this list of conditions and the following disclaimer.
14d44a5ed1SThomas Cort  * 2. Redistributions in binary form must reproduce the above copyright
15d44a5ed1SThomas Cort  *    notice, this list of conditions and the following disclaimer in the
16d44a5ed1SThomas Cort  *    documentation and/or other materials provided with the distribution.
17d44a5ed1SThomas Cort  * 3. The name of Piermont Information Systems Inc. may not be used to endorse
18d44a5ed1SThomas Cort  *    or promote products derived from this software without specific prior
19d44a5ed1SThomas Cort  *    written permission.
20d44a5ed1SThomas Cort  *
21d44a5ed1SThomas Cort  * THIS SOFTWARE IS PROVIDED BY PIERMONT INFORMATION SYSTEMS INC. ``AS IS''
22d44a5ed1SThomas Cort  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23d44a5ed1SThomas Cort  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24d44a5ed1SThomas Cort  * ARE DISCLAIMED. IN NO EVENT SHALL PIERMONT INFORMATION SYSTEMS INC. BE
25d44a5ed1SThomas Cort  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26d44a5ed1SThomas Cort  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27d44a5ed1SThomas Cort  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28d44a5ed1SThomas Cort  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29d44a5ed1SThomas Cort  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30d44a5ed1SThomas Cort  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
31d44a5ed1SThomas Cort  * THE POSSIBILITY OF SUCH DAMAGE.
32d44a5ed1SThomas Cort  *
33d44a5ed1SThomas Cort  */
34d44a5ed1SThomas Cort 
35d44a5ed1SThomas Cort /* defs.h: definitions needed for the message system. */
36d44a5ed1SThomas Cort 
37d44a5ed1SThomas Cort #if HAVE_NBTOOL_CONFIG_H
38d44a5ed1SThomas Cort #include "nbtool_config.h"
39d44a5ed1SThomas Cort #endif
40d44a5ed1SThomas Cort 
41d44a5ed1SThomas Cort #include <stdio.h>
42d44a5ed1SThomas Cort #include "msgdb.h"
43d44a5ed1SThomas Cort 
44d44a5ed1SThomas Cort #ifdef MAIN
45d44a5ed1SThomas Cort #define EXTERN
46d44a5ed1SThomas Cort #define INIT(x) = x
47d44a5ed1SThomas Cort #else
48d44a5ed1SThomas Cort #define EXTERN extern
49d44a5ed1SThomas Cort #define INIT(x)
50d44a5ed1SThomas Cort #endif
51d44a5ed1SThomas Cort 
52*84d9c625SLionel Sambuc #ifndef TRUE
53d44a5ed1SThomas Cort #define TRUE	1
54*84d9c625SLionel Sambuc #endif
55*84d9c625SLionel Sambuc #ifndef FALSE
56d44a5ed1SThomas Cort #define FALSE	0
57*84d9c625SLionel Sambuc #endif
58d44a5ed1SThomas Cort 
59d44a5ed1SThomas Cort /* Global variables .. to be defined in main.c, extern elsewhere. */
60d44a5ed1SThomas Cort 
61d44a5ed1SThomas Cort EXTERN char *prog_name;
62d44a5ed1SThomas Cort EXTERN char *src_name;
63d44a5ed1SThomas Cort EXTERN char *out_name INIT("msg_defs");
64d44a5ed1SThomas Cort EXTERN char *sys_name INIT("msg_sys.def");
65d44a5ed1SThomas Cort 
66d44a5ed1SThomas Cort EXTERN int line_no INIT(1);
67d44a5ed1SThomas Cort EXTERN int had_errors INIT(FALSE);
68d44a5ed1SThomas Cort EXTERN int max_strlen INIT(1);
69d44a5ed1SThomas Cort 
70d44a5ed1SThomas Cort EXTERN id_rec *root INIT(NULL);
71d44a5ed1SThomas Cort 
72d44a5ed1SThomas Cort /* Prototypes. */
73d44a5ed1SThomas Cort 
74d44a5ed1SThomas Cort /* From util.c */
75d44a5ed1SThomas Cort void yyerror(const char *, ...);
76d44a5ed1SThomas Cort void buff_add_ch(char);
77d44a5ed1SThomas Cort char *buff_copy(void);
78d44a5ed1SThomas Cort 
79d44a5ed1SThomas Cort /* From avl.c */
80d44a5ed1SThomas Cort id_rec *find_id(id_rec *, char *);
81d44a5ed1SThomas Cort int insert_id(id_rec **, id_rec *);
82d44a5ed1SThomas Cort 
83d44a5ed1SThomas Cort /* from scan.l */
84d44a5ed1SThomas Cort int yylex(void);
85d44a5ed1SThomas Cort 
86d44a5ed1SThomas Cort /* from parse.y */
87d44a5ed1SThomas Cort int yyparse(void);
88d44a5ed1SThomas Cort 
89d44a5ed1SThomas Cort /* Vars not defined in main.c */
90d44a5ed1SThomas Cort extern FILE *yyin;
91d44a5ed1SThomas Cort 
92d44a5ed1SThomas Cort /* from mdb.c */
93d44a5ed1SThomas Cort void define_msg(char *, char *);
94d44a5ed1SThomas Cort void write_msg_file(void);
95