PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
win32.h File Reference
Include dependency graph for win32.h:

Go to the source code of this file.

Macros

#define pg_dlopen(f)   dlopen((f), 1)
 
#define pg_dlsym   dlsym
 
#define pg_dlclose   dlclose
 
#define pg_dlerror   dlerror
 

Functions

char * dlerror (void)
 
int dlclose (void *handle)
 
void * dlsym (void *handle, const char *symbol)
 
void * dlopen (const char *path, int mode)
 

Macro Definition Documentation

#define pg_dlclose   dlclose

Definition at line 11 of file win32.h.

#define pg_dlerror   dlerror

Definition at line 12 of file win32.h.

#define pg_dlopen (   f)    dlopen((f), 1)

Definition at line 9 of file win32.h.

#define pg_dlsym   dlsym

Definition at line 10 of file win32.h.

Function Documentation

int dlclose ( void *  handle)

Definition at line 41 of file win32.c.

References last_dyn_error, and set_dl_error().

Referenced by BSD44_derived_dlclose().

42 {
43  if (!FreeLibrary((HMODULE) handle))
44  {
45  set_dl_error();
46  return 1;
47  }
48  last_dyn_error[0] = 0;
49  return 0;
50 }
static char last_dyn_error[512]
Definition: win32.c:10
static void set_dl_error(void)
Definition: win32.c:13
char* dlerror ( void  )

Definition at line 32 of file win32.c.

References last_dyn_error, and NULL.

Referenced by BSD44_derived_dlopen().

33 {
34  if (last_dyn_error[0])
35  return last_dyn_error;
36  else
37  return NULL;
38 }
static char last_dyn_error[512]
Definition: win32.c:10
#define NULL
Definition: c.h:226
void* dlopen ( const char *  path,
int  mode 
)

Definition at line 68 of file win32.c.

References last_dyn_error, NULL, and set_dl_error().

Referenced by BSD44_derived_dlopen().

69 {
70  HMODULE h;
71  int prevmode;
72 
73  /* Disable popup error messages when loading DLLs */
74  prevmode = SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX);
75  h = LoadLibrary(path);
76  SetErrorMode(prevmode);
77 
78  if (!h)
79  {
80  set_dl_error();
81  return NULL;
82  }
83  last_dyn_error[0] = 0;
84  return (void *) h;
85 }
static char last_dyn_error[512]
Definition: win32.c:10
#define NULL
Definition: c.h:226
static void set_dl_error(void)
Definition: win32.c:13
void* dlsym ( void *  handle,
const char *  symbol 
)

Definition at line 53 of file win32.c.

References last_dyn_error, NULL, and set_dl_error().

Referenced by BSD44_derived_dlsym().

54 {
55  void *ptr;
56 
57  ptr = GetProcAddress((HMODULE) handle, symbol);
58  if (!ptr)
59  {
60  set_dl_error();
61  return NULL;
62  }
63  last_dyn_error[0] = 0;
64  return ptr;
65 }
static char last_dyn_error[512]
Definition: win32.c:10
#define NULL
Definition: c.h:226
static void set_dl_error(void)
Definition: win32.c:13
unsigned char symbol
Definition: api.h:2