REORG: include: move shctx to haproxy/shctx{,-t}.h
Minor cleanups were applied, some includes were missing from the types
file and some were incorrect in a few C files (duplicated or not using
path).
diff --git a/include/types/shctx.h b/include/haproxy/shctx-t.h
similarity index 64%
rename from include/types/shctx.h
rename to include/haproxy/shctx-t.h
index 7d9d8c8..ea835af 100644
--- a/include/types/shctx.h
+++ b/include/haproxy/shctx-t.h
@@ -1,5 +1,23 @@
-#ifndef __TYPES_SHCTX
-#define __TYPES_SHCTX
+/*
+ * include/haproxy/shctx-t.h - shared context management functions for SSL
+ *
+ * Copyright (C) 2011-2012 EXCELIANCE
+ *
+ * Author: Emeric Brun - emeric@exceliance.fr
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#ifndef __HAPROXY_SHCTX_T_H
+#define __HAPROXY_SHCTX_T_H
+
+#if !defined (USE_PRIVATE_CACHE) && defined(USE_PTHREAD_PSHARED)
+#include <pthread.h>
+#endif
+#include <haproxy/list.h>
#ifndef SHSESS_BLOCK_MIN_SIZE
#define SHSESS_BLOCK_MIN_SIZE 128
@@ -46,4 +64,4 @@
unsigned char data[0];
};
-#endif
+#endif /* __HAPROXY_SHCTX_T_H */
diff --git a/include/proto/shctx.h b/include/haproxy/shctx.h
similarity index 95%
rename from include/proto/shctx.h
rename to include/haproxy/shctx.h
index 76f498f..b258f3c 100644
--- a/include/proto/shctx.h
+++ b/include/haproxy/shctx.h
@@ -1,5 +1,5 @@
/*
- * shctx.h - shared context management functions for SSL
+ * include/haproxy/shctx.h - shared context management functions for SSL
*
* Copyright (C) 2011-2012 EXCELIANCE
*
@@ -11,13 +11,12 @@
* 2 of the License, or (at your option) any later version.
*/
-#ifndef SHCTX_H
-#define SHCTX_H
+#ifndef __HAPROXY_SHCTX_H
+#define __HAPROXY_SHCTX_H
+#include <haproxy/api-t.h>
#include <haproxy/list.h>
-#include <types/shctx.h>
-
-#include <inttypes.h>
+#include <haproxy/shctx-t.h>
#ifndef USE_PRIVATE_CACHE
#ifdef USE_PTHREAD_PSHARED
@@ -215,5 +214,5 @@
LIST_ADDQ(&shctx->avail, &s->list);
}
-#endif /* SHCTX_H */
+#endif /* __HAPROXY_SHCTX_H */
diff --git a/src/cache.c b/src/cache.c
index 754cb44..02083c0 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -11,6 +11,7 @@
*/
#include <haproxy/api.h>
+#include <haproxy/shctx.h>
#include <import/eb32tree.h>
#include <import/sha1.h>
@@ -18,7 +19,6 @@
#include <types/cli.h>
#include <types/filters.h>
#include <types/proxy.h>
-#include <types/shctx.h>
#include <proto/channel.h>
#include <proto/cli.h>
@@ -30,7 +30,6 @@
#include <proto/log.h>
#include <proto/stream.h>
#include <proto/stream_interface.h>
-#include <proto/shctx.h>
#include <common/cfgparse.h>
diff --git a/src/shctx.c b/src/shctx.c
index 113828a..1a38b91 100644
--- a/src/shctx.c
+++ b/src/shctx.c
@@ -16,7 +16,7 @@
#include <import/ebmbtree.h>
#include <types/global.h>
#include <haproxy/list.h>
-#include "proto/shctx.h"
+#include <haproxy/shctx.h>
#if !defined (USE_PRIVATE_CACHE)
diff --git a/src/ssl_sock.c b/src/ssl_sock.c
index 6156012..44818d0 100644
--- a/src/ssl_sock.c
+++ b/src/ssl_sock.c
@@ -48,6 +48,7 @@
#include <haproxy/chunk.h>
#include <haproxy/errors.h>
#include <haproxy/openssl-compat.h>
+#include <haproxy/shctx.h>
#include <haproxy/tools.h>
#include <haproxy/ticks.h>
#include <haproxy/time.h>
@@ -79,7 +80,6 @@
#include <proto/stream_interface.h>
#include <proto/log.h>
#include <proto/proxy.h>
-#include <proto/shctx.h>
#include <proto/ssl_ckch.h>
#include <proto/ssl_crtlist.h>
#include <proto/ssl_sock.h>