1f7923656Sespie #ifndef MEMORY_H 2f7923656Sespie #define MEMORY_H 3f7923656Sespie 4*9e78641fSespie /* $OpenBSD: memory.h,v 1.10 2017/07/24 12:07:46 espie Exp $ */ 5f7923656Sespie 6f7923656Sespie /*- 7f7923656Sespie * Copyright (c) 1988, 1989, 1990, 1993 8f7923656Sespie * The Regents of the University of California. All rights reserved. 9f7923656Sespie * Copyright (c) 1989 by Berkeley Softworks 10f7923656Sespie * All rights reserved. 11f7923656Sespie * 12f7923656Sespie * This code is derived from software contributed to Berkeley by 13f7923656Sespie * Adam de Boor. 14f7923656Sespie * 15f7923656Sespie * Redistribution and use in source and binary forms, with or without 16f7923656Sespie * modification, are permitted provided that the following conditions 17f7923656Sespie * are met: 18f7923656Sespie * 1. Redistributions of source code must retain the above copyright 19f7923656Sespie * notice, this list of conditions and the following disclaimer. 20f7923656Sespie * 2. Redistributions in binary form must reproduce the above copyright 21f7923656Sespie * notice, this list of conditions and the following disclaimer in the 22f7923656Sespie * documentation and/or other materials provided with the distribution. 23f75387cbSmillert * 3. Neither the name of the University nor the names of its contributors 24f7923656Sespie * may be used to endorse or promote products derived from this software 25f7923656Sespie * without specific prior written permission. 26f7923656Sespie * 27f7923656Sespie * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 28f7923656Sespie * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 29f7923656Sespie * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 30f7923656Sespie * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 31f7923656Sespie * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 32f7923656Sespie * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 33f7923656Sespie * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 34f7923656Sespie * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 35f7923656Sespie * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 36f7923656Sespie * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 37f7923656Sespie * SUCH DAMAGE. 38f7923656Sespie * 39f7923656Sespie * from: @(#)nonints.h 8.3 (Berkeley) 3/19/94 40f7923656Sespie */ 41f7923656Sespie extern void *emalloc(size_t); 42f7923656Sespie extern char *estrdup(const char *); 43f7923656Sespie extern void *erealloc(void *, size_t); 44e2ff9f51Sespie extern void *ereallocarray(void *, size_t, size_t); 45f7923656Sespie extern int eunlink(const char *); 46f7923656Sespie extern void esetenv(const char *, const char *); 47f7923656Sespie 48e2ff9f51Sespie extern void *hash_calloc(size_t, size_t, void *); 49e2ff9f51Sespie extern void hash_free(void *, void *); 50f7923656Sespie extern void *element_alloc(size_t, void *); 51f7923656Sespie 52ff4f28c0Sespie struct ohash; 53ff4f28c0Sespie /* free_hash(o): free a ohash structure, where each element can be free'd. */ 54ff4f28c0Sespie extern void free_hash(struct ohash *); 55ff4f28c0Sespie 56f7923656Sespie #endif /* MEMORY_H */ 57