1*9f38b5b2Sguenther /* $OpenBSD: kdump_subr.h,v 1.23 2022/12/19 22:55:12 guenther Exp $ */ 2a36336a8Sotto /* 3a36336a8Sotto * Copyright(c) 2006 2006 David Kirchner <dpk@dpk.net> 4a36336a8Sotto * 5a36336a8Sotto * Permission to use, copy, modify, and distribute this software for any 6a36336a8Sotto * purpose with or without fee is hereby granted, provided that the above 7a36336a8Sotto * copyright notice and this permission notice appear in all copies. 8a36336a8Sotto * 9a36336a8Sotto * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10a36336a8Sotto * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11a36336a8Sotto * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12a36336a8Sotto * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13a36336a8Sotto * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14a36336a8Sotto * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15a36336a8Sotto * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16a36336a8Sotto */ 17a36336a8Sotto 18a36336a8Sotto /* $FreeBSD: src/usr.bin/kdump/kdump_subr.h,v 1.3 2007/04/09 22:04:27 emaste Exp $ */ 19a36336a8Sotto 20b4a95de8Sguenther 21b4a95de8Sguenther /* 22b4a95de8Sguenther * These are simple support macros. print_or utilizes a variable 23b4a95de8Sguenther * defined in the calling function to track whether or not it should 24b4a95de8Sguenther * print a logical-OR character ('|') before a string. if_print_or 25b4a95de8Sguenther * simply handles the necessary "if" statement used in many lines 26b4a95de8Sguenther * of this file. 27b4a95de8Sguenther */ 28b4a95de8Sguenther #define print_or(str,orflag) do { \ 29b4a95de8Sguenther if (orflag) putchar('|'); else orflag = 1; \ 30b4a95de8Sguenther printf ("%s", str); } \ 31b4a95de8Sguenther while (0) 32b4a95de8Sguenther #define if_print_or(i,flag,orflag) do { \ 33b4a95de8Sguenther if ((i & flag) == flag) \ 34b4a95de8Sguenther print_or(#flag,orflag); } \ 35b4a95de8Sguenther while (0) 36b4a95de8Sguenther 3799636776Sguenther void fcntlcmdname(int); 38a36336a8Sotto void rtprioname(int); 39a36336a8Sotto void modename(int); 404841054fSguenther void doflagsname(int, int); 41a36336a8Sotto void flagsname(int); 4299636776Sguenther void openflagsname(int); 434805374fSmatthew void atflagsname(int); 44a36336a8Sotto void accessmodename(int); 45a36336a8Sotto void mmapprotname(int); 46a36336a8Sotto void mmapflagsname(int); 47a36336a8Sotto void wait4optname(int); 48*9f38b5b2Sguenther void waitidoptname(int); 49a36336a8Sotto void sendrecvflagsname(int); 50a36336a8Sotto void getfsstatflagsname(int); 51a36336a8Sotto void mountflagsname(int); 52a36336a8Sotto void rebootoptname(int); 53a36336a8Sotto void flockname(int); 54a36336a8Sotto void sockoptname(int); 55a36336a8Sotto void sockdomainname(int); 56a36336a8Sotto void sockipprotoname(int); 57a36336a8Sotto void socktypename(int); 584841054fSguenther void sockflagsname(int); 59f980d548Sotto void sockfamilyname(int); 60a36336a8Sotto void thrcreateflagsname(int); 61a36336a8Sotto void mlockallname(int); 62a36336a8Sotto void shmatname(int); 63a36336a8Sotto void nfssvcname(int); 64a36336a8Sotto void whencename(int); 65ee6ae511Sguenther void pathconfname(int); 66a36336a8Sotto void rlimitname(int); 67a36336a8Sotto void shutdownhowname(int); 68a36336a8Sotto void prioname(int); 69a36336a8Sotto void madvisebehavname(int); 70a36336a8Sotto void msyncflagsname(int); 717b36c281Sguenther void clocktypename(int); 72a36336a8Sotto void schedpolicyname(int); 73a36336a8Sotto void kldunloadfflagsname(int); 74a36336a8Sotto void ksethrcmdname(int); 75a36336a8Sotto void extattrctlname(int); 76a36336a8Sotto void kldsymcmdname(int); 77a36336a8Sotto void sendfileflagsname(int); 78a36336a8Sotto void acltypename(int); 79ee6ae511Sguenther void rusagewho(int); 809ece112bSguenther void sigactionflagname(int); 81a36336a8Sotto void sigprocmaskhowname(int); 82a36336a8Sotto void lio_listioname(int); 83a36336a8Sotto void minheritname(int); 84a36336a8Sotto void quotactlname(int); 851338505aSguenther void quotactlcmdname(int); 86a36336a8Sotto void ptraceopname(int); 871a9e9ac5Sotto void sigill_name(int); 881a9e9ac5Sotto void sigtrap_name(int); 891a9e9ac5Sotto void sigemt_name(int); 901a9e9ac5Sotto void sigfpe_name(int); 911a9e9ac5Sotto void sigbus_name(int); 921a9e9ac5Sotto void sigsegv_name(int); 931a9e9ac5Sotto void sigchld_name(int); 94a70ae221Sguenther void ktracefacname(int); 95a70ae221Sguenther void itimername(int); 968449a441Sguenther void evfiltername(int); 978449a441Sguenther void evflagsname(int); 988449a441Sguenther void evfflagsname(int, int); 99cd632112Sderaadt void pollfdeventname(int); 100968c3b13Sguenther void syslogflagname(int); 101c7d77250Smpi void futexflagname(int); 1025c402730Santon void flocktypename(int); 103dd52b3caSotto 104faed7757Sguenther extern int decimal, fancy, basecol, arg1; 105