2N/A# The contents of this file are subject to the terms of the 2N/A# Common Development and Distribution License (the "License"). 2N/A# You may not use this file except in compliance with the License. 2N/A# See the License for the specific language governing permissions 2N/A# and limitations under the License. 2N/A# When distributing Covered Code, include this CDDL HEADER in each 2N/A# If applicable, add the following below this CDDL HEADER, with the 2N/A# fields enclosed by brackets "[]" replaced with your own identifying 2N/A# information: Portions Copyright [yyyy] [name of copyright owner] 2N/A# Copyright 2007 Sun Microsystems, Inc. All rights reserved. 2N/A# Use is subject to license terms. 2N/A#pragma ident "%Z%%M% %I% %E% SMI" 2N/Aif [ $
1 =
"liberrors" ] ;
then 2N/A * Copyright 2006 Sun Microsystems, Inc. All rights reserved.\n\ 2N/A * Use is subject to license terms.\n\ 2N/Astatic const char *const _topo_errstrs[] = {" 2N/Astatic const int _topo_nerrstrs =\n\ 2N/A sizeof (_topo_errstrs) / sizeof (_topo_errstrs[0]);\n\ 2N/Atopo_hdl_errno(topo_hdl_t *thp) 2N/A return (thp->th_errno); 2N/Atopo_hdl_seterrno(topo_hdl_t *thp, int err) 2N/A thp->th_errno = err; 2N/Atopo_hdl_errmsg(topo_hdl_t *thp) 2N/A return (topo_strerror(thp->th_errno)); 2N/Aelif [ $
1 =
"properrors" ] ;
then 2N/Astatic const char *const _topo_properrstrs[] = {" 2N/Apattern=
'^[ ]*ETOPO_PROP_[A-Z0-9_]*.*\* \(.*\) \*.*' 2N/Astatic const int _topo_nproperrstrs =\n\ 2N/A sizeof (_topo_properrstrs) / sizeof (_topo_properrstrs[0]);" 2N/Aelif [ $
1 =
"methoderrors" ] ;
then 2N/Astatic const char *const _topo_methoderrstrs[] = {" 2N/Apattern=
'^[ ]*ETOPO_METHOD_[A-Z0-9_]*.*\* \(.*\) \*.*' 2N/Astatic const int _topo_nmethoderrstrs =\n\ 2N/A sizeof (_topo_methoderrstrs) / sizeof (_topo_methoderrstrs[0]);" 2N/Aelif [ $
1 =
"fmrierrors" ] ;
then 2N/Astatic const char *const _topo_fmrierrstrs[] = {" 2N/Apattern=
'^[ ]*ETOPO_FMRI_[A-Z0-9_]*.*\* \(.*\) \*.*' 2N/Astatic const int _topo_nfmrierrstrs =\n\ 2N/A sizeof (_topo_fmrierrstrs) / sizeof (_topo_fmrierrstrs[0]);" 2N/Aelif [ $
1 =
"hdlerrors" ] ;
then 2N/Astatic const char *const _topo_hdlerrstrs[] = {" 2N/Apattern=
'^[ ]*ETOPO_HDL_[A-Z0-9_]*.*\* \(.*\) \*.*' 2N/Astatic const int _topo_nhdlerrstrs =\n\ 2N/A sizeof (_topo_hdlerrstrs) / sizeof (_topo_hdlerrstrs[0]);" 2N/Astatic const char *const _topo_moderrstrs[] = {" 2N/Astatic const int _topo_nmoderrstrs =\n\ 2N/A sizeof (_topo_moderrstrs) / sizeof (_topo_moderrstrs[0]);\n\ 2N/Atopo_mod_errno(topo_mod_t *mp) 2N/A return (mp->tm_errno); 2N/Atopo_mod_seterrno(topo_mod_t *mp, int err) 2N/Atopo_mod_errmsg(topo_mod_t *mp) 2N/A return (topo_strerror(mp->tm_errno)); 2N/Atopo_strerror(int err) 2N/A if (err >= ETOPO_UNKNOWN && (err - ETOPO_UNKNOWN) < _topo_nerrstrs) 2N/A s = _topo_errstrs[err - ETOPO_UNKNOWN]; 2N/A else if (err >= EMOD_UNKNOWN && (err - EMOD_UNKNOWN) < 2N/A s = _topo_moderrstrs[err - EMOD_UNKNOWN]; 2N/A else if (err >= ETOPO_PROP_UNKNOWN && (err - ETOPO_PROP_UNKNOWN) < 2N/A s = _topo_properrstrs[err - ETOPO_PROP_UNKNOWN]; 2N/A else if (err >= ETOPO_METHOD_UNKNOWN && (err - ETOPO_METHOD_UNKNOWN) < 2N/A _topo_nmethoderrstrs) 2N/A s = _topo_methoderrstrs[err - ETOPO_METHOD_UNKNOWN]; 2N/A else if (err >= ETOPO_HDL_UNKNOWN && (err - ETOPO_HDL_UNKNOWN) < 2N/A s = _topo_hdlerrstrs[err - ETOPO_HDL_UNKNOWN]; 2N/A else if (err >= ETOPO_FMRI_UNKNOWN && (err - ETOPO_FMRI_UNKNOWN) < 2N/A s = _topo_fmrierrstrs[err - ETOPO_FMRI_UNKNOWN]; 2N/A s = _topo_errstrs[0];