39 #define LIBOFX_MAJOR_VERSION 0
40 #define LIBOFX_MINOR_VERSION 9
41 #define LIBOFX_MICRO_VERSION 11
42 #define LIBOFX_BUILD_VERSION 0
43 #define LIBOFX_VERSION_RELEASE_STRING "0.9.11"
47 # ifdef HAVE_GCC_VISIBILITY_EXTS
48 # pragma GCC visibility push(default)
59 #define OFX_ELEMENT_NAME_LENGTH 100
60 #define OFX_SVRTID2_LENGTH (36 + 1)
61 #define OFX_CHECK_NUMBER_LENGTH (12 + 1)
62 #define OFX_REFERENCE_NUMBER_LENGTH (32 + 1)
63 #define OFX_FITID_LENGTH (255 + 1)
64 #define OFX_TOKEN2_LENGTH (36 + 1)
65 #define OFX_MEMO_LENGTH (255 + 1)
66 #define OFX_FIID_LENGTH (32 + 1)
67 #define OFX_MEMO2_LENGTH (390 + 1)
68 #define OFX_BALANCE_NAME_LENGTH (32 + 1)
69 #define OFX_BALANCE_DESCRIPTION_LENGTH (80 + 1)
70 #define OFX_CURRENCY_LENGTH (3 + 1)
71 #define OFX_BANKID_LENGTH (9 + 1)
72 #define OFX_BRANCHID_LENGTH (22 + 1)
73 #define OFX_ACCTID_LENGTH (22 + 1)
74 #define OFX_ACCTKEY_LENGTH (22 + 1)
75 #define OFX_BROKERID_LENGTH (22 + 1)
77 #define OFX_ACCOUNT_ID_LENGTH (OFX_BANKID_LENGTH + OFX_BRANCHID_LENGTH + OFX_ACCTID_LENGTH + 1)
78 #define OFX_ACCOUNT_NAME_LENGTH 255
79 #define OFX_MARKETING_INFO_LENGTH (360 + 1)
80 #define OFX_TRANSACTION_NAME_LENGTH (96 + 1)
81 #define OFX_UNIQUE_ID_LENGTH (32 + 1)
82 #define OFX_UNIQUE_ID_TYPE_LENGTH (10 + 1)
83 #define OFX_SECNAME_LENGTH (32 + 1)
84 #define OFX_TICKER_LENGTH (32 + 1)
85 #define OFX_ORG_LENGTH (32 + 1)
86 #define OFX_FID_LENGTH (32 + 1)
87 #define OFX_USERID_LENGTH (32 + 1)
88 #define OFX_USERPASS_LENGTH (32 + 1)
89 #define OFX_URL_LENGTH (500 + 1)
90 #define OFX_APPID_LENGTH (32)
91 #define OFX_APPVER_LENGTH (32)
92 #define OFX_HEADERVERSION_LENGTH (32)
93 #define OFX_CLIENTUID_LENGTH (36 + 1)
103 typedef void * LibofxContextPtr;
119 void libofx_set_dtd_dir(LibofxContextPtr libofx_context,
141 #ifndef OFX_AQUAMANIAC_UGLY_HACK1
145 {
AUTODETECT,
"AUTODETECT",
"AUTODETECT (File format will be automatically detected later)"},
146 {
OFX,
"OFX",
"OFX (Open Financial eXchange (OFX or QFX))"},
147 {
OFC,
"OFC",
"OFC (Microsoft Open Financial Connectivity)"},
148 {
QIF,
"QIF",
"QIF (Intuit Quicken Interchange Format) NOT IMPLEMENTED"},
149 {
LAST,
"LAST",
"Not a file format, meant as a loop breaking condition"}
154 {
QIF,
"QIF",
"QIF (Intuit Quicken Interchange Format) NOT IMPLEMENTED"},
155 {
LAST,
"LAST",
"Not a file format, meant as a loop breaking condition"}
193 const char * p_filename,
215 char ofx_element_name[OFX_ELEMENT_NAME_LENGTH];
244 int server_message_valid;
293 int account_id_valid;
307 int account_type_valid;
315 int account_number_valid;
318 char bank_id[OFX_BANKID_LENGTH];
321 char broker_id[OFX_BROKERID_LENGTH];
324 char branch_id[OFX_BRANCHID_LENGTH];
366 int unique_id_type_valid;
368 char secname[OFX_SECNAME_LENGTH];
376 char ticker[OFX_TICKER_LENGTH];
384 int date_unitprice_valid;
391 char memo[OFX_MEMO2_LENGTH];
396 char fiid[OFX_FIID_LENGTH];
488 int account_id_valid;
497 int invtransactiontype_valid;
535 int unique_id_type_valid;
545 int date_posted_valid;
553 int date_initiated_valid;
558 int date_funds_available_valid;
564 int fi_id_corrected_valid;
569 int fi_id_correction_action_valid;
574 int server_transaction_id_valid;
580 int check_number_valid;
585 int reference_number_valid;
589 int standard_industrial_code_valid;
594 char name[OFX_TRANSACTION_NAME_LENGTH];
598 char memo[OFX_MEMO2_LENGTH];
602 int commission_valid;
654 int account_id_valid;
659 int ledger_balance_valid;
662 int ledger_balance_date_valid;
672 int available_balance_valid;
674 time_t available_balance_date;
682 int date_start_valid;
694 int marketing_info_valid;
772 const char *s,
unsigned int size);
788 char fid[OFX_FID_LENGTH];
789 char org[OFX_ORG_LENGTH];
790 char url[OFX_URL_LENGTH];
808 char fid[OFX_FID_LENGTH];
809 char org[OFX_ORG_LENGTH];
810 char userid[OFX_USERID_LENGTH];
811 char userpass[OFX_USERPASS_LENGTH];
812 char header_version[OFX_HEADERVERSION_LENGTH];
813 char appid[OFX_APPID_LENGTH];
814 char appver[OFX_APPVER_LENGTH];
815 char clientuid[OFX_CLIENTUID_LENGTH];
818 #define OFX_AMOUNT_LENGTH (32 + 1)
819 #define OFX_PAYACCT_LENGTH (32 + 1)
820 #define OFX_STATE_LENGTH (5 + 1)
821 #define OFX_POSTALCODE_LENGTH (11 + 1)
822 #define OFX_NAME_LENGTH (32 + 1)
826 char amount[OFX_AMOUNT_LENGTH];
827 char account[OFX_PAYACCT_LENGTH];
829 char memo[OFX_MEMO_LENGTH];
834 char name[OFX_NAME_LENGTH];
835 char address1[OFX_NAME_LENGTH];
836 char city[OFX_NAME_LENGTH];
837 char state[OFX_STATE_LENGTH];
838 char postalcode[OFX_POSTALCODE_LENGTH];
839 char phone[OFX_NAME_LENGTH];
869 char* libofx_request_payment_status(
const struct OfxFiLogin* login,
const char* transactionid );
890 #if defined(HAVE_GCC_VISIBILITY_EXTS) && defined(IN_LIBOFX)
891 # pragma GCC visibility pop
894 #endif // end of LIBOFX_H
time_t ledger_balance_date
An abstraction of an account.
int libofx_proc_file(LibofxContextPtr libofx_context, const char *p_filename, enum LibofxFileFormat ftype)
libofx_proc_file is the entry point of the library.
LibofxContextPtr libofx_get_new_context()
Initialise the library and return a new context.
char reference_number[OFX_REFERENCE_NUMBER_LENGTH]
void ofx_set_security_cb(LibofxContextPtr ctx, LibofxProcSecurityCallback cb, void *user_data)
void ofx_set_transaction_cb(LibofxContextPtr ctx, LibofxProcTransactionCallback cb, void *user_data)
int(* LibofxProcAccountCallback)(const struct OfxAccountData data, void *account_data)
The callback function for the OfxAccountData stucture.
char unique_id[OFX_UNIQUE_ID_LENGTH]
char account_id[OFX_ACCOUNT_ID_LENGTH]
char fi_id_corrected[256]
char currency[OFX_CURRENCY_LENGTH]
char check_number[OFX_CHECK_NUMBER_LENGTH]
int libofx_proc_buffer(LibofxContextPtr ctx, const char *s, unsigned int size)
int(* LibofxProcTransactionCallback)(const struct OfxTransactionData data, void *transaction_data)
The callback function for the OfxTransactionData stucture.
int transactiontype_valid
char name[OFX_TRANSACTION_NAME_LENGTH]
char marketing_info[OFX_MARKETING_INFO_LENGTH]
char memo[OFX_MEMO2_LENGTH]
FiIdCorrectionAction fi_id_correction_action
char currency[OFX_CURRENCY_LENGTH]
void ofx_set_account_cb(LibofxContextPtr ctx, LibofxProcAccountCallback cb, void *user_data)
long int standard_industrial_code
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.
char account_id[OFX_ACCOUNT_ID_LENGTH]
char memo[OFX_MEMO2_LENGTH]
char fiid[OFX_FIID_LENGTH]
void ofx_set_statement_cb(LibofxContextPtr ctx, LibofxProcStatementCallback cb, void *user_data)
char currency[OFX_CURRENCY_LENGTH]
char * libofx_request_statement(const struct OfxFiLogin *fi, const struct OfxAccountData *account, time_t date_from)
Creates an OFX statement request in string form.
char account_id[OFX_ACCOUNT_ID_LENGTH]
char unique_id[OFX_UNIQUE_ID_LENGTH]
char account_name[OFX_ACCOUNT_NAME_LENGTH]
struct OfxAccountData * account_ptr
char server_transaction_id[OFX_SVRTID2_LENGTH]
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.
struct OfxAccountData * account_ptr
char bank_id[OFX_BANKID_LENGTH]
int(* LibofxProcStatementCallback)(const struct OfxStatementData data, void *statement_data)
The callback function for the OfxStatementData stucture.
An abstraction of an OFX STATUS element.
char unique_id_type[OFX_UNIQUE_ID_TYPE_LENGTH]
void ofx_set_status_cb(LibofxContextPtr ctx, LibofxProcStatusCallback cb, void *user_data)
int libofx_free_context(LibofxContextPtr)
Free all ressources used by this context.
char * libofx_request_accountinfo(const struct OfxFiLogin *login)
Creates an OFX account info (list) request in string form.
int available_balance_date_valid
char ticker[OFX_TICKER_LENGTH]
Information returned by the OFX Partner Server about a financial institution.
char payee_id[OFX_SVRTID2_LENGTH]
An abstraction of a security, such as a stock, mutual fund, etc.
int ofx_element_name_valid
int(* LibofxProcStatusCallback)(const struct OfxStatusData data, void *status_data)
The callback function for the OfxStatusData stucture.
An abstraction of a transaction in an account.
time_t date_funds_available
char account_number[OFX_ACCTID_LENGTH]
int(* LibofxProcSecurityCallback)(const struct OfxSecurityData data, void *security_data)
The callback function for the OfxSecurityData stucture.
char unique_id_type[OFX_UNIQUE_ID_TYPE_LENGTH]
char currency[OFX_CURRENCY_LENGTH]
An abstraction of an account statement.
char secname[OFX_SECNAME_LENGTH]
Information sufficient to log into an financial institution.