User-defined functions (UDFs)
The Execute UDF action executes a user-defined function called "DXCallback01" in a Windows Dynamic Link Library (DLL). This allows extension of the capabilities of Data Splitter with custom programming. The DLL name is defined in the Options menu, Extension DLL option.
The remainder of this discussion assumes familiarity with the C programming language.
The following data are passed to the function :
Data | Description |
---|---|
UserIndex1 | numeric index from user's action definition (-1 = n/a) |
UserIndex2 | text string from user's action definition |
UserIndex3 | text string from user's action definition |
NodeNumber | the node number (-1 = n/a) |
NodeTag | the node tag (const char *, NULL = n/a) |
DataPos | start position of node's recognized pattern in the input stream |
DataLen | length of node's recognized pattern (in bytes) |
InBuf | interface pointer to input buffer (defined in header file "ixxinbuf.h") |
IDXnn | interface pointer to Data Splitter internal data (defined in header file "idx.h") |
See header files "idx.h" and "dsx.h" accompanying the Data Splitter Development Tools.
Node data (NodeNumber, NodeTag, DataPos, DataLen) are not applicable for actions not associated with nodes (pre/post-run, pre/post-stream).
File "dsx.h" contains the C function prototype :
#define UserProcName01 "_DXCallback01" typedef int ( * UDF01 ) // User-Defined Function type 1 ( int UserIndex1 , const char * UserIndex2 , const char * UserIndex3 , int NodeNumber // Start of node data ... , const char * NodeTag , long DataPos , long DataLen // ... end of node data , IXXINBUF * // Interface to input buffer , IDX01 * // IDX data interface, see file "idx.h" );
The required header files (dsx.h, idx.h, ixxinbuf.h and xxdefs.h) are available, along with sample code and further information, at Data Splitter Development Tools.