chiark / gitweb /
changelog: Document changes in 1.6.0 and finalise version number
[adns.git] / regress / harness.h.m4
1 m4_dnl harness.h.m4
2 m4_dnl (part of complex test harness, not of the library)
3 m4_dnl - function and other declarations
4
5 m4_dnl  This file is part of adns, which is
6 m4_dnl    Copyright (C) 1997-2000,2003,2006,2014-2016,2020  Ian Jackson
7 m4_dnl    Copyright (C) 2014  Mark Wooding
8 m4_dnl    Copyright (C) 1999-2000,2003,2006  Tony Finch
9 m4_dnl    Copyright (C) 1991 Massachusetts Institute of Technology
10 m4_dnl  (See the file INSTALL for full details.)
11 m4_dnl  
12 m4_dnl  This program is free software; you can redistribute it and/or modify
13 m4_dnl  it under the terms of the GNU General Public License as published by
14 m4_dnl  the Free Software Foundation; either version 3, or (at your option)
15 m4_dnl  any later version.
16 m4_dnl  
17 m4_dnl  This program is distributed in the hope that it will be useful,
18 m4_dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
19 m4_dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 m4_dnl  GNU General Public License for more details.
21 m4_dnl  
22 m4_dnl  You should have received a copy of the GNU General Public License
23 m4_dnl  along with this program; if not, write to the Free Software Foundation.
24
25 m4_include(hmacros.i4)
26
27 #ifndef HARNESS_H_INCLUDED
28 #define HARNESS_H_INCLUDED
29
30 #include "internal.h"
31 #include "hsyscalls.h"
32
33 /* There is a Q function (Q for Question) for each such syscall;
34  * it constructs a string representing the call, and calls Q_str
35  * on it, or constructs it in vb and calls Q_vb;
36  */
37
38 hm_create_proto_q
39 m4_define(`hm_syscall', `void Q$1(hm_args_massage($3,void));')
40 m4_define(`hm_specsyscall', `')
41 m4_include(`hsyscalls.i4')
42 hm_stdsyscall_close
43
44 void Q_vb(void);
45
46 extern void Tshutdown(void);
47
48 /* General help functions */
49
50 void Tfailed(const char *why);
51 void Toutputerr(void);
52 void Tnomem(void);
53 void Tfsyscallr(const char *fmt, ...) PRINTFFORMAT(1,2);
54 void Tensuresetup(void);
55 void Tmust(const char *call, const char *arg, int cond);
56
57 void Tvbf(const char *fmt, ...) PRINTFFORMAT(1,2);
58 void Tvbvf(const char *fmt, va_list al);
59 void Tvbfdset(int max, const fd_set *set);
60 void Tvbpollfds(const struct pollfd *fds, int nfds);
61 void Tvbaddr(const struct sockaddr *addr, int addrlen);
62 void Tvbbytes(const void *buf, int len);
63 void Tvberrno(int e);
64 void Tvba(const char *str);
65
66 /* Shared globals */
67
68 extern vbuf vb;
69 extern struct timeval currenttime;
70 extern const struct Terrno { const char *n; int v; } Terrnos[];
71 extern const int Tnerrnos;
72
73 /* Special cases */
74   
75 void Texit(int rv) NONRETURNING;
76
77 void Tcommonshutdown(void);
78 void Tmallocshutdown(void);
79 int Ttestinputfd(void);
80 void T_gettimeofday_hook(void);
81
82 #endif