modules/portlib/src/main/native/port/windows/hysl.c File Reference


Detailed Description

shared library

#include <windows.h>
#include "hyport.h"
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#include "portnls.h"

Functions

UDATA VMCALL hysl_open_shared_library (struct HyPortLibrary *portLibrary, char *name, UDATA *descriptor, BOOLEAN decorate)
 Opens a shared library.
UDATA VMCALL hysl_close_shared_library (struct HyPortLibrary *portLibrary, UDATA descriptor)
 Close a shared library.
UDATA VMCALL hysl_lookup_name (struct HyPortLibrary *portLibrary, UDATA descriptor, char *name, UDATA *func, const char *argSignature)
 Search for a function named 'name' taking argCount in the shared library 'descriptor'.
void VMCALL hysl_shutdown (struct HyPortLibrary *portLibrary)
 PortLibrary shutdown.
I_32 VMCALL hysl_startup (struct HyPortLibrary *portLibrary)
 PortLibrary startup.


Function Documentation

UDATA VMCALL hysl_close_shared_library ( struct HyPortLibrary portLibrary,
UDATA  descriptor 
)

Close a shared library.

Parameters:
[in] portLibrary The port library.
[in] descriptor Shared library handle to close.
Returns:
0 on success, any other value on failure.

UDATA VMCALL hysl_lookup_name ( struct HyPortLibrary portLibrary,
UDATA  descriptor,
char *  name,
UDATA *  func,
const char *  argSignature 
)

Search for a function named 'name' taking argCount in the shared library 'descriptor'.

Parameters:
[in] portLibrary The port library.
[in] descriptor Shared library to search.
[in] name Function to look up.
[out] func Pointer to the function.
[in] argSignature Argument signature.
Returns:
0 on success, any other value on failure.
argSignature is a C (ie: NUL-terminated) string with the following possible values for each character:

V - void Z - boolean B - byte C - char (16 bits) I - integer (32 bits) J - long (64 bits) F - float (32 bits) D - double (64 bits) L - object / pointer (32 or 64, depending on platform) P - pointer-width platform data. (in this context an IDATA)

Lower case signature characters imply unsigned value. Upper case signature characters imply signed values. If it doesn't make sense to be signed/unsigned (eg: V, L, F, D Z) the character is upper case.

argList[0] is the return type from the function. The argument list is as it appears in english: list is left (1) to right (argCount)

Note:
contents of func are undefined on failure.

UDATA VMCALL hysl_open_shared_library ( struct HyPortLibrary portLibrary,
char *  name,
UDATA *  descriptor,
BOOLEAN  decorate 
)

Opens a shared library.

Parameters:
[in] portLibrary The port library.
[in] name path Null-terminated string containing the shared library.
[out] descriptor Pointer to memory which is filled in with shared-library handle on success.
[in] decorate Boolean value indicates whether name should be decorated if it contains path information and cannot be found.
Returns:
0 on success, any other value on failure.
Note:
contents of descriptor are undefined on failure.

void VMCALL hysl_shutdown ( struct HyPortLibrary portLibrary  ) 

PortLibrary shutdown.

This function is called during shutdown of the portLibrary. Any resources that were created by hysl_startup should be destroyed here.

Parameters:
[in] portLibrary The port library.
Note:
Most implementations will be empty.

I_32 VMCALL hysl_startup ( struct HyPortLibrary portLibrary  ) 

PortLibrary startup.

This function is called during startup of the portLibrary. Any resources that are required for the shared library operations may be created here. All resources created here should be destroyed in hysl_shutdown.

Parameters:
[in] portLibrary The port library.
Returns:
0 on success, negative error code on failure. Error code values returned are
  • HYPORT_ERROR_STARTUP_SL
Note:
Most implementations will simply return success.


Genereated on Tue Dec 9 14:12:59 2008 by Doxygen.

(c) Copyright 2005, 2008 The Apache Software Foundation or its licensors, as applicable.