topo_hash.c 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 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <string.h>
#include "libtopo.h"
#include "topo_impl.h"
topo_strhash(const char *key)
{
ulong_t g, h = 0;
const char *p;
for (p = key; *p != '\0'; p++) {
h = (h << 4) + *p;
if ((g = (h & 0xf0000000)) != 0) {
h ^= (g >> 24);
h ^= g;
}
}
return (h);
}
#define REC_HASHLEN 101
struct tprop *
{
return (newp);
}
void
tprop_destroy(struct tprop *p)
{
topo_free(p);
}
struct tprop_hash *
tprop_hash_create(void)
{
r->tp_hashlen = REC_HASHLEN;
return (r);
}
void
{
struct tprop *d, *n;
int idx;
return;
n = d->p_next;
tprop_destroy(d);
d = n;
}
}
}
void
{
} else {
}
}
struct tprop *
{
}
struct tprop *
{
int idx = 0;
idx++;
}
idx++;
return (NULL);
else
}
struct tnode_hashent *
{
return (r);
}
void
tnode_hashent_destroy(struct tnode_hashent *e)
{
topo_free(e);
}
struct tnode_hash *
tnode_hash_create(void)
{
r->tn_hashlen = REC_HASHLEN;
return (r);
}
void
{
struct tnode_hashent *d, *n;
int idx;
return;
n = d->e_next;
d = n;
}
}
}
void
{
struct tnode_hashent *newent;
} else {
}
}
struct tnode_hashent *
{
}
void
{
struct tnode_hash *ht;
/*
* We keep an index of what nodes have what properties on the
* root node
*/
return;
ht = tnode_hash_create();
}
}
static struct tnode *
{
struct tnode_hashent *e;
struct tnode *n;
const char *pv;
for (;;) {
return (NULL);
n = e->e_node;
continue;
return (n);
}
/*NOTREACHED*/
}
struct tnode *
void **more)
{
struct tnode *r;
return (NULL);
struct tnode_hash *ht;
/*
* We keep an index of what nodes have what properties
* on the root node
*/
return (NULL);
return (NULL);
}
*more = (void *)1;
return (r);
}