mktables.sh revision 825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj# CDDL HEADER START
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj# The contents of this file are subject to the terms of the
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj# Common Development and Distribution License (the "License").
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj# You may not use this file except in compliance with the License.
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj# See the License for the specific language governing permissions
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj# and limitations under the License.
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj# When distributing Covered Code, include this CDDL HEADER in each
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj# If applicable, add the following below this CDDL HEADER, with the
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj# fields enclosed by brackets "[]" replaced with your own identifying
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj# information: Portions Copyright [yyyy] [name of copyright owner]
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj# CDDL HEADER END
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj# Use is subject to license terms.
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj#ident "%Z%%M% %I% %E% SMI"
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj# Construct translation tables for defines in libipmi.h to translate to readable
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robjif [ -r $1 ]; then
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj * Use is subject to license terms.
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj#pragma ident \"%Z%%M% %I% %E% SMI\"
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj# Error table.
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robjipmi_name_trans_t ipmi_errno_table[] = {"
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robjcat $libipmi_h | sed -n "s/$pattern/$replace/p" || exit 1
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robjecho "\t{ 0, NULL }
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj# Entity table.
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robjecho "\nipmi_name_trans_t ipmi_entity_table[] = {"
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robjcat $libipmi_h | sed -n "s/$pattern/$replace/p" || exit 1
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robjecho "\t{ 0, NULL }
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj# Sensor types.
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robjecho "\nipmi_name_trans_t ipmi_sensor_type_table[] = {"
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robjcat $libipmi_h | sed -n "s/$pattern/$replace/p" || exit 1
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robjecho "\t{ 0, NULL }
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj# Reading types.
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robjecho "\nipmi_name_trans_t ipmi_reading_type_table[] = {"
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robjcat $libipmi_h | sed -n "s/$pattern/$replace/p" || exit 1
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robjecho "\t{ 0, NULL }
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robjecho "\nipmi_name_trans_t ipmi_units_type_table[] = {"
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robjcat $libipmi_h | sed -n "s/$pattern/$replace/p" || exit 1
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robjecho "\t{ 0, NULL }