PerlEz - PerlEz host DLL
This document attempts to describe the functions of the PerlEz host Dynamicly
Linked Library (DLL). Please refer any questions or comments to the author below.
PerlEz has one specific data type, PERLEZHANDLE; this is a non-zero handle to
a Perl interpreter that is created and can be accessed by the routines described below.
PERLEZHANDLE PerlEzCreate(LPCSTR lpFileName, LPSTR lpOptions);
- DESCRIPTION:
-
-
Creates a Perl interpreter. The return value is required parameter for all subsequent ‘PerlEz’ calls.
Multiple interpreters can be created, but only one will be executing at a time.
- PARAMS:
-
-
lpFileName a pointer to a ASCIIZ string that is the name of a file; can be NULL
-
lpOptions a pointer to a ASCIIZ string that are the command line options that
will be provided before the script; can be NULL. This parameter is used for setting @INC or debugging.
- RETURNS:
-
-
A non zero handle to a Perl interpreter if successful; zero otherwise. Call PerlEzDelete to release this handle.
See also PerlEzDelete
BOOL PerlEzDelete(PERLEZHANDLE hHandle);
- DESCRIPTION:
-
-
Deletes a previously created Perl interpreter. Releases all resources allocated by PerlEzCreate.
- PARAMS:
-
-
hHandle a handle returned by the call to PerlEzCreate
- RETURNS:
-
-
True if no error false otherwise.
int PerlEzEvalString(PERLEZHANDLE hHandle, LPCSTR lpString, LPSTR lpBuffer, DWORD dwBufSize);
- DESCRIPTION:
-
-
Evaluates the string a returns the result in lpBuffer. If there is an error $! is returned in lpBuffer.
- PARAMS:
-
-
hHandle a handle returned by the call to PerlEzCreate
-
lpString a pointer to the ASCIIZ string to evaluate
-
lpBuffer a pointer to the buffer where the result will be placed
-
dwBufSize the size in bytes of the space where lpBuffer points
- RETURNS:
-
-
A zero if no error; otherwise error code.
int PerlEzCall1(PERLEZHANDLE hHandle, LPCSTR lpFunction, LPSTR lpBuffer, DWORD dwBufSize, LPCSTR lpFormat, LPVOID lpVoid);
- DESCRIPTION:
-
-
Calls the function lpFunction and returns the result in the buffer lpBuffer.
- PARAMS:
-
-
hHandle a handle returned by the call to PerlEzCreate
-
lpFunction a pointer name of the function to call
-
lpBuffer a pointer to the buffer where the result will be placed
-
dwBufSize the size in bytes of the space where lpBuffer points
-
lpFormat a pointer to the parameter specifier; can be NULL. See Format String
-
lpVoid a pointer to a parameter will be interpreted based on lpFormat
- RETURNS:
-
-
A zero if no error; otherwise error code.
int PerlEzCall2(PERLEZHANDLE hHandle, LPCSTR lpFunction, LPSTR lpBuffer, DWORD dwBufSize,
LPCSTR lpFormat, LPVOID lpVoid1, LPVOID lpVoid2);
- DESCRIPTION:
-
-
Calls the function lpFunction and returns the result in the buffer lpBuffer.
- PARAMS:
-
-
hHandle a handle returned by the call to PerlEzCreate
-
lpFunction a pointer name of the function to call
-
lpBuffer a pointer to the buffer where the result will be placed
-
dwBufSize the size in bytes of the space where lpBuffer points
-
lpFormat a pointer to the parameter specifier; can be NULL. See Format String
-
lpVoid1...2 pointers to parameters that will be interpreted based on lpFormat
- RETURNS:
-
-
A zero if no error; otherwise error code.
int PerlEzCall4(PERLEZHANDLE hHandle, LPCSTR lpFunction, LPSTR lpBuffer, DWORD dwBufSize,
LPCSTR lpFormat, LPVOID lpVoid1, LPVOID lpVoid2, LPVOID lpVoid3, LPVOID lpVoid4);
- DESCRIPTION:
-
-
Calls the function lpFunction and returns the result in the buffer lpBuffer.
- PARAMS:
-
-
hHandle a handle returned by the call to PerlEzCreate
-
lpFunction a pointer name of the function to call
-
lpBuffer a pointer to the buffer where the result will be placed
-
dwBufSize the size in bytes of the space where lpBuffer points
-
lpFormat a pointer to the parameter specifier; can be NULL. See Format String
-
lpVoid1...4 pointers to parameters that will be interpreted based on lpFormat
- RETURNS:
-
-
A zero if no error; otherwise error code.
int PerlEzCall8(PERLEZHANDLE hHandle, LPCSTR lpFunction, LPSTR lpBuffer, DWORD dwBufSize,
LPCSTR lpFormat, LPVOID lpVoid1, LPVOID lpVoid2, LPVOID lpVoid3, LPVOID lpVoid4, LPVOID lpVoid5,
LPVOID lpVoid6, LPVOID lpVoid7, LPVOID lpVoid8);
- DESCRIPTION:
-
-
Calls the function lpFunction and returns the result in the buffer lpBuffer.
- PARAMS:
-
-
hHandle a handle returned by the call to PerlEzCreate
-
lpFunction a pointer name of the function to call
-
lpBuffer a pointer to the buffer where the result will be placed
-
dwBufSize the size in bytes of the space where lpBuffer points
-
lpFormat a pointer to the parameter specifier; can be NULL. See Format String
-
lpVoid1...8 pointers to parameters that will be interpreted based on lpFormat
- RETURNS:
-
-
A zero if no error; otherwise error code.
int PerlEzCall(PERLEZHANDLE hHandle, LPCSTR lpFunction, LPSTR lpBuffer, DWORD dwBufSize,
LPCSTR lpFormat, ...);
- DESCRIPTION:
-
-
Calls the function lpFunction and returns the result in the buffer lpBuffer.
- PARAMS:
-
-
hHandle a handle returned by the call to PerlEzCreate
-
lpFunction a pointer name of the function to call
-
lpBuffer a pointer to the buffer where the result will be placed
-
dwBufSize the size in bytes of the space where lpBuffer points
-
lpFormat a pointer to the parameter specifier; can be NULL. See Format String
-
... parameters to be interpreted based on lpFormat
- RETURNS:
-
-
A zero if no error; otherwise error code.
int PerlEzCallContext(PERLEZHANDLE hHandle, LPCSTR lpFunction, LPVOID lpContextInfo,
LPSTR lpBuffer, DWORD dwBufSize, LPCSTR lpFormat, ...);
- DESCRIPTION:
-
-
Calls the function lpFunction and returns the result in the buffer lpBuffer.
- PARAMS:
-
-
hHandle a handle returned by the call to PerlEzCreate
-
lpFunction a pointer name of the function to call
-
lpContextInfo context info for magic fetch and store functions
-
lpBuffer a pointer to the buffer where the result will be placed
-
dwBufSize the size in bytes of the space where lpBuffer points
-
lpFormat a pointer to the parameter specifier; can be NULL. See Format String
-
... parameters to be interpreted based on lpFormat
- RETURNS:
-
-
A zero if no error; otherwise error code.
int PerlEzSetMagicScalarFunctions(PERLEZHANDLE hHandle, LPFETCHVALUEFUNCTION lpfFetch,
LPSTOREVALUEFUNCTION lpfStore);
- DESCRIPTION:
-
-
Sets the call back function pointers for magic scalar variables.
- PARAMS:
-
-
hHandle a handle returned by the call to PerlEzCreate
-
lpfFetch a pointer to the call back function for fetching a string.
if lpfFetch is NULL, then the scalar is write only.
-
lpfStore a pointer to the call back function for storinging a string.
if lpfStore is NULL, then the scalar is read only.
- RETURNS:
-
-
A zero if no error; otherwise error code.
NOTE: if lpfFetch and lpfStore are both NULL, then it is an error.
See also PerlEzSetMagicScalarName
int PerlEzSetMagicScalarName(PERLEZHANDLE hHandle, LPCSTR pVariableName);
- DESCRIPTION:
-
-
Creates the variable if it does not exists and sets it to be tied to
the call back function pointer for magic variables.
- PARAMS:
-
-
hHandle a handle returned by the call to PerlEzCreate.
-
pVariableName a pointer to the name of the variable.
- RETURNS:
-
-
A zero if no error; otherwise error code.
See also PerlEzSetMagicScalarFunctions
The format string is a series of characters that represents the type of parameters being supplied.
- s
-
-
this parameter is a pointer to a null terminated string.
- i
-
-
this parameter is to be considered an integer.
- d
-
-
this parameter is to be considered a double.
- l[s | i | d]x
-
-
the next 'x' parameters will be put into an anonymous list of the type specifed. Either 's', 'i', or 'd'
This document is maintained by Douglas Lankshear <dougl@ActiveState.com>