User-defined functions (UDFs)

The Execute UDF action executes a user-defined function called "DTCallback01" in a Windows Dynamic Link Library (DLL).   This allows extension of the capabilities of DTBuild 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")
IDT  interface pointer to DTBuild internal data (defined in header file "idt.h") 

See header files "idt.h" and "dtx.h" accompanying the DTBuild Development Tools.

Node data (NodeNumber, NodeTag, DataPos, DataLen) are not applicable for actions not associated with nodes (pre/post-run, pre/post-stream).

File "dtx.h" contains the C function prototype :

#define UserProcName01 "_DTCallback01"
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
, IDT01 * // IDT data interface, see file "idt.h"
);

The required header files (dtx.h, idt.h, ixxinbuf.h and xxdefs.h) are available, along with sample code and further information, at DTBuild Development Tools.