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