1*1fcced4cSJordan Brown /* 2*1fcced4cSJordan Brown * CDDL HEADER START 3*1fcced4cSJordan Brown * 4*1fcced4cSJordan Brown * The contents of this file are subject to the terms of the 5*1fcced4cSJordan Brown * Common Development and Distribution License (the "License"). 6*1fcced4cSJordan Brown * You may not use this file except in compliance with the License. 7*1fcced4cSJordan Brown * 8*1fcced4cSJordan Brown * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*1fcced4cSJordan Brown * or http://www.opensolaris.org/os/licensing. 10*1fcced4cSJordan Brown * See the License for the specific language governing permissions 11*1fcced4cSJordan Brown * and limitations under the License. 12*1fcced4cSJordan Brown * 13*1fcced4cSJordan Brown * When distributing Covered Code, include this CDDL HEADER in each 14*1fcced4cSJordan Brown * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*1fcced4cSJordan Brown * If applicable, add the following below this CDDL HEADER, with the 16*1fcced4cSJordan Brown * fields enclosed by brackets "[]" replaced with your own identifying 17*1fcced4cSJordan Brown * information: Portions Copyright [yyyy] [name of copyright owner] 18*1fcced4cSJordan Brown * 19*1fcced4cSJordan Brown * CDDL HEADER END 20*1fcced4cSJordan Brown */ 21*1fcced4cSJordan Brown 22*1fcced4cSJordan Brown /* 23*1fcced4cSJordan Brown * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 24*1fcced4cSJordan Brown * Use is subject to license terms. 25*1fcced4cSJordan Brown */ 26*1fcced4cSJordan Brown 27*1fcced4cSJordan Brown #ifndef _SIZED_ARRAY_H 28*1fcced4cSJordan Brown #define _SIZED_ARRAY_H 29*1fcced4cSJordan Brown 30*1fcced4cSJordan Brown /* 31*1fcced4cSJordan Brown * Like calloc, but with mechanisms to get the size of the allocated 32*1fcced4cSJordan Brown * area given only the pointer. 33*1fcced4cSJordan Brown */ 34*1fcced4cSJordan Brown 35*1fcced4cSJordan Brown #ifdef __cplusplus 36*1fcced4cSJordan Brown extern "C" { 37*1fcced4cSJordan Brown #endif 38*1fcced4cSJordan Brown 39*1fcced4cSJordan Brown void *sized_array(size_t n, size_t sz); 40*1fcced4cSJordan Brown void sized_array_free(void *p); 41*1fcced4cSJordan Brown size_t sized_array_n(void *p); 42*1fcced4cSJordan Brown size_t sized_array_sz(void *p); 43*1fcced4cSJordan Brown 44*1fcced4cSJordan Brown #ifdef __cplusplus 45*1fcced4cSJordan Brown } 46*1fcced4cSJordan Brown #endif 47*1fcced4cSJordan Brown 48*1fcced4cSJordan Brown #endif /* _SIZED_ARRAY_H */ 49