PerlEz - PerlEz host DLL
This document attempts to describe the functions of the PerlEz host Dynamically 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, LPCSTR lpOptions);
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.
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.
A non zero handle to a Perl interpreter if successful; zero otherwise. Call PerlEzDelete to release this handle.
See also PerlEzDelete PerlEzCreateOpt
PERLEZHANDLE PerlEzCreateOpt(LPCSTR lpFileName, LPCSTR lpOptions, LPCSTR lpScriptOpts);
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.
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.
lpScriptOpts a pointer to a ASCIIZ string that are the command line options that will be provided as parameters to the script; can be NULL.
A non zero handle to a Perl interpreter if successful; zero otherwise. Call PerlEzDelete to release this handle.
See also PerlEzDelete PerlEzCreate
BOOL PerlEzDelete(PERLEZHANDLE hHandle);
Deletes a previously created Perl interpreter. Releases all resources allocated by PerlEzCreate or PerlEzCreateOpt.
hHandle a handle returned by the call to PerlEzCreate or PerlEzCreateOpt
True if no error false otherwise.
int PerlEzEvalString(PERLEZHANDLE hHandle, LPCSTR lpString, LPSTR lpBuffer, DWORD dwBufSize);
Evaluates the string a returns the result in lpBuffer. If there is an error $! is returned in lpBuffer.
hHandle a handle returned by the call to PerlEzCreate or PerlEzCreateOpt
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
A zero if no error; otherwise error code. See Error Codes
int PerlEzCall1(PERLEZHANDLE hHandle, LPCSTR lpFunction, LPSTR lpBuffer, DWORD dwBufSize, LPCSTR lpFormat, LPVOID lpVoid);
Calls the function lpFunction and returns the result in the buffer lpBuffer.
hHandle a handle returned by the call to PerlEzCreate or PerlEzCreateOpt
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
A zero if no error; otherwise error code. See Error Codes
int PerlEzCall2(PERLEZHANDLE hHandle, LPCSTR lpFunction, LPSTR lpBuffer, DWORD dwBufSize, LPCSTR lpFormat, LPVOID lpVoid1, LPVOID lpVoid2);
Calls the function lpFunction and returns the result in the buffer lpBuffer.
hHandle a handle returned by the call to PerlEzCreate or PerlEzCreateOpt
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
A zero if no error; otherwise error code. See Error Codes
int PerlEzCall4(PERLEZHANDLE hHandle, LPCSTR lpFunction, LPSTR lpBuffer, DWORD dwBufSize, LPCSTR lpFormat, LPVOID lpVoid1, LPVOID lpVoid2, LPVOID lpVoid3, LPVOID lpVoid4);
Calls the function lpFunction and returns the result in the buffer lpBuffer.
hHandle a handle returned by the call to PerlEzCreate or PerlEzCreateOpt
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
A zero if no error; otherwise error code. See Error Codes
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);
Calls the function lpFunction and returns the result in the buffer lpBuffer.
hHandle a handle returned by the call to PerlEzCreate or PerlEzCreateOpt
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
A zero if no error; otherwise error code. See Error Codes
int PerlEzCall(PERLEZHANDLE hHandle, LPCSTR lpFunction, LPSTR lpBuffer, DWORD dwBufSize, LPCSTR lpFormat, ...);
Calls the function lpFunction and returns the result in the buffer lpBuffer.
hHandle a handle returned by the call to PerlEzCreate or PerlEzCreateOpt
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
A zero if no error; otherwise error code. See Error Codes
int PerlEzCallContext(PERLEZHANDLE hHandle, LPCSTR lpFunction, LPVOID lpContextInfo, LPSTR lpBuffer, DWORD dwBufSize, LPCSTR lpFormat, ...);
Calls the function lpFunction and returns the result in the buffer lpBuffer.
hHandle a handle returned by the call to PerlEzCreate or PerlEzCreateOpt
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
A zero if no error; otherwise error code. See Error Codes
int PerlEzSetMagicScalarFunctions(PERLEZHANDLE hHandle, LPFETCHVALUEFUNCTION lpfFetch, LPSTOREVALUEFUNCTION lpfStore);
Sets the call back function pointers for magic scalar variables.
hHandle a handle returned by the call to PerlEzCreate or PerlEzCreateOpt
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.
A zero if no error; otherwise error code. See Error Codes NOTE: if lpfFetch and lpfStore are both NULL, then it is an error.
See also PerlEzSetMagicScalarName
int PerlEzSetMagicScalarName(PERLEZHANDLE hHandle, LPCSTR pVariableName);
Creates the variable if it does not exists and sets it to be tied to the call back function pointer for magic variables.
hHandle a handle returned by the call to PerlEzCreate or PerlEzCreateOpt
pVariableName a pointer to the name of the variable.
A zero if no error; otherwise error code. See Error Codes
See also PerlEzSetMagicScalarFunctions
The format string is a series of characters that represents the type of parameters being supplied.
this parameter is a pointer to a null terminated string.
this parameter is to be considered an integer.
this parameter is to be considered a double.
the next 'x' parameters will be put into an anonymous list of the type specifed. Either 's', 'i', or 'd'
More space is needed to return a result
Error string returned in the buffer
More space needed to return the error message
Format string is invalid
Function call caused an exception
Handle is invalid
The second call to PerlEzSetMagicFunction failed
Invalid parameter was passed to the routine
Cannot allocate more memory
Copyright (c) 1998-2003 ActiveState Corp. All rights reserved.