17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5664a5ea1Srobj * Common Development and Distribution License (the "License"). 6664a5ea1Srobj * You may not use this file except in compliance with the License. 77c478bd9Sstevel@tonic-gate * 87c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 107c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 117c478bd9Sstevel@tonic-gate * and limitations under the License. 127c478bd9Sstevel@tonic-gate * 137c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 147c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 167c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 177c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 187c478bd9Sstevel@tonic-gate * 197c478bd9Sstevel@tonic-gate * CDDL HEADER END 207c478bd9Sstevel@tonic-gate */ 217c478bd9Sstevel@tonic-gate /* 22664a5ea1Srobj * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 237c478bd9Sstevel@tonic-gate * Use is subject to license terms. 247c478bd9Sstevel@tonic-gate */ 25*2b1b28a8SRob Johnston /* 26*2b1b28a8SRob Johnston * Copyright 2019 Joyent, Inc. 27*2b1b28a8SRob Johnston */ 287c478bd9Sstevel@tonic-gate 297aec1d6eScindi #ifndef _TOPO_LIST_H 307aec1d6eScindi #define _TOPO_LIST_H 317c478bd9Sstevel@tonic-gate 327aec1d6eScindi #include <fm/libtopo.h> 337aec1d6eScindi 34822fb41dStsien #ifdef __cplusplus 357c478bd9Sstevel@tonic-gate extern "C" { 367c478bd9Sstevel@tonic-gate #endif 377c478bd9Sstevel@tonic-gate 387aec1d6eScindi #define topo_list_prev(elem) ((void *)(((topo_list_t *)(elem))->l_prev)) 397aec1d6eScindi #define topo_list_next(elem) ((void *)(((topo_list_t *)(elem))->l_next)) 40822fb41dStsien 417aec1d6eScindi extern void topo_list_append(topo_list_t *, void *); 427aec1d6eScindi extern void topo_list_prepend(topo_list_t *, void *); 437aec1d6eScindi extern void topo_list_insert_before(topo_list_t *, void *, void *); 447aec1d6eScindi extern void topo_list_insert_after(topo_list_t *, void *, void *); 457aec1d6eScindi extern void topo_list_delete(topo_list_t *, void *); 46*2b1b28a8SRob Johnston extern int topo_list_deepcopy(topo_hdl_t *, topo_list_t *, topo_list_t *, 47*2b1b28a8SRob Johnston size_t); 48822fb41dStsien 497aec1d6eScindi /* Helpers for child/sibling lists */ 507aec1d6eScindi extern tnode_t *topo_child_first(tnode_t *); 517aec1d6eScindi extern tnode_t *topo_child_next(tnode_t *, tnode_t *); 527aec1d6eScindi extern topo_list_t *topo_sibling_list(tnode_t *); 537c478bd9Sstevel@tonic-gate 547aec1d6eScindi #ifdef __cplusplus 557c478bd9Sstevel@tonic-gate } 567c478bd9Sstevel@tonic-gate #endif 577c478bd9Sstevel@tonic-gate 587aec1d6eScindi #endif /* _TOPO_LIST_H */ 59