Hello out there,
I have a description here of a function I need to create a PERL
extension for:
int PersHierDelDir (PT_HIER_STAT_CB callBackfunc, void * callBackData,
PT_HIER_REQ requestStruct, PT_IPC_REQUEST *requestHandle);
INPUT: callBackFunc is a pointer to a function in the client
application that will be called when results are returned from the DEX HIER
API. The callback function is responsible for processing the results.
callBackData is a pointer to data that the client
application wishes to pass to the callback function when it is invoked.
requestStruct is the request the client application
is submitting to the DEX HIER API. The request structure is built by means
of the helper functions described above.
requestHandle is a handle that identifies the
request and is used by the IPCManager to match up results with requests.
RETURNS: Success/fail.
DESCRIPTION: This function submits a request to delete the
given path directory. Note that the directory must be empty for the delete
request to succeed. The callback function in the argument list will be
called by the DEX HIER API when results are returned from the DEX.
I guess I have a few questions. First of all - what typemap/data type
combination do I use for a pointer to a function, such as
callBackfunc listed above and for Structures? Secondly, the CODE section of
the XSUB still seems a bit fuzzy to me from the explanations given on
www.perl.com in the XSUB tutorial (which is REALLY basic). I'm not sure
what exactly this section is supposed to
accomplish? Is it to create a wrapper for the "C" function, or represent
the "C" function in PERL. Here is what I have so far in my
*.xs file:
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
# include files necessary for API
#include <stdlib.h>
#include <string.h>
#include <PtStatus.h>
#include <IpcMgr.h>
#include <PHApi.h>
#include <PtGlobal.h>
#ifdef WIN32
extern "C" __declspec(dllexport) XS(boot_PerDex) ;
#else
extern XS(boot_PerDex) ;
#endif
MODULE = PerDex PACKAGE = PerDex
int PersHierDelDir(cbFunc, cbData, reqInfo, reqHandle)
dtype cbFunc # just using dtype for now till I find out
what to use.
void * cbData
dtype reqInfo
dytpe reqHandle
CODE:
int iRC = 0;
iRC = PersHierDelDir(cbFunc, cbData, reqInfo, reqHandle);
RETVAL = iRC;
OUTPUT:
RETVAL
Any help would be GREATLY appreciated, and thanks in advance...
P.S. Also - if I'm WAY off base here, please let me know - thanks again.
Sean Markley
Software Engineer, ManageIT/Performance Level 2
Computer Associates International, Inc.
Email: [EMAIL PROTECTED]