ctf_labels.c revision e083a0c2c99cea982dcf8e12ec3452cc575b5663
/*
* 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 2002-2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <ctf_impl.h>
static int
{
const ctf_header_t *h;
/*
* Labels are only supported in V2 or later
*/
/* LINTED - pointer alignment */
return (0);
}
/*
* Returns the topmost label, or NULL if any errors are encountered
*/
const char *
{
const ctf_lblent_t *ctlp;
const char *s;
return (NULL); /* errno is set */
if (num_labels == 0) {
return (NULL);
}
return (s);
}
/*
* Iterate over all labels. We pass the label string and the lblinfo_t struct
* to the specified callback function.
*/
int
{
const ctf_lblent_t *ctlp;
uint_t i, num_labels;
const char *lname;
int rc;
return (CTF_ERR); /* errno is set */
if (num_labels == 0)
for (i = 0; i < num_labels; i++, ctlp++) {
ctf_dprintf("failed to decode label %u with "
}
return (rc);
}
return (0);
}
typedef struct linfo_cb_arg {
const char *lca_name; /* Label we want to retrieve info for */
static int
{
/*
* If lname matches the label we are looking for, copy the
* lblinfo_t struct for the caller.
*/
/*
* Allow caller not to allocate storage to test if label exists
*/
sizeof (ctf_lblinfo_t));
return (1); /* Indicate we found a match */
}
return (0);
}
/*
* Retrieve information about the label with name "lname"
*/
int
{
int rc;
return (rc);
if (rc != 1)
return (0);
}