summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaiki Ueno <dueno@redhat.com>2017-01-25 11:23:57 +0100
committerDaiki Ueno <ueno@gnu.org>2017-01-25 11:47:07 +0100
commit9bb1613011370b00c7b561d7de30c205a246a586 (patch)
treeddd86a9781482b8d2dbcc59e12f574ff20d2d40e
parent08ecac9deb63904c6482eab64198580aac9e1a4e (diff)
virtual: Make virtual-fixed internal API cleaner
Add proper inclusion guard to virtual-fixed.h and move the declarations of the (un)initialization functions there.
-rw-r--r--p11-kit/util.c10
-rw-r--r--p11-kit/virtual-fixed.h9
-rw-r--r--p11-kit/virtual.c4
-rw-r--r--p11-kit/virtual.h4
4 files changed, 16 insertions, 11 deletions
diff --git a/p11-kit/util.c b/p11-kit/util.c
index 816952f..e51223e 100644
--- a/p11-kit/util.c
+++ b/p11-kit/util.c
@@ -45,7 +45,7 @@
#include "p11-kit.h"
#include "private.h"
#include "proxy.h"
-#include "virtual.h"
+#include "virtual-fixed.h"
#include <assert.h>
#include <stdarg.h>
@@ -252,7 +252,7 @@ void
_p11_kit_init (void)
{
p11_library_init_once ();
- p11_virtual_init_fixed ();
+ p11_virtual_fixed_init ();
}
#ifdef __GNUC__
@@ -262,7 +262,7 @@ void
_p11_kit_fini (void)
{
p11_proxy_module_cleanup ();
- p11_virtual_uninit_fixed ();
+ p11_virtual_fixed_uninit ();
p11_library_uninit ();
}
@@ -280,14 +280,14 @@ DllMain (HINSTANCE instance,
switch (reason) {
case DLL_PROCESS_ATTACH:
p11_library_init ();
- p11_virtual_init_fixed ();
+ p11_virtual_fixed_init ();
break;
case DLL_THREAD_DETACH:
p11_library_thread_cleanup ();
break;
case DLL_PROCESS_DETACH:
p11_proxy_module_cleanup ();
- p11_virtual_uninit_fixed ();
+ p11_virtual_fixed_uninit ();
p11_library_uninit ();
break;
default:
diff --git a/p11-kit/virtual-fixed.h b/p11-kit/virtual-fixed.h
index 1cb685d..cc3b2c0 100644
--- a/p11-kit/virtual-fixed.h
+++ b/p11-kit/virtual-fixed.h
@@ -32,6 +32,10 @@
* Author: Daiki Ueno
*/
+#ifndef __P11_VIRTUAL_FIXED_H__
+#define __P11_VIRTUAL_FIXED_H__
+
+/* The maximum number of precompiled closures. */
#define P11_VIRTUAL_MAX_FIXED 64
#define P11_VIRTUAL_FIXED_FUNCTIONS(fixed_index) \
@@ -1133,3 +1137,8 @@ fixed ## fixed_index ## _C_GetFunctionList (CK_FUNCTION_LIST_PTR_PTR list) \
short_C_CancelFunction, \
fixed ## fixed_index ## _C_WaitForSlotEvent \
}
+
+void p11_virtual_fixed_init (void);
+void p11_virtual_fixed_uninit (void);
+
+#endif /* __P11_VIRTUAL_FIXED_H__ */
diff --git a/p11-kit/virtual.c b/p11-kit/virtual.c
index a9eae56..b066b4b 100644
--- a/p11-kit/virtual.c
+++ b/p11-kit/virtual.c
@@ -102,7 +102,7 @@ static void
(CK_FUNCTION_LIST_PTR module);
void
-p11_virtual_init_fixed (void)
+p11_virtual_fixed_init (void)
{
p11_lock ();
p11_mutex_init (&fixed_mutex);
@@ -111,7 +111,7 @@ p11_virtual_init_fixed (void)
}
void
-p11_virtual_uninit_fixed (void)
+p11_virtual_fixed_uninit (void)
{
p11_lock ();
p11_mutex_uninit (&fixed_mutex);
diff --git a/p11-kit/virtual.h b/p11-kit/virtual.h
index 8083eb9..3124cc9 100644
--- a/p11-kit/virtual.h
+++ b/p11-kit/virtual.h
@@ -63,8 +63,4 @@ bool p11_virtual_is_wrapper (CK_FUNCTION_LIST *module);
void p11_virtual_unwrap (CK_FUNCTION_LIST *module);
-void p11_virtual_init_fixed (void);
-void p11_virtual_uninit_fixed
- (void);
-
#endif /* __P11_VIRTUAL_H__ */