Commit 51175595 authored by Geoff Thorpe's avatar Geoff Thorpe
Browse files

Constification, and a silly mistake in the comments.

parent eca57e92
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -72,11 +72,11 @@ typedef struct dso_meth_st
	{
	const char *name;
	/* Loads a shared library */
	int (*dso_load)(DSO *dso, char *filename);
	int (*dso_load)(DSO *dso, const char *filename);
	/* Unloads a shared library */
	int (*dso_unload)(DSO *dso);
	/* Binds a function, variable, or whatever */
	int (*dso_bind)(DSO *dso, char *symname, void **symptr);
	int (*dso_bind)(DSO *dso, const char *symname, void **symptr);

/* I don't think this would actually be used in any circumstances. */
#if 0
@@ -120,13 +120,13 @@ DSO_METHOD *DSO_get_method(DSO *dso);
DSO_METHOD *DSO_set_method(DSO *dso, DSO_METHOD *meth);

/* The all-singing all-dancing load function, you normally pass NULL
 * for the last two parameters. Use DSO_up and DSO_free for reference
 * count handling. */
DSO *DSO_load(DSO *dso, char *filename, DSO_METHOD *meth);
 * for the first and third parameters. Use DSO_up and DSO_free for
 * reference count handling. */
DSO *DSO_load(DSO *dso, const char *filename, DSO_METHOD *meth);

/* This function binds to a function, variable, whatever inside a
 * shared library. */
void *DSO_bind(DSO *dso, char *symname);
void *DSO_bind(DSO *dso, const char *symname);

/* This method is the default, but will beg, borrow, or steal whatever
 * method should be the default on any particular platform (including
+4 −4
Original line number Diff line number Diff line
@@ -69,9 +69,9 @@ DSO_METHOD *DSO_METHOD_dl(void)

#include <dl.h>

static int dl_load(DSO *dso, char *filename);
static int dl_load(DSO *dso, const char *filename);
static int dl_unload(DSO *dso);
static int dl_bind(DSO *dso, char *symname, void **symptr);
static int dl_bind(DSO *dso, const char *symname, void **symptr);
#if 0
static int dl_unbind(DSO *dso, char *symname, void *symptr);
static int dl_init(DSO *dso);
@@ -102,7 +102,7 @@ DSO_METHOD *DSO_METHOD_dl(void)
 * type so the cast is safe.
 */

static int dl_load(DSO *dso, char *filename)
static int dl_load(DSO *dso, const char *filename)
	{
	shl_t ptr;

@@ -148,7 +148,7 @@ static int dl_unload(DSO *dso)
	return(1);
	}

static int dl_bind(DSO *dso, char *symname, void **symptr)
static int dl_bind(DSO *dso, const char *symname, void **symptr)
	{
	shl_t ptr;
	void *sym;
+4 −4
Original line number Diff line number Diff line
@@ -71,9 +71,9 @@ DSO_METHOD *DSO_METHOD_dlfcn(void)
#include <dlfcn.h>
#endif

static int dlfcn_load(DSO *dso, char *filename);
static int dlfcn_load(DSO *dso, const char *filename);
static int dlfcn_unload(DSO *dso);
static int dlfcn_bind(DSO *dso, char *symname, void **symptr);
static int dlfcn_bind(DSO *dso, const char *symname, void **symptr);
#if 0
static int dlfcn_unbind(DSO *dso, char *symname, void *symptr);
static int dlfcn_init(DSO *dso);
@@ -102,7 +102,7 @@ DSO_METHOD *DSO_METHOD_dlfcn(void)
 * (i) the handle (void*) returned from dlopen().
 */

static int dlfcn_load(DSO *dso, char *filename)
static int dlfcn_load(DSO *dso, const char *filename)
	{
	void *ptr;

@@ -148,7 +148,7 @@ static int dlfcn_unload(DSO *dso)
	return(1);
	}

static int dlfcn_bind(DSO *dso, char *symname, void **symptr)
static int dlfcn_bind(DSO *dso, const char *symname, void **symptr)
	{
	void *ptr, *sym;

+2 −2
Original line number Diff line number Diff line
@@ -187,7 +187,7 @@ int DSO_up(DSO *dso)
	return(1);
	}

DSO *DSO_load(DSO *dso, char *filename, DSO_METHOD *meth)
DSO *DSO_load(DSO *dso, const char *filename, DSO_METHOD *meth)
	{
	DSO *ret;
	int allocated = 0;
@@ -227,7 +227,7 @@ DSO *DSO_load(DSO *dso, char *filename, DSO_METHOD *meth)
	return(ret);
	}

void *DSO_bind(DSO *dso, char *symname)
void *DSO_bind(DSO *dso, const char *symname)
	{
	void *ret = NULL;

+4 −4
Original line number Diff line number Diff line
@@ -67,9 +67,9 @@ DSO_METHOD *DSO_METHOD_win32(void)
	}
#else

static int win32_load(DSO *dso, char *filename);
static int win32_load(DSO *dso, const char *filename);
static int win32_unload(DSO *dso);
static int win32_bind(DSO *dso, char *symname, void **symptr);
static int win32_bind(DSO *dso, const char *symname, void **symptr);
#if 0
static int win32_unbind(DSO *dso, char *symname, void *symptr);
static int win32_init(DSO *dso);
@@ -99,7 +99,7 @@ DSO_METHOD *DSO_METHOD_win32(void)
 *      LoadLibrary(), and copied.
 */

static int win32_load(DSO *dso, char *filename)
static int win32_load(DSO *dso, const char *filename)
	{
	HINSTANCE h, *p;

@@ -159,7 +159,7 @@ static int win32_unload(DSO *dso)
	return(1);
	}

static int win32_bind(DSO *dso, char *symname, void **symptr)
static int win32_bind(DSO *dso, const char *symname, void **symptr)
	{
	HINSTANCE *ptr;
	void *sym;