/*
* 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 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <ctf_impl.h>
/*
* Simple doubly-linked list append routine. This implementation assumes that
* each list element contains an embedded ctf_list_t as the first member.
* An additional ctf_list_t is used to store the head (l_next) and tail
* (l_prev) pointers. The current head and tail list elements have their
* previous and next pointers set to NULL, respectively.
*/
void
{
q->l_prev = p;
if (p != NULL)
p->l_next = q;
else
}
/*
* Prepend the specified existing element to the given ctf_list_t. The
* existing pointer should be pointing at a struct with embedded ctf_list_t.
*/
void
{
p->l_next = q;
if (q != NULL)
q->l_prev = p;
else
}
/*
* Delete the specified existing element from the given ctf_list_t. The
* existing pointer should be pointing at a struct with embedded ctf_list_t.
*/
void
{
ctf_list_t *p = existing;
else
else
}
/*
* Convert an encoded CTF string name into a pointer to a C string by looking
* up the appropriate string table buffer and then adding the offset.
*/
const char *
{
/* string table not loaded or corrupt offset */
return (NULL);
}
const char *
{
return (s != NULL ? s : "(?)");
}
/*
* Same strdup(3C), but use ctf_alloc() to do the memory allocation.
*/
char *
{
return (s2);
}
/*
* Store the specified error code into errp if it is non-NULL, and then
* return NULL for the benefit of the caller.
*/
{
return (NULL);
}
/*
* Store the specified error code into the CTF container, and then return
* CTF_ERR for the benefit of the caller.
*/
long
{
return (CTF_ERR);
}