diff options
| author | bcook <> | 2015-06-19 06:20:11 +0000 |
|---|---|---|
| committer | bcook <> | 2015-06-19 06:20:11 +0000 |
| commit | fbe5affcc923697c9d3682f503229a15b024db33 (patch) | |
| tree | 88da262440d3a036e966216ce3ac561ba5b931cd /src/lib/libtls/tls.h | |
| parent | 1ef7c35782edea8e65610a2d9d6d6d08ea90983c (diff) | |
| download | openbsd-fbe5affcc923697c9d3682f503229a15b024db33.tar.gz openbsd-fbe5affcc923697c9d3682f503229a15b024db33.tar.bz2 openbsd-fbe5affcc923697c9d3682f503229a15b024db33.zip | |
Add standard headers, C++ support to tls.h.
This makes using libtls easier to include by including dependent headers,
making something like this work as expected:
#include <iostream>
#include <tls.h>
int main()
{
std::cout << "tls_init: " << tls_init() << "\n";
}
This also makes building a standalone libtls-portable simpler.
ok doug@, jsing@
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libtls/tls.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/lib/libtls/tls.h b/src/lib/libtls/tls.h index e9971ade0e..cb02ee8824 100644 --- a/src/lib/libtls/tls.h +++ b/src/lib/libtls/tls.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: tls.h,v 1.12 2015/03/31 14:03:38 jsing Exp $ */ | 1 | /* $OpenBSD: tls.h,v 1.13 2015/06/19 06:20:11 bcook Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> |
| 4 | * | 4 | * |
| @@ -18,6 +18,13 @@ | |||
| 18 | #ifndef HEADER_TLS_H | 18 | #ifndef HEADER_TLS_H |
| 19 | #define HEADER_TLS_H | 19 | #define HEADER_TLS_H |
| 20 | 20 | ||
| 21 | #ifdef __cplusplus | ||
| 22 | extern "C" { | ||
| 23 | #endif | ||
| 24 | |||
| 25 | #include <stddef.h> | ||
| 26 | #include <stdint.h> | ||
| 27 | |||
| 21 | #define TLS_API 20141031 | 28 | #define TLS_API 20141031 |
| 22 | 29 | ||
| 23 | #define TLS_PROTOCOL_TLSv1_0 (1 << 1) | 30 | #define TLS_PROTOCOL_TLSv1_0 (1 << 1) |
| @@ -88,4 +95,8 @@ int tls_close(struct tls *_ctx); | |||
| 88 | 95 | ||
| 89 | uint8_t *tls_load_file(const char *_file, size_t *_len, char *_password); | 96 | uint8_t *tls_load_file(const char *_file, size_t *_len, char *_password); |
| 90 | 97 | ||
| 98 | #ifdef __cplusplus | ||
| 99 | } | ||
| 100 | #endif | ||
| 101 | |||
| 91 | #endif /* HEADER_TLS_H */ | 102 | #endif /* HEADER_TLS_H */ |
