xref: /netbsd-src/usr.bin/msgc/defs.h (revision 9f630f8bc1d6147c8ba5567291e1b4f2cb4f6f80)
1*9f630f8bSchristos /*	$NetBSD: defs.h,v 1.6 2013/10/18 20:19:36 christos Exp $	*/
2584c2298Sphil 
3584c2298Sphil /*
4584c2298Sphil  * Copyright 1997 Piermont Information Systems Inc.
5584c2298Sphil  * All rights reserved.
6584c2298Sphil  *
7584c2298Sphil  * Written by Philip A. Nelson for Piermont Information Systems Inc.
8584c2298Sphil  *
9584c2298Sphil  * Redistribution and use in source and binary forms, with or without
10584c2298Sphil  * modification, are permitted provided that the following conditions
11584c2298Sphil  * are met:
12584c2298Sphil  * 1. Redistributions of source code must retain the above copyright
13584c2298Sphil  *    notice, this list of conditions and the following disclaimer.
14584c2298Sphil  * 2. Redistributions in binary form must reproduce the above copyright
15584c2298Sphil  *    notice, this list of conditions and the following disclaimer in the
16584c2298Sphil  *    documentation and/or other materials provided with the distribution.
1740c86e8bSmbalmer  * 3. The name of Piermont Information Systems Inc. may not be used to endorse
18584c2298Sphil  *    or promote products derived from this software without specific prior
19584c2298Sphil  *    written permission.
20584c2298Sphil  *
21584c2298Sphil  * THIS SOFTWARE IS PROVIDED BY PIERMONT INFORMATION SYSTEMS INC. ``AS IS''
22584c2298Sphil  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23584c2298Sphil  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24584c2298Sphil  * ARE DISCLAIMED. IN NO EVENT SHALL PIERMONT INFORMATION SYSTEMS INC. BE
25584c2298Sphil  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26584c2298Sphil  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27584c2298Sphil  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28584c2298Sphil  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29584c2298Sphil  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30584c2298Sphil  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
31584c2298Sphil  * THE POSSIBILITY OF SUCH DAMAGE.
32584c2298Sphil  *
33584c2298Sphil  */
34584c2298Sphil 
35584c2298Sphil /* defs.h: definitions needed for the message system. */
36584c2298Sphil 
37171d6532Slukem #if HAVE_NBTOOL_CONFIG_H
38171d6532Slukem #include "nbtool_config.h"
39a328e341Stv #endif
40a328e341Stv 
41584c2298Sphil #include <stdio.h>
42584c2298Sphil #include "msgdb.h"
43584c2298Sphil 
44584c2298Sphil #ifdef MAIN
45584c2298Sphil #define EXTERN
46584c2298Sphil #define INIT(x) = x
47584c2298Sphil #else
48584c2298Sphil #define EXTERN extern
49584c2298Sphil #define INIT(x)
50584c2298Sphil #endif
51584c2298Sphil 
52*9f630f8bSchristos #ifndef TRUE
53584c2298Sphil #define TRUE	1
54*9f630f8bSchristos #endif
55*9f630f8bSchristos #ifndef FALSE
56584c2298Sphil #define FALSE	0
57*9f630f8bSchristos #endif
58584c2298Sphil 
59584c2298Sphil /* Global variables .. to be defined in main.c, extern elsewhere. */
60584c2298Sphil 
61584c2298Sphil EXTERN char *prog_name;
62584c2298Sphil EXTERN char *src_name;
63584c2298Sphil EXTERN char *out_name INIT("msg_defs");
64584c2298Sphil EXTERN char *sys_name INIT("msg_sys.def");
65584c2298Sphil 
66584c2298Sphil EXTERN int line_no INIT(1);
67584c2298Sphil EXTERN int had_errors INIT(FALSE);
68584c2298Sphil EXTERN int max_strlen INIT(1);
69584c2298Sphil 
70584c2298Sphil EXTERN id_rec *root INIT(NULL);
71584c2298Sphil 
72584c2298Sphil /* Prototypes. */
73584c2298Sphil 
74584c2298Sphil /* From util.c */
75584c2298Sphil void yyerror(const char *, ...);
76584c2298Sphil void buff_add_ch(char);
77584c2298Sphil char *buff_copy(void);
78584c2298Sphil 
79584c2298Sphil /* From avl.c */
802fe04889Sitojun id_rec *find_id(id_rec *, char *);
812fe04889Sitojun int insert_id(id_rec **, id_rec *);
82584c2298Sphil 
83584c2298Sphil /* from scan.l */
84584c2298Sphil int yylex(void);
85584c2298Sphil 
86584c2298Sphil /* from parse.y */
87584c2298Sphil int yyparse(void);
88584c2298Sphil 
89584c2298Sphil /* Vars not defined in main.c */
90584c2298Sphil extern FILE *yyin;
91584c2298Sphil 
92584c2298Sphil /* from mdb.c */
93584c2298Sphil void define_msg(char *, char *);
94584c2298Sphil void write_msg_file(void);
95