summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbcook <>2015-06-19 06:20:11 +0000
committerbcook <>2015-06-19 06:20:11 +0000
commit6fa9edbb1e8e7fb30f0939202e9fe1997b17524f (patch)
tree88da262440d3a036e966216ce3ac561ba5b931cd
parent3293ee7f21e12c11500db87f81e518c9dada1317 (diff)
downloadopenbsd-6fa9edbb1e8e7fb30f0939202e9fe1997b17524f.tar.gz
openbsd-6fa9edbb1e8e7fb30f0939202e9fe1997b17524f.tar.bz2
openbsd-6fa9edbb1e8e7fb30f0939202e9fe1997b17524f.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@
-rw-r--r--src/lib/libtls/tls.h13
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
22extern "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
89uint8_t *tls_load_file(const char *_file, size_t *_len, char *_password); 96uint8_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 */