]> git.ipfire.org Git - thirdparty/openssl.git/blob - test/testutil/output.h
Fix header file include guard names
[thirdparty/openssl.git] / test / testutil / output.h
1 /*
2 * Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License 2.0 (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
8 */
9
10 #ifndef OSSL_TESTUTIL_OUTPUT_H
11 # define OSSL_TESTUTIL_OUTPUT_H
12
13 # include <stdarg.h>
14
15 # define ossl_test__attr__(x)
16 # if defined(__GNUC__) && defined(__STDC_VERSION__) \
17 && !defined(__APPLE__)
18 /*
19 * Because we support the 'z' modifier, which made its appearance in C99,
20 * we can't use __attribute__ with pre C99 dialects.
21 */
22 # if __STDC_VERSION__ >= 199901L
23 # undef ossl_test__attr__
24 # define ossl_test__attr__ __attribute__
25 # if __GNUC__*10 + __GNUC_MINOR__ >= 44
26 # define ossl_test__printf__ __gnu_printf__
27 # else
28 # define ossl_test__printf__ __printf__
29 # endif
30 # endif
31 # endif
32 /*
33 * The basic I/O functions used internally by the test framework. These
34 * can be overridden when needed. Note that if one is, then all must be.
35 */
36 void test_open_streams(void);
37 void test_close_streams(void);
38 /* The following ALL return the number of characters written */
39 int test_vprintf_stdout(const char *fmt, va_list ap)
40 ossl_test__attr__((__format__(ossl_test__printf__, 1, 0)));
41 int test_vprintf_stderr(const char *fmt, va_list ap)
42 ossl_test__attr__((__format__(ossl_test__printf__, 1, 0)));
43 /* These return failure or success */
44 int test_flush_stdout(void);
45 int test_flush_stderr(void);
46
47 /* Commodity functions. There's no need to override these */
48 int test_printf_stdout(const char *fmt, ...)
49 ossl_test__attr__((__format__(ossl_test__printf__, 1, 2)));
50 int test_printf_stderr(const char *fmt, ...)
51 ossl_test__attr__((__format__(ossl_test__printf__, 1, 2)));
52
53 # undef ossl_test__printf__
54 # undef ossl_test__attr__
55
56 #endif /* OSSL_TESTUTIL_OUTPUT_H */