xref: /openbsd/usr.bin/kdump/kdump_subr.h (revision cd632112)
1*cd632112Sderaadt /*	$OpenBSD: kdump_subr.h,v 1.20 2016/06/07 06:12:37 deraadt 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);
48a36336a8Sotto void sendrecvflagsname(int);
49a36336a8Sotto void getfsstatflagsname(int);
50a36336a8Sotto void mountflagsname(int);
51a36336a8Sotto void rebootoptname(int);
52a36336a8Sotto void flockname(int);
53a36336a8Sotto void sockoptname(int);
54a36336a8Sotto void sockdomainname(int);
55a36336a8Sotto void sockipprotoname(int);
56a36336a8Sotto void socktypename(int);
574841054fSguenther void sockflagsname(int);
58f980d548Sotto void sockfamilyname(int);
59a36336a8Sotto void thrcreateflagsname(int);
60a36336a8Sotto void mlockallname(int);
61a36336a8Sotto void shmatname(int);
62a36336a8Sotto void nfssvcname(int);
63a36336a8Sotto void whencename(int);
64ee6ae511Sguenther void pathconfname(int);
65a36336a8Sotto void rlimitname(int);
66a36336a8Sotto void shutdownhowname(int);
67a36336a8Sotto void prioname(int);
68a36336a8Sotto void madvisebehavname(int);
69a36336a8Sotto void msyncflagsname(int);
707b36c281Sguenther void clocktypename(int);
71a36336a8Sotto void schedpolicyname(int);
72a36336a8Sotto void kldunloadfflagsname(int);
73a36336a8Sotto void ksethrcmdname(int);
74a36336a8Sotto void extattrctlname(int);
75a36336a8Sotto void kldsymcmdname(int);
76a36336a8Sotto void sendfileflagsname(int);
77a36336a8Sotto void acltypename(int);
78ee6ae511Sguenther void rusagewho(int);
799ece112bSguenther void sigactionflagname(int);
80a36336a8Sotto void sigprocmaskhowname(int);
81a36336a8Sotto void lio_listioname(int);
82a36336a8Sotto void minheritname(int);
83a36336a8Sotto void quotactlname(int);
841338505aSguenther void quotactlcmdname(int);
85a36336a8Sotto void ptraceopname(int);
861a9e9ac5Sotto void sigill_name(int);
871a9e9ac5Sotto void sigtrap_name(int);
881a9e9ac5Sotto void sigemt_name(int);
891a9e9ac5Sotto void sigfpe_name(int);
901a9e9ac5Sotto void sigbus_name(int);
911a9e9ac5Sotto void sigsegv_name(int);
921a9e9ac5Sotto void sigchld_name(int);
93a70ae221Sguenther void ktracefacname(int);
94a70ae221Sguenther void itimername(int);
958449a441Sguenther void evfiltername(int);
968449a441Sguenther void evflagsname(int);
978449a441Sguenther void evfflagsname(int, int);
98*cd632112Sderaadt void pollfdeventname(int);
99968c3b13Sguenther void syslogflagname(int);
100dd52b3caSotto 
101faed7757Sguenther extern int decimal, fancy, basecol, arg1;
102