OFC build functions define a method for creating OFC document instances. They utilize the data structures previously described. The user's of these functions will be responsible for allocating and freeing all memory associated with the use of these functions. Their purpose is to guarantee the correct syntax of the resulting OFC document instance as opposed to creating the data structures and linked list of transactions.
There are three build function prototypes:
int RcCreateOFCRequest( OFCDOC * pofcdoc, void ** ppvRequest, int * pcbRequest);
The first parameter must point to an OFCDOC structure containing the batch of transaction structures which are to be contained in the document instance being created. The first transaction structure must be a signon request (SONRQ) transaction structure. All maintenance transactions must follow the signon request. All financial transactions must be at the end of the linked list of transactions. If the signon transaction is missing, or the remaining transactions contained in the linked list are not in the required order, the function will fail.
The second parameter must be a valid pointer to a void pointer. If the function succeeds, this will contain a pointer to the block of memory allocated by the function. The memory will contain the resulting OFC document instance represented by the OFCDOC structure.
The third parameter must be a pointer to an integer value. If the function succeeds, this will contain the size of the memory allocated by the function.
The function will return one of the following:
Value | Meaning |
ALL_OK | Successful |
OFC_ERROR | Illegal OFC File |
NO_MEMORY | A memory allocation failed |
INVALID_CALL | An internal error, this should not occur after the Beta release. |
int RcCreateOFCResponse( OFCDOC * pofcdoc, void ** ppvResponse, int * pcbResponse);
The first parameter must point to an OFCDOC structure containing the batch of transaction structures which are to be contained in the document instance being created. The first transaction structure must be a signon response (SONRS) transaction structure. All maintenance transactions must follow the signon response. All financial transactions must be at the end of the linked list of transactions. If the signon transaction is missing, or the remaining transactions contained in the linked list are not in the required order, the function will fail.
The second parameter must be a valid pointer to a void pointer. If the function succeeds, this will contain a pointer to the block of memory allocated by the function. The memory will contain the resulting OFC document instance represented by the OFCDOC structure.
The third parameter must be a pointer to an integer value. If the function succeeds, this will contain the size of the memory allocated by the function.
The function will return one of the following:
Value | Meaning |
ALL_OK | Successful |
OFC_ERROR | Illegal OFC File |
NO_MEMORY | A memory allocation failed |
INVALID_CALL | An internal error, this should not occur after the Beta release. |
int RcCreateOFCStatement( OFCDOC * pofcdoc, void ** ppvStatement, int * pcbStatement);
The first parameter must point to an OFCDOC structure containing the statement download transaction structures which are to be contained in the document instance being built. If the transactions contained in the linked list contain anything other than ACCTSTMT transactions, the function will fail.
The second parameter must be a valid pointer to a void pointer. If the function succeeds, this will contain a pointer to the block of memory allocated by the function. The memory will contain the resulting OFC document instance represented by the OFCDOC structure.
The third parameter must be a pointer to an integer value. If the function succeeds, this will contain the size of the memory allocated by the function.
The function will return one of the following:
Value | Meaning |
ALL_OK | Successful |
OFC_ERROR | Illegal OFC File |
NO_MEMORY | A memory allocation failed |
INVALID_CALL | An internal error, this should not occur after the Beta release. |
void CleanupOFCFile( void ** ppvOFCFile);
The first parameter is a pointer to the OFC file in memory. This must point to the memory created as a result of calling one of the previous OFC build functions. This function will free the memory used by the OFC data.