mkerrtags.sh revision 178479
1207151Smarius#!/bin/sh
2207151Smarius#
3207151Smarius# CDDL HEADER START
4207151Smarius#
5207151Smarius# The contents of this file are subject to the terms of the
6207151Smarius# Common Development and Distribution License, Version 1.0 only
7207151Smarius# (the "License").  You may not use this file except in compliance
8207151Smarius# with the License.
9207151Smarius#
10207151Smarius# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
11207151Smarius# or http://www.opensolaris.org/os/licensing.
12207151Smarius# See the License for the specific language governing permissions
13207151Smarius# and limitations under the License.
14207151Smarius#
15207151Smarius# When distributing Covered Code, include this CDDL HEADER in each
16207151Smarius# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
17207151Smarius# If applicable, add the following below this CDDL HEADER, with the
18207151Smarius# fields enclosed by brackets "[]" replaced with your own identifying
19207151Smarius# information: Portions Copyright [yyyy] [name of copyright owner]
20207151Smarius#
21207151Smarius# CDDL HEADER END
22207151Smarius#
23207151Smarius#
24207151Smarius# Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
25207151Smarius# Use is subject to license terms.
26207151Smarius#
27207151Smarius#ident	"%Z%%M%	%I%	%E% SMI"
28207151Smarius
29207151SmariusBSDECHO=-e
30207151Smarius
31207151Smariusecho ${BSDECHO} "\
32207151Smarius/*\n\
33207151Smarius * Copyright 2003 Sun Microsystems, Inc.  All rights reserved.\n\
34207151Smarius * Use is subject to license terms.\n\
35207151Smarius */\n\
36207151Smarius\n\
37207151Smarius#pragma ident\t\"%Z%%M%\t%I%\t%E% SMI\"\n\
38207151Smarius\n\
39207151Smarius#include <dt_errtags.h>
40207151Smarius\n\
41207151Smariusstatic const char *const _dt_errtags[] = {"
42207151Smarius
43207151Smariuspattern='^	\(D_[A-Z0-9_]*\),*'
44207151Smariusreplace='	"\1",'
45207151Smarius
46207151Smariussed -n "s/$pattern/$replace/p" || exit 1
47207151Smarius
48207151Smariusecho ${BSDECHO} "\
49207151Smarius};\n\
50207151Smarius\n\
51207151Smariusstatic const int _dt_ntag = sizeof (_dt_errtags) / sizeof (_dt_errtags[0]);\n\
52207151Smarius\n\
53207151Smariusconst char *
54207151Smariusdt_errtag(dt_errtag_t tag)
55207151Smarius{
56207151Smarius	return (_dt_errtags[(tag > 0 && tag < _dt_ntag) ? tag : 0]);
57207151Smarius}"
58207151Smarius
59207151Smariusexit 0
60207151Smarius