Ancestor.cc revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 2000-2001 by Sun Microsystems, Inc.
* All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdlib.h>
#include <string.h>
#include "Ancestor.h"
/* ========================================================================= */
/* Ancestor object definitions. */
: field_name(field),
tag(t),
def(d),
numInstances(0),
numBufs(1),
{
}
{
for (int i = 0; i < numInstances; i++) {
}
}
delete next;
}
/*
void
Ancestor::print(void)
{
fprintf(stderr, "Ancestor Information\n");
fprintf(stderr, "Tag Name: %s\n", def->name);
fprintf(stderr, "Tag Type: %s\n",
get_tagtype_str(get_tag_type(&tag)));
fprintf(stderr, "Num instances: %d\n", numInstances);
fprintf(stderr, " offsets:\n");
for (int i = 0; i < numInstances; i++) {
fprintf(stderr, " %d\n", offsets[i]);
}
if (next != NULL) {
next->print();
}
}
*/
void
{
if (numInstances >= ANCESTOR_INST_BUF_SIZE) {
numBufs++;
(sizeof (uint32_t) *
(ANCESTOR_INST_BUF_SIZE * numBufs)));
(sizeof (char *) *
(ANCESTOR_INST_BUF_SIZE * numBufs)));
}
}
Ancestor::getFieldName(void)
{
return (field_name);
}
{
return (tag);
}
const fru_regdef_t *
{
return (def);
}
int
Ancestor::getNumInstances(void)
{
return (numInstances);
}
{
if (num < numInstances)
else
return (offsets[numInstances]);
}
const char *
{
if (num < numInstances)
else
return (paths[numInstances]);
}
Ancestor *
{
int i = 0;
unsigned int number = 0;
if (data_elems == NULL) {
return (NULL);
}
// look through all the elements.
for (i = 0; i < number; i++) {
def = (fru_regdef_t *)
} else {
}
}
}
}
for (i = 0; i < number; i++) {
free(data_elems[i]);
}
return (rc);
}
Ancestor *
{
// ancestors have to be tagged.
return (NULL);
return (rc);
}
int found = 0;
const fru_regdef_t *tmp
}
}
if (!found) {
delete rc;
return (NULL);
}
return (rc);
}
int
const fru_regdef_t *parent_def,
{
offset += 4;
for (int i = 0; i < parent_def->iterationCount; i++) {
}
} else {
path << "/";
}
return (1);
}
int found = 0;
const fru_regdef_t *tmp
}
}
return (found);
}