mirror of
https://github.com/postgres/postgres.git
synced 2025-08-31 17:02:12 +03:00
pgindent run. Make it all clean.
This commit is contained in:
@@ -609,4 +609,4 @@ findMain(void)
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif /* HAVE_DLOPEN */
|
||||
#endif /* HAVE_DLOPEN */
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: aix.h,v 1.4 2001/02/10 02:31:26 tgl Exp $
|
||||
* $Id: aix.h,v 1.5 2001/03/22 03:59:42 momjian Exp $
|
||||
*
|
||||
* @(#)dlfcn.h 1.4 revision of 95/04/25 09:36:52
|
||||
* This is an unpublished work copyright (c) 1992 HELIOS Software GmbH
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
#include <dlfcn.h>
|
||||
|
||||
#else /* HAVE_DLOPEN */
|
||||
#else /* HAVE_DLOPEN */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
@@ -54,13 +54,13 @@ extern "C"
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* HAVE_DLOPEN */
|
||||
#endif /* HAVE_DLOPEN */
|
||||
|
||||
#include "utils/dynamic_loader.h"
|
||||
|
||||
#define pg_dlopen(f) dlopen(f, RTLD_LAZY)
|
||||
#define pg_dlsym dlsym
|
||||
#define pg_dlclose dlclose
|
||||
#define pg_dlerror dlerror
|
||||
#define pg_dlclose dlclose
|
||||
#define pg_dlerror dlerror
|
||||
|
||||
#endif /* PORT_PROTOS_H */
|
||||
|
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/port/dynloader/Attic/beos.c,v 1.6 2001/02/10 02:31:26 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/port/dynloader/Attic/beos.c,v 1.7 2001/03/22 03:59:42 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -18,59 +18,66 @@
|
||||
#include "utils/dynamic_loader.h"
|
||||
|
||||
|
||||
void *
|
||||
void *
|
||||
pg_dlopen(char *filename)
|
||||
{
|
||||
image_id* im;
|
||||
|
||||
/* Handle memory allocation to store the Id of the shared object*/
|
||||
im=(image_id*)(malloc(sizeof(image_id)));
|
||||
|
||||
image_id *im;
|
||||
|
||||
/* Handle memory allocation to store the Id of the shared object */
|
||||
im = (image_id *) (malloc(sizeof(image_id)));
|
||||
|
||||
/* Add-on loading */
|
||||
*im=beos_dl_open(filename);
|
||||
|
||||
*im = beos_dl_open(filename);
|
||||
|
||||
return im;
|
||||
}
|
||||
|
||||
|
||||
char *
|
||||
char *
|
||||
pg_dlerror()
|
||||
{
|
||||
static char errmsg[] = "Load Add-On failed";
|
||||
|
||||
return errmsg;
|
||||
}
|
||||
|
||||
PGFunction
|
||||
PGFunction
|
||||
pg_dlsym(void *handle, char *funcname)
|
||||
{
|
||||
PGFunction fpt;
|
||||
PGFunction fpt;
|
||||
|
||||
/* Checking that "Handle" is valid */
|
||||
if ((handle) && ((*(int*)(handle))>=0))
|
||||
if ((handle) && ((*(int *) (handle)) >= 0))
|
||||
{
|
||||
/* Loading symbol */
|
||||
if(get_image_symbol(*((int*)(handle)),funcname,B_SYMBOL_TYPE_TEXT,(void**)&fpt)==B_OK);
|
||||
if (get_image_symbol(*((int *) (handle)), funcname, B_SYMBOL_TYPE_TEXT, (void **) &fpt) == B_OK);
|
||||
{
|
||||
/* Sometime the loader return B_OK for an inexistant function with an invalid address !!!
|
||||
Check that the return address is in the image range */
|
||||
image_info info;
|
||||
get_image_info(*((int*)(handle)),&info);
|
||||
if ((fpt<info.text) || (fpt>=(info.text+info.text_size))) return NULL;
|
||||
|
||||
/*
|
||||
* Sometime the loader return B_OK for an inexistant function
|
||||
* with an invalid address !!! Check that the return address
|
||||
* is in the image range
|
||||
*/
|
||||
image_info info;
|
||||
|
||||
get_image_info(*((int *) (handle)), &info);
|
||||
if ((fpt < info.text) ||(fpt >= (info.text +info.text_size)))
|
||||
return NULL;
|
||||
return fpt;
|
||||
}
|
||||
elog(NOTICE, "loading symbol '%s' failed ",funcname);
|
||||
elog(NOTICE, "loading symbol '%s' failed ", funcname);
|
||||
}
|
||||
elog(NOTICE, "add-on not loaded correctly");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
pg_dlclose(void *handle)
|
||||
{
|
||||
/* Checking that "Handle" is valid */
|
||||
if ((handle) && ((*(int*)(handle))>=0))
|
||||
if ((handle) && ((*(int *) (handle)) >= 0))
|
||||
{
|
||||
if (beos_dl_close(*(image_id*)handle)!=B_OK)
|
||||
if (beos_dl_close(*(image_id *) handle) != B_OK)
|
||||
elog(NOTICE, "error while unloading add-on");
|
||||
free(handle);
|
||||
}
|
||||
|
@@ -1,16 +1,17 @@
|
||||
/*
|
||||
* These routines were taken from the Apache source, but were made
|
||||
* available with a PostgreSQL-compatible license. Kudos Wilfredo
|
||||
* available with a PostgreSQL-compatible license. Kudos Wilfredo
|
||||
* S<>nchez <wsanchez@apple.com>.
|
||||
*
|
||||
* $Header: /cvsroot/pgsql/src/backend/port/dynloader/darwin.c,v 1.4 2000/12/11 00:49:54 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/port/dynloader/darwin.c,v 1.5 2001/03/22 03:59:42 momjian Exp $
|
||||
*/
|
||||
|
||||
#include "postgres.h"
|
||||
#include <mach-o/dyld.h>
|
||||
#include "dynloader.h"
|
||||
|
||||
void *pg_dlopen(char *filename)
|
||||
void *
|
||||
pg_dlopen(char *filename)
|
||||
{
|
||||
NSObjectFileImage image;
|
||||
|
||||
@@ -20,16 +21,18 @@ void *pg_dlopen(char *filename)
|
||||
return NSLinkModule(image, filename, TRUE);
|
||||
}
|
||||
|
||||
void pg_dlclose(void *handle)
|
||||
void
|
||||
pg_dlclose(void *handle)
|
||||
{
|
||||
NSUnLinkModule(handle,FALSE);
|
||||
NSUnLinkModule(handle, FALSE);
|
||||
return;
|
||||
}
|
||||
|
||||
PGFunction pg_dlsym(void *handle, char *funcname)
|
||||
PGFunction
|
||||
pg_dlsym(void *handle, char *funcname)
|
||||
{
|
||||
NSSymbol symbol;
|
||||
char *symname = (char*)malloc(strlen(funcname)+2);
|
||||
NSSymbol symbol;
|
||||
char *symname = (char *) malloc(strlen(funcname) + 2);
|
||||
|
||||
sprintf(symname, "_%s", funcname);
|
||||
if (NSIsSymbolNameDefined(symname))
|
||||
@@ -41,11 +44,12 @@ PGFunction pg_dlsym(void *handle, char *funcname)
|
||||
else
|
||||
{
|
||||
free(symname);
|
||||
return (PGFunction)NULL;
|
||||
return (PGFunction) NULL;
|
||||
}
|
||||
}
|
||||
|
||||
char *pg_dlerror(void)
|
||||
char *
|
||||
pg_dlerror(void)
|
||||
{
|
||||
return "no error message available";
|
||||
}
|
||||
|
@@ -1,8 +1,8 @@
|
||||
/* $Header: /cvsroot/pgsql/src/backend/port/dynloader/darwin.h,v 1.3 2000/12/11 00:49:54 tgl Exp $ */
|
||||
/* $Header: /cvsroot/pgsql/src/backend/port/dynloader/darwin.h,v 1.4 2001/03/22 03:59:42 momjian Exp $ */
|
||||
|
||||
#include "fmgr.h"
|
||||
|
||||
void* pg_dlopen(char *filename);
|
||||
void *pg_dlopen(char *filename);
|
||||
PGFunction pg_dlsym(void *handle, char *funcname);
|
||||
void pg_dlclose(void *handle);
|
||||
char* pg_dlerror(void);
|
||||
char *pg_dlerror(void);
|
||||
|
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/port/dynloader/hpux.c,v 1.17 2001/02/10 02:31:26 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/port/dynloader/hpux.c,v 1.18 2001/03/22 03:59:43 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* all functions are defined here -- it's impossible to trace the
|
||||
@@ -28,13 +28,14 @@
|
||||
void *
|
||||
pg_dlopen(char *filename)
|
||||
{
|
||||
|
||||
/*
|
||||
* Use BIND_IMMEDIATE so that undefined symbols cause a failure return
|
||||
* from shl_load(), rather than an abort() later on when we attempt to
|
||||
* call the library!
|
||||
*/
|
||||
shl_t handle = shl_load(filename,
|
||||
BIND_IMMEDIATE | BIND_VERBOSE | DYNAMIC_PATH,
|
||||
BIND_IMMEDIATE | BIND_VERBOSE | DYNAMIC_PATH,
|
||||
0L);
|
||||
|
||||
return (void *) handle;
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/* $Header: /cvsroot/pgsql/src/backend/port/dynloader/solaris.h,v 1.2 2001/02/10 02:31:26 tgl Exp $ */
|
||||
/* $Header: /cvsroot/pgsql/src/backend/port/dynloader/solaris.h,v 1.3 2001/03/22 03:59:43 momjian Exp $ */
|
||||
|
||||
#ifndef DYNLOADER_SOLARIS_H
|
||||
#define DYNLOADER_SOLARIS_H
|
||||
@@ -11,4 +11,4 @@
|
||||
#define pg_dlclose dlclose
|
||||
#define pg_dlerror dlerror
|
||||
|
||||
#endif /* DYNLOADER_SOLARIS_H */
|
||||
#endif /* DYNLOADER_SOLARIS_H */
|
||||
|
Reference in New Issue
Block a user