LibOFX
|
Main header file containing the LibOfx API. More...
Go to the source code of this file.
Data Structures | |
struct | LibofxFileFormatInfo |
struct | OfxStatusData |
An abstraction of an OFX STATUS element. More... | |
struct | OfxAccountData |
An abstraction of an account. More... | |
struct | OfxSecurityData |
An abstraction of a security, such as a stock, mutual fund, etc. More... | |
struct | OfxTransactionData |
An abstraction of a transaction in an account. More... | |
struct | OfxStatementData |
An abstraction of an account statement. More... | |
struct | OfxCurrency |
NOT YET SUPPORTED. More... | |
struct | OfxPositionData |
An abstraction of a security position held in an account. More... | |
struct | OfxFiServiceInfo |
Information returned by the OFX Partner Server about a financial institution. More... | |
struct | OfxFiLogin |
Information sufficient to log into an financial institution. More... | |
struct | OfxPayment |
struct | OfxPayee |
Typedefs | |
typedef void * | LibofxContextPtr |
typedef int(* | LibofxProcStatusCallback) (const struct OfxStatusData data, void *status_data) |
The callback function for the OfxStatusData structure. More... | |
typedef int(* | LibofxProcAccountCallback) (const struct OfxAccountData data, void *account_data) |
The callback function for the OfxAccountData structure. More... | |
typedef int(* | LibofxProcSecurityCallback) (const struct OfxSecurityData data, void *security_data) |
The callback function for the OfxSecurityData structure. More... | |
typedef int(* | LibofxProcTransactionCallback) (const struct OfxTransactionData data, void *transaction_data) |
The callback function for the OfxTransactionData structure. More... | |
typedef int(* | LibofxProcStatementCallback) (const struct OfxStatementData data, void *statement_data) |
The callback function for the OfxStatementData structure. More... | |
typedef int(* | LibofxProcPositionCallback) (const struct OfxPositionData data, void *position_data) |
The callback function for the OfxPositionData structure. More... | |
Functions | |
LibofxContextPtr | libofx_get_new_context () |
Initialise the library and return a new context. More... | |
int | libofx_free_context (LibofxContextPtr) |
Free all resources used by this context. More... | |
void | libofx_set_dtd_dir (LibofxContextPtr libofx_context, const char *s) |
enum LibofxFileFormat | libofx_get_file_format_from_str (const struct LibofxFileFormatInfo format_list[], const char *file_type_string) |
libofx_get_file_type returns a proper enum from a file type string. More... | |
const char * | libofx_get_file_format_description (const struct LibofxFileFormatInfo format_list[], enum LibofxFileFormat file_format) |
get_file_format_description returns a string description of a LibofxFileType. More... | |
int | libofx_proc_file (LibofxContextPtr libofx_context, const char *p_filename, enum LibofxFileFormat ftype) |
libofx_proc_file is the entry point of the library. More... | |
void | ofx_set_status_cb (LibofxContextPtr ctx, LibofxProcStatusCallback cb, void *user_data) |
void | ofx_set_account_cb (LibofxContextPtr ctx, LibofxProcAccountCallback cb, void *user_data) |
void | ofx_set_security_cb (LibofxContextPtr ctx, LibofxProcSecurityCallback cb, void *user_data) |
void | ofx_set_transaction_cb (LibofxContextPtr ctx, LibofxProcTransactionCallback cb, void *user_data) |
void | ofx_set_statement_cb (LibofxContextPtr ctx, LibofxProcStatementCallback cb, void *user_data) |
void | ofx_set_position_cb (LibofxContextPtr ctx, LibofxProcPositionCallback cb, void *user_data) |
Variables | |
const struct LibofxFileFormatInfo | LibofxImportFormatList [] |
const struct LibofxFileFormatInfo | LibofxExportFormatList [] |
Creating OFX Files | |
Parses the content of the given buffer. This group deals with creating OFX files | |
#define | OFX_AMOUNT_LENGTH (32 + 1) |
#define | OFX_PAYACCT_LENGTH (32 + 1) |
#define | OFX_STATE_LENGTH (5 + 1) |
#define | OFX_POSTALCODE_LENGTH (11 + 1) |
#define | OFX_NAME_LENGTH (32 + 1) |
LIBOFX_API int | ofx_PARSER_msg |
LIBOFX_API int | ofx_DEBUG_msg |
LIBOFX_API int | ofx_DEBUG1_msg |
LIBOFX_API int | ofx_DEBUG2_msg |
LIBOFX_API int | ofx_DEBUG3_msg |
LIBOFX_API int | ofx_DEBUG4_msg |
LIBOFX_API int | ofx_DEBUG5_msg |
LIBOFX_API int | ofx_STATUS_msg |
LIBOFX_API int | ofx_INFO_msg |
LIBOFX_API int | ofx_WARNING_msg |
LIBOFX_API int | ofx_ERROR_msg |
LIBOFX_API int | ofx_show_position |
char * | libofx_request_statement (const struct OfxFiLogin *fi, const struct OfxAccountData *account, time_t date_from) |
Creates an OFX statement request in string form. More... | |
char * | libofx_request_accountinfo (const struct OfxFiLogin *login) |
Creates an OFX account info (list) request in string form. More... | |
char * | libofx_request_payment (const struct OfxFiLogin *login, const struct OfxAccountData *account, const struct OfxPayee *payee, const struct OfxPayment *payment) |
char * | libofx_request_payment_status (const struct OfxFiLogin *login, const char *transactionid) |
Main header file containing the LibOfx API.
This file should be included for all applications who use this API. This header file will work with both C and C++ programs. The entire API is made of the following structures and functions.
All of the following ofx_proc_* functions are callbacks (Except ofx_proc_file which is the entry point). They must be implemented by your program, but can be left empty if not needed. They are called each time the associated structure is filled by the library.
Important note: The variables associated with every data element have a _valid companion. Always check that data_valid == true before using. Not only will you ensure that the data is meaningful, but also that pointers are valid and strings point to a null terminated string. Elements listed as mandatory are for information purpose only, do not trust the bank not to send you non-conforming data...
Definition in file libofx-0.10.8/inc/libofx.h.
typedef int(* LibofxProcAccountCallback) (const struct OfxAccountData data, void *account_data) |
The callback function for the OfxAccountData structure.
The ofx_proc_account_cb event is always generated first, to allow the application to create accounts or ask the user to match an existing account before the ofx_proc_statement and ofx_proc_transaction event are received. An OfxAccountData is passed to this event.
Note however that this OfxAccountData structure will also be available as part of OfxStatementData structure passed to ofx_proc_statement event, as well as a pointer to an arbitrary data structure.
Definition at line 360 of file libofx-0.10.8/inc/libofx.h.
typedef int(* LibofxProcPositionCallback) (const struct OfxPositionData data, void *position_data) |
The callback function for the OfxPositionData structure.
The ofx_proc_statement_cb event is sent after all ofx_proc_transaction events have been sent. An OfxStatementData is passed to this event, as well as a pointer to an arbitrary data structure.
Definition at line 1281 of file libofx-0.10.8/inc/libofx.h.
typedef int(* LibofxProcSecurityCallback) (const struct OfxSecurityData data, void *security_data) |
The callback function for the OfxSecurityData structure.
An ofx_proc_security_cb event is generated for any securities listed in the ofx file. It is generated after ofx_proc_statement but before ofx_proc_transaction. It is meant to be used to allow the client to create a new commodity or security (such as a new stock type). Please note however that this information is usually also available as part of each OfxtransactionData.
An OfxSecurityData structure is passed to this event, as well as a pointer to an arbitrary data structure.
Definition at line 631 of file libofx-0.10.8/inc/libofx.h.
typedef int(* LibofxProcStatementCallback) (const struct OfxStatementData data, void *statement_data) |
The callback function for the OfxStatementData structure.
The ofx_proc_statement_cb event is sent after all ofx_proc_transaction events have been sent. An OfxStatementData is passed to this event, as well as a pointer to an arbitrary data structure.
Definition at line 1153 of file libofx-0.10.8/inc/libofx.h.
typedef int(* LibofxProcStatusCallback) (const struct OfxStatusData data, void *status_data) |
The callback function for the OfxStatusData structure.
An ofx_proc_status_cb event is sent everytime the server has generated a OFX STATUS element. As such, it could be received at any time(but not during other events). An OfxStatusData structure is passed to this event, as well as a pointer to an arbitrary data structure.
Definition at line 274 of file libofx-0.10.8/inc/libofx.h.
typedef int(* LibofxProcTransactionCallback) (const struct OfxTransactionData data, void *transaction_data) |
The callback function for the OfxTransactionData structure.
An ofx_proc_transaction_cb event is generated for every transaction in the ofx response, after ofx_proc_statement (and possibly ofx_proc_security is generated. An OfxTransactionData structure is passed to this event, as well as a pointer to an arbitrary data structure.
Definition at line 1057 of file libofx-0.10.8/inc/libofx.h.
enum FiIdCorrectionAction |
Definition at line 679 of file libofx-0.10.8/inc/libofx.h.
enum InvTransactionType |
Definition at line 654 of file libofx-0.10.8/inc/libofx.h.
enum LibofxFileFormat |
List of possible file formats
Definition at line 137 of file libofx-0.10.8/inc/libofx.h.
enum TransactionType |
Definition at line 633 of file libofx-0.10.8/inc/libofx.h.
int libofx_free_context | ( | LibofxContextPtr | ) |
Free all resources used by this context.
Definition at line 170 of file context.cpp.
const char* libofx_get_file_format_description | ( | const struct LibofxFileFormatInfo | format_list[], |
enum LibofxFileFormat | file_format | ||
) |
get_file_format_description returns a string description of a LibofxFileType.
@format_list The file format list in which the format should be looked up, usually LibofxImportFormatList or LibofxExportFormatList
@file_format The file format which should match one of the formats in the list.
Definition at line 36 of file file_preproc.cpp.
Referenced by libofx_proc_file().
enum LibofxFileFormat libofx_get_file_format_from_str | ( | const struct LibofxFileFormatInfo | format_list[], |
const char * | file_type_string | ||
) |
libofx_get_file_type returns a proper enum from a file type string.
@format_list The file format list in which the format string should be found, usually LibofxImportFormatList or LibofxExportFormatList
@file_type_string The string which contain the file format matching one of the format_name of the list.
Definition at line 53 of file file_preproc.cpp.
LibofxContextPtr libofx_get_new_context | ( | ) |
Initialise the library and return a new context.
Definition at line 165 of file context.cpp.
int libofx_proc_file | ( | LibofxContextPtr | libofx_context, |
const char * | p_filename, | ||
enum LibofxFileFormat | ftype | ||
) |
libofx_proc_file is the entry point of the library.
libofx_proc_file must be called by the client, with 1 OFX file to be parsed in command line format.
Definition at line 66 of file file_preproc.cpp.
char* libofx_request_accountinfo | ( | const struct OfxFiLogin * | login | ) |
Creates an OFX account info (list) request in string form.
Creates a string which should be passed to an OFX server. This string is an OFX request suitable to retrieve a list of accounts from the fi
fi | Identifies the financial institution and the user logging in. |
char* libofx_request_statement | ( | const struct OfxFiLogin * | fi, |
const struct OfxAccountData * | account, | ||
time_t | date_from | ||
) |
Creates an OFX statement request in string form.
Creates a string which should be passed to an OFX server. This string is an OFX request suitable to retrieve a statement for the account
from the fi
fi | Identifies the financial institution and the user logging in. |
account | Idenfities the account for which a statement is desired |
void ofx_set_account_cb | ( | LibofxContextPtr | ctx, |
LibofxProcAccountCallback | cb, | ||
void * | user_data | ||
) |
Set the account callback in the given context.
ctx | context |
cb | callback function |
user_data | user data to be passed to the callback |
Definition at line 198 of file context.cpp.
void ofx_set_position_cb | ( | LibofxContextPtr | ctx, |
LibofxProcPositionCallback | cb, | ||
void * | user_data | ||
) |
Set the position callback in the given context.
ctx | context |
cb | callback function |
user_data | user data to be passed to the callback |
Definition at line 233 of file context.cpp.
void ofx_set_security_cb | ( | LibofxContextPtr | ctx, |
LibofxProcSecurityCallback | cb, | ||
void * | user_data | ||
) |
Set the security callback in the given context.
ctx | context |
cb | callback function |
user_data | user data to be passed to the callback |
Definition at line 207 of file context.cpp.
void ofx_set_statement_cb | ( | LibofxContextPtr | ctx, |
LibofxProcStatementCallback | cb, | ||
void * | user_data | ||
) |
Set the statement callback in the given context.
ctx | context |
cb | callback function |
user_data | user data to be passed to the callback |
Definition at line 225 of file context.cpp.
void ofx_set_status_cb | ( | LibofxContextPtr | ctx, |
LibofxProcStatusCallback | cb, | ||
void * | user_data | ||
) |
Set the status callback in the given context.
ctx | context |
cb | callback function |
user_data | user data to be passed to the callback |
Definition at line 190 of file context.cpp.
void ofx_set_transaction_cb | ( | LibofxContextPtr | ctx, |
LibofxProcTransactionCallback | cb, | ||
void * | user_data | ||
) |
Set the transaction callback in the given context.
ctx | context |
cb | callback function |
user_data | user data to be passed to the callback |
Definition at line 216 of file context.cpp.
const struct LibofxFileFormatInfo LibofxExportFormatList[] |
Definition at line 166 of file libofx-0.10.8/inc/libofx.h.
const struct LibofxFileFormatInfo LibofxImportFormatList[] |
Definition at line 157 of file libofx-0.10.8/inc/libofx.h.
LIBOFX_API int ofx_DEBUG1_msg |
If set to true, debug level 1 messages will be printed to the console
Definition at line 38 of file messages.cpp.
LIBOFX_API int ofx_DEBUG2_msg |
If set to true, debug level 2 messages will be printed to the console
Definition at line 39 of file messages.cpp.
LIBOFX_API int ofx_DEBUG3_msg |
If set to true, debug level 3 messages will be printed to the console
Definition at line 40 of file messages.cpp.
LIBOFX_API int ofx_DEBUG4_msg |
If set to true, debug level 4 messages will be printed to the console
Definition at line 41 of file messages.cpp.
LIBOFX_API int ofx_DEBUG5_msg |
If set to true, debug level 5 messages will be printed to the console
Definition at line 42 of file messages.cpp.
LIBOFX_API int ofx_DEBUG_msg |
If set to true, general debug messages will be printed to the console
Definition at line 37 of file messages.cpp.
Referenced by message_out().
LIBOFX_API int ofx_ERROR_msg |
If set to true, error messages will be printed to the console
Definition at line 46 of file messages.cpp.
LIBOFX_API int ofx_INFO_msg |
If set to true, information messages will be printed to the console
Definition at line 44 of file messages.cpp.
LIBOFX_API int ofx_PARSER_msg |
If set to true, parser events will be printed to the console
Definition at line 36 of file messages.cpp.
LIBOFX_API int ofx_show_position |
If set to true, the line number will be shown after any error
Definition at line 47 of file messages.cpp.
LIBOFX_API int ofx_STATUS_msg |
If set to true, status messages will be printed to the console
Definition at line 43 of file messages.cpp.
LIBOFX_API int ofx_WARNING_msg |
If set to true, warning messages will be printed to the console
Definition at line 45 of file messages.cpp.