1*6eef43d0Sespie /* $OpenBSD: dump.h,v 1.3 2015/01/23 22:35:57 espie Exp $ */ 2a6b963c8Sespie #ifndef _DUMP_H_ 3a6b963c8Sespie #define _DUMP_H_ 4a6b963c8Sespie 5a6b963c8Sespie /* 6a6b963c8Sespie * Copyright (c) 2012 Marc Espie. 7a6b963c8Sespie * 8a6b963c8Sespie * Redistribution and use in source and binary forms, with or without 9a6b963c8Sespie * modification, are permitted provided that the following conditions 10a6b963c8Sespie * are met: 11a6b963c8Sespie * 1. Redistributions of source code must retain the above copyright 12a6b963c8Sespie * notice, this list of conditions and the following disclaimer. 13a6b963c8Sespie * 2. Redistributions in binary form must reproduce the above copyright 14a6b963c8Sespie * notice, this list of conditions and the following disclaimer in the 15a6b963c8Sespie * documentation and/or other materials provided with the distribution. 16a6b963c8Sespie * 17a6b963c8Sespie * THIS SOFTWARE IS PROVIDED BY THE OPENBSD PROJECT AND CONTRIBUTORS 18a6b963c8Sespie * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19a6b963c8Sespie * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20a6b963c8Sespie * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBSD 21a6b963c8Sespie * PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22a6b963c8Sespie * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23a6b963c8Sespie * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24a6b963c8Sespie * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25a6b963c8Sespie * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26a6b963c8Sespie * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27a6b963c8Sespie * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28a6b963c8Sespie */ 29a6b963c8Sespie /* implementation of -p option */ 30a6b963c8Sespie extern void dump_data(void); 31a6b963c8Sespie 321bae8e1fSespie /* and of graph debugging options */ 331bae8e1fSespie extern void post_mortem(void); 341bae8e1fSespie 351bae8e1fSespie struct ohash; 361bae8e1fSespie /* utility functions for both var and targ */ 371bae8e1fSespie 381bae8e1fSespie 391bae8e1fSespie /* t = sort_ohash_by_name(h): 401bae8e1fSespie * returns a NULL terminated array holding hash entries, sorted by name. 411bae8e1fSespie * free(t) when done with it. 421bae8e1fSespie */ 431bae8e1fSespie extern void *sort_ohash_by_name(struct ohash *); 441bae8e1fSespie /* t = sort_ohash(h, cmp_f); 451bae8e1fSespie * returns a NULL terminated array holding hash entries, pass comparison 461bae8e1fSespie * function. 471bae8e1fSespie * free(t) when done with it. 481bae8e1fSespie */ 491bae8e1fSespie extern void *sort_ohash(struct ohash *, int (*)(const void *, const void *)); 501bae8e1fSespie 51a6b963c8Sespie #endif 52