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