Skip to content
Browse files

Added proper headerizer section

  • Loading branch information...
1 parent e4d981a commit 84e0c30a157e945acfead00008aafc9466d28a46 @petdance petdance committed Mar 30, 2012
Showing with 34 additions and 5 deletions.
  1. +34 −5 src/platform/generic/dl.c
View
39 src/platform/generic/dl.c
@@ -28,6 +28,31 @@ Parrot functions which wrap around standard library functions for handling dynam
# include <dlfcn.h>
#endif
+/* HEADERIZER HFILE: none */
+/* HEADERIZER BEGIN: static */
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
+
+PARROT_WARN_UNUSED_RESULT
+PARROT_CAN_RETURN_NULL
+static void * find_handle_entry(ARGIN(const void *handle))
+ __attribute__nonnull__(1);
+
+static void push_handle_entry(ARGIN(void *handle))
+ __attribute__nonnull__(1);
+
+static void remove_handle_entry(ARGIN(void *handle))
+ __attribute__nonnull__(1);
+
+#define ASSERT_ARGS_find_handle_entry __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+ PARROT_ASSERT_ARG(handle))
+#define ASSERT_ARGS_push_handle_entry __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+ PARROT_ASSERT_ARG(handle))
+#define ASSERT_ARGS_remove_handle_entry __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+ PARROT_ASSERT_ARG(handle))
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
+/* HEADERIZER END: static */
+
+
#define PARROT_DLOPEN_FLAGS RTLD_LAZY
#ifdef PARROT_HAS_HEADER_DLFCN
@@ -40,7 +65,7 @@ struct handle_entry {
struct handle_entry *handle_list = NULL;
static void
-push_handle_entry(void *handle)
+push_handle_entry(ARGIN(void *handle))
{
struct handle_entry *e;
@@ -54,8 +79,10 @@ push_handle_entry(void *handle)
handle_list = e;
}
+PARROT_WARN_UNUSED_RESULT
+PARROT_CAN_RETURN_NULL
static void *
-find_handle_entry(const void *handle)
+find_handle_entry(ARGIN(const void *handle))
{
const struct handle_entry *e;
@@ -68,7 +95,7 @@ find_handle_entry(const void *handle)
}
static void
-remove_handle_entry(void *handle)
+remove_handle_entry(ARGIN(void *handle))
{
if (handle_list) {
if (handle_list->handle == handle) {
@@ -91,8 +118,6 @@ remove_handle_entry(void *handle)
-/* HEADERIZER HFILE: none */
-
/*
=item C<void * Parrot_dlopen(const char *filename, Parrot_dlopen_flags flags)>
@@ -104,6 +129,7 @@ argument and returns a handle to it.
*/
+PARROT_WARN_UNUSED_RESULT
PARROT_CAN_RETURN_NULL
void *
Parrot_dlopen(const char *filename, Parrot_dlopen_flags flags)
@@ -131,6 +157,7 @@ failure in use of C<Parrot_dlopen>, C<Parrot_dlclose> or C<Parrot_dlsym>.
*/
+PARROT_WARN_UNUSED_RESULT
PARROT_CAN_RETURN_NULL
const char *
Parrot_dlerror(void)
@@ -153,6 +180,7 @@ returns address where symbol is located.
*/
+PARROT_WARN_UNUSED_RESULT
PARROT_CAN_RETURN_NULL
void *
Parrot_dlsym(void *handle, const char *symbol)
@@ -177,6 +205,7 @@ by argument. Returns C<0> on success and C<-1> on failure.
*/
+PARROT_WARN_UNUSED_RESULT
int
Parrot_dlclose(void *handle)
{

0 comments on commit 84e0c30

Please sign in to comment.
Something went wrong with that request. Please try again.