compile_et.h revision 178846
150764Smarkm/*
2127807Snectar * Copyright (c) 1998 - 2000 Kungliga Tekniska H�gskolan
350764Smarkm * (Royal Institute of Technology, Stockholm, Sweden).
450764Smarkm * All rights reserved.
550764Smarkm *
650764Smarkm * Redistribution and use in source and binary forms, with or without
750764Smarkm * modification, are permitted provided that the following conditions
850764Smarkm * are met:
950764Smarkm *
1050764Smarkm * 1. Redistributions of source code must retain the above copyright
1150764Smarkm *    notice, this list of conditions and the following disclaimer.
1250764Smarkm *
1350764Smarkm * 2. Redistributions in binary form must reproduce the above copyright
1450764Smarkm *    notice, this list of conditions and the following disclaimer in the
1550764Smarkm *    documentation and/or other materials provided with the distribution.
1650764Smarkm *
17127807Snectar * 3. Neither the name of the Institute nor the names of its contributors
1850764Smarkm *    may be used to endorse or promote products derived from this software
1950764Smarkm *    without specific prior written permission.
2050764Smarkm *
2150764Smarkm * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
2250764Smarkm * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2350764Smarkm * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2450764Smarkm * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
2550764Smarkm * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2650764Smarkm * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2750764Smarkm * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2850764Smarkm * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2950764Smarkm * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3050764Smarkm * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3150764Smarkm * SUCH DAMAGE.
3250764Smarkm */
3350764Smarkm
34178846Sdfr/* $Id: compile_et.h 15426 2005-06-16 19:21:42Z lha $ */
35127807Snectar/* $FreeBSD: head/contrib/com_err/compile_et.h 178846 2008-05-08 11:01:46Z dfr $ */
3650764Smarkm
3750764Smarkm#ifndef __COMPILE_ET_H__
3850764Smarkm#define __COMPILE_ET_H__
3950764Smarkm
4050764Smarkm#ifdef HAVE_CONFIG_H
4150764Smarkm#include <config.h>
4250764Smarkm#endif
4350764Smarkm
44178846Sdfr#include <err.h>
4550764Smarkm#include <stdio.h>
4650764Smarkm#include <string.h>
4750764Smarkm#include <stdlib.h>
4850764Smarkm#include <stdarg.h>
4950764Smarkm#include <ctype.h>
5050764Smarkm
51178846Sdfrextern long base_id;
5250764Smarkmextern int number;
5350764Smarkmextern char *prefix;
5450764Smarkmextern char name[128];
5550764Smarkmextern char *id_str;
5650764Smarkmextern char *filename;
5750764Smarkmextern int numerror;
5850764Smarkm
5950764Smarkmstruct error_code {
6050764Smarkm    unsigned number;
6150764Smarkm    char *name;
6250764Smarkm    char *string;
6350764Smarkm    struct error_code *next, **tail;
6450764Smarkm};
6550764Smarkm
6650764Smarkmextern struct error_code *codes;
6750764Smarkm
6850764Smarkm#define APPEND(L, V) 				\
6950764Smarkmdo {						\
7050764Smarkm    if((L) == NULL) {				\
7150764Smarkm	(L) = (V);				\
7250764Smarkm	(L)->tail = &(V)->next;			\
7350764Smarkm	(L)->next = NULL;			\
7450764Smarkm    }else{					\
7550764Smarkm	*(L)->tail = (V);			\
7650764Smarkm	(L)->tail = &(V)->next;			\
7750764Smarkm    }						\
7850764Smarkm}while(0)
7950764Smarkm
8050764Smarkm#endif /* __COMPILE_ET_H__ */
81