home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1998 May
/
Pcwk5b98.iso
/
WEBSERVE
/
PI3
/
PI3WEB.EXE
/
DEVEL
/
INCLUDE
/
PIDLL.H
< prev
next >
Wrap
C/C++ Source or Header
|
1997-10-19
|
6KB
|
212 lines
/*____________________________________________________________________________*\
*
Copyright (c) 1997 John Roy. All rights reserved.
These sources, libraries and applications are
FREE FOR COMMERCIAL AND NON-COMMERCIAL USE
as long as the following conditions are adhered to.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
3. Redistributions of any form whatsoever and all advertising materials
mentioning features must contain the following
acknowledgment:
"This product includes software developed by John Roy
(http://www.johnroy.com/pi3/)."
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHORS OR ITS CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE.
*____________________________________________________________________________*|
*
* $Source: PIDLL.h$
* $Date: Sun Aug 10 06:29:34 1997$
*
Description:
\*____________________________________________________________________________*/
/* $HeaderTop:$ */
#ifndef PIDLL_H_
#define PIDLL_H_
#include "PiAPI.h"
/*____________________________________________________________________________*\
*
Typedefs:
\*____________________________________________________________________________*/
typedef struct DLL PIDLL;
/*____________________________________________________________________________*\
*
Name:
PIDLL_new
Synopsis:
PIDLL *PIDLL_new( const char *pPath )
Description:
Create a new dynamic link library object by loading the
library pointed to by pPath.
Notes:
Return Values:
On success PIDLL_new returns a pointer to a new dynamic link
library.
Errors:
If pPath is NULL or memory cannot be allocated PIDLL_new() will
return NULL.
More specific error information can be retrieved using
PIPlatform_getLastError().
See Also:
PIDLL_delete().
\*____________________________________________________________________________*/
PUBLIC_PIAPI PIDLL *PIDLL_new( const char *pPath );
/*____________________________________________________________________________*\
*
Name:
PIDLL_isLoaded
Synopsis:
int PIDLL_isLoaded( const PIDLL *pDLL )
Description:
Indicates whether or not a new DLL object actually represents
a loaded dynamic link library.
Notes:
Return Values:
PIDLL_isLoaded() returns either PIAPI_TRUE or PIAPI_FALSE. If
PIAPI_FALSE is returned and no error code is set (see below), the
function PIDLL_getErrorDescription() can be used to get a
text description of the reason the library could not be loaded.
Errors:
On error PIDLL_isLoaded() returns PIAPI_FALSE and sets the
error code to a value other than PIAPI_COMPLETED. This error
code may be retrieved using PIPlatform_getLastError().
See Also:
PIDLL_new().
\*____________________________________________________________________________*/
PUBLIC_PIAPI int PIDLL_isLoaded( const PIDLL *pDLL );
/*____________________________________________________________________________*\
*
Name:
PIDLL_delete
Synopsis:
int PIDLL_delete( PIDLL *pDLL )
Description:
Destroys and free memory associated with the dynamic link object
pDLL.
Notes:
Whether or not the DLL is unloaded from the address space of
the process is implementation specific. Typically a DLL only
becomes unloaded when the load reference count reaches zero.
Return Values:
On success PIDLL_delete() returns zero (PIAPI_COMPLETED).
Errors:
On error PIDLL_delete() returns a negative value.
More specific error information can be retrieved using
PIPlatform_getLastError().
See Also:
PIDLL_new()
\*____________________________________________________________________________*/
PUBLIC_PIAPI int PIDLL_delete( PIDLL *pDLL );
/*____________________________________________________________________________*\
*
Name:
PIDLL_getAddress
Synopsis:
void *PIDLL_getAddress( PIDLL *pDLL, const char *pSymbolName )
Description:
Returns the address of symbol pSymbolName is the DLL pDLL.
Notes:
This function is intended primarily for retrieving the address
of functions with "C" linkage.
Return Values:
On success PIDLL_getAddress() returns a pointer to the memory
address of the required symbol.
Errors:
PIDLL_getAddress returns NULL if the address of the function
could not be retrieved.
More specific error information can be retrieved using
PIPlatform_getLastError().
Additionally the PIDLL_getErrorDescription() can be used to get
an english description of the last error.
See Also:
\*____________________________________________________________________________*/
PUBLIC_PIAPI void *PIDLL_getAddress( PIDLL *pDLL, const char *pSymbolName );
/*____________________________________________________________________________*\
*
Name:
PIDLL_getErrorDescription
Synopsis:
const char *PIDLL_getErrorDescription( const PIDLL *pDLL )
Description:
Returns an english description of the last error which
occurred when performing a DLL operation.
Notes:
The error message string is allocate by the DLL object and
is invalided by invoking another operation on that DLL or
destroying the DLL object with PIDLL_delete().
Return Values:
PIDLL_getErrorDescription() always returns an error
description.
Errors:
None.
See Also:
\*____________________________________________________________________________*/
PUBLIC_PIAPI const char *PIDLL_getErrorDescription( const PIDLL *pDLL );
#endif /* PIDLL_H_ */