1
/*-------------------------------------------------------------------------
4
* Dynamic Loader for Postgres for BeOS
6
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
7
* Portions Copyright (c) 1994, Regents of the University of California
11
* $PostgreSQL: pgsql/src/backend/port/dynloader/beos.c,v 1.15 2004-12-31 22:00:32 pgsql Exp $
13
*-------------------------------------------------------------------------
18
#include "utils/dynamic_loader.h"
22
pg_dlopen(char *filename)
26
/* Handle memory allocation to store the Id of the shared object */
27
im = (image_id *) (malloc(sizeof(image_id)));
30
*im = beos_dl_open(filename);
39
static char errmsg[] = "Load Add-On failed";
45
pg_dlsym(void *handle, char *funcname)
49
/* Checking that "Handle" is valid */
50
if ((handle) && ((*(int *) (handle)) >= 0))
52
beos_dl_sym(*((int *) (handle)), funcname, (void **) &fpt);
55
elog(WARNING, "add-on not loaded correctly");
60
pg_dlclose(void *handle)
62
/* Checking that "Handle" is valid */
63
if ((handle) && ((*(int *) (handle)) >= 0))
65
if (beos_dl_close(*(image_id *) handle) != B_OK)
66
elog(WARNING, "error while unloading add-on");