Go to the documentation of this file.
39 #define LIBOFX_MAJOR_VERSION 0
40 #define LIBOFX_MINOR_VERSION 10
41 #define LIBOFX_MICRO_VERSION 8
42 #define LIBOFX_BUILD_VERSION 0
43 #define LIBOFX_VERSION_RELEASE_STRING "0.10.8"
48 # pragma GCC visibility push(default)
54 # define LIBOFX_API __declspec(dllexport)
56 # define LIBOFX_API __declspec(dllimport)
70 #define OFX_ELEMENT_NAME_LENGTH 100
71 #define OFX_SVRTID2_LENGTH (36 + 1)
72 #define OFX_CHECK_NUMBER_LENGTH (12 + 1)
73 #define OFX_REFERENCE_NUMBER_LENGTH (32 + 1)
74 #define OFX_FITID_LENGTH (255 + 1)
75 #define OFX_TOKEN2_LENGTH (36 + 1)
76 #define OFX_MEMO_LENGTH (255 + 1)
77 #define OFX_FIID_LENGTH (32 + 1)
78 #define OFX_MEMO2_LENGTH (390 + 1)
79 #define OFX_BALANCE_NAME_LENGTH (32 + 1)
80 #define OFX_BALANCE_DESCRIPTION_LENGTH (80 + 1)
81 #define OFX_CURRENCY_LENGTH (3 + 1)
82 #define OFX_BANKID_LENGTH (9 + 1)
83 #define OFX_BRANCHID_LENGTH (22 + 1)
84 #define OFX_ACCTID_LENGTH (22 + 1)
85 #define OFX_ACCTKEY_LENGTH (22 + 1)
86 #define OFX_BROKERID_LENGTH (22 + 1)
88 #define OFX_ACCOUNT_ID_LENGTH (OFX_BANKID_LENGTH + OFX_BRANCHID_LENGTH + OFX_ACCTID_LENGTH + 1)
89 #define OFX_ACCOUNT_NAME_LENGTH 255
90 #define OFX_MARKETING_INFO_LENGTH (360 + 1)
91 #define OFX_TRANSACTION_NAME_LENGTH (96 + 1)
92 #define OFX_UNIQUE_ID_LENGTH (32 + 1)
93 #define OFX_UNIQUE_ID_TYPE_LENGTH (10 + 1)
94 #define OFX_SECNAME_LENGTH (120 + 1)
95 #define OFX_TICKER_LENGTH (32 + 1)
96 #define OFX_ORG_LENGTH (32 + 1)
97 #define OFX_FID_LENGTH (32 + 1)
98 #define OFX_USERID_LENGTH (32 + 1)
99 #define OFX_USERPASS_LENGTH (32 + 1)
100 #define OFX_URL_LENGTH (500 + 1)
101 #define OFX_APPID_LENGTH (32)
102 #define OFX_APPVER_LENGTH (32)
103 #define OFX_HEADERVERSION_LENGTH (32)
104 #define OFX_CLIENTUID_LENGTH (36 + 1)
105 #define OFX_SECURITY_RATING_LENGTH (32 + 1)
106 #define OFX_FIASSET_CLASS_LENGTH (32 + 1)
107 #define OFX_LOANID_LENGTH (32 + 1)
117 typedef void * LibofxContextPtr;
133 void libofx_set_dtd_dir(LibofxContextPtr libofx_context,
155 #ifndef OFX_AQUAMANIAC_UGLY_HACK1
159 {
AUTODETECT,
"AUTODETECT",
"AUTODETECT (File format will be automatically detected later)"},
160 {
OFX,
"OFX",
"OFX (Open Financial eXchange (OFX or QFX))"},
161 {
OFC,
"OFC",
"OFC (Microsoft Open Financial Connectivity)"},
162 {
QIF,
"QIF",
"QIF (Intuit Quicken Interchange Format) NOT IMPLEMENTED"},
163 {
LAST,
"LAST",
"Not a file format, meant as a loop breaking condition"}
168 {
QIF,
"QIF",
"QIF (Intuit Quicken Interchange Format) NOT IMPLEMENTED"},
169 {
LAST,
"LAST",
"Not a file format, meant as a loop breaking condition"}
209 const char * p_filename,
231 char ofx_element_name[OFX_ELEMENT_NAME_LENGTH];
260 int server_message_valid;
309 int account_id_valid;
324 int account_type_valid;
332 int account_number_valid;
335 char bank_id[OFX_BANKID_LENGTH];
338 char broker_id[OFX_BROKERID_LENGTH];
341 char branch_id[OFX_BRANCHID_LENGTH];
381 int security_type_valid;
395 int unique_id_type_valid;
397 char secname[OFX_SECNAME_LENGTH];
405 char ticker[OFX_TICKER_LENGTH];
412 char rating[OFX_SECURITY_RATING_LENGTH];
416 int date_unitprice_valid;
425 int currency_ratio_valid;
431 int amounts_are_foreign_currency_valid;
433 char memo[OFX_MEMO2_LENGTH];
438 char fiid[OFX_FIID_LENGTH];
449 OFX_ASSET_CLASS_DOMESTICBOND,
450 OFX_ASSET_CLASS_INTLBOND,
451 OFX_ASSET_CLASS_LARGESTOCK,
452 OFX_ASSET_CLASS_SMALLSTOCK,
453 OFX_ASSET_CLASS_INTLSTOCK,
454 OFX_ASSET_CLASS_MONEYMRKT,
455 OFX_ASSET_CLASS_OTHER
457 int asset_class_valid;
461 int fiasset_class_valid;
475 int mutual_fund_type_valid;
480 OFX_STOCKTYPE_COMMON,
481 OFX_STOCKTYPE_PREFERRED,
482 OFX_STOCKTYPE_CONVERTIBLE,
485 int stock_type_valid;
493 int yield_asof_date_valid;
507 OFX_DEBT_TYPE_COUPON,
520 OFX_DEBTCLASS_TREASURY,
521 OFX_DEBTCLASS_MUNICIPAL,
522 OFX_DEBTCLASS_CORPORATE,
525 int debt_class_valid;
529 int coupon_rate_valid;
533 int date_coupon_valid;
538 OFX_COUPON_FREQ_MONTHLY,
539 OFX_COUPON_FREQ_QUARTERLY,
540 OFX_COUPON_FREQ_SEMIANNUAL,
541 OFX_COUPON_FREQ_ANNUAL,
542 OFX_COUPON_FREQ_OTHER
544 int coupon_freq_valid;
548 int call_price_valid;
552 int yield_to_call_valid;
563 OFX_CALL_TYPE_PREFUND,
564 OFX_CALL_TYPE_MATURITY
570 int yield_to_maturity_valid;
574 int maturity_date_valid;
584 OFX_OPTION_TYPE_CALL,
587 int option_type_valid;
591 int strike_price_valid;
595 int date_expire_valid;
599 int shares_per_cont_valid;
609 int unique_id2_valid;
614 int unique_id2_type_valid;
706 int account_id_valid;
715 int invtransactiontype_valid;
737 char fi_id[OFX_FITID_LENGTH];
753 int unique_id_type_valid;
763 int date_posted_valid;
771 int date_initiated_valid;
776 int date_funds_available_valid;
782 int fi_id_corrected_valid;
787 int fi_id_correction_action_valid;
792 int server_transaction_id_valid;
798 int check_number_valid;
803 int reference_number_valid;
807 int standard_industrial_code_valid;
812 char name[OFX_TRANSACTION_NAME_LENGTH];
816 char memo[OFX_MEMO2_LENGTH];
820 int commission_valid;
833 int market_value_valid;
841 int currency_ratio_valid;
847 int amounts_are_foreign_currency_valid;
854 int accrued_interest_valid;
857 int avg_cost_basis_valid;
864 OFX_BUY_TYPE_BUYTOCOVER,
865 OFX_BUY_TYPE_BUYTOOPEN,
866 OFX_BUY_TYPE_BUYTOCLOSE
871 int denominator_valid;
874 int date_payroll_valid;
877 int date_purchase_valid;
883 int cash_for_fractional_valid;
894 int income_type_valid;
899 OFX_401K_SOURCE_PRETAX,
900 OFX_401K_SOURCE_AFTERTAX,
901 OFX_401K_SOURCE_MATCH,
902 OFX_401K_SOURCE_PROFITSHARING,
903 OFX_401K_SOURCE_ROLLOVER,
904 OFX_401K_SOURCE_OTHERVEST,
905 OFX_401K_SOURCE_OTHERNONVEST
907 int inv_401k_source_valid;
912 char loan_id[OFX_LOANID_LENGTH];
916 int loan_interest_valid;
919 int loan_principal_valid;
933 OFX_OPTACTION_EXERCISE,
934 OFX_OPTACTION_ASSIGN,
937 int opt_action_valid;
952 int prior_year_contrib_valid;
956 int related_fi_tid_valid;
962 OFX_RELTYPE_STRADDLE,
966 int related_type_valid;
974 int option_secured_valid;
983 int sell_reason_valid;
990 OFX_SELL_TYPE_SELLSHORT,
991 OFX_SELL_TYPE_SELLTOOPEN,
992 OFX_SELL_TYPE_SELLTOCLOSE
998 int shares_per_cont_valid;
1002 int state_withholding_valid;
1011 } subacct_from, subacct_funding, subacct_security, subacct_to;
1023 int tax_exempt_valid;
1031 int transfer_action_valid;
1036 OFX_UNITTYPE_SHARES,
1037 OFX_UNITTYPE_CURRENCY
1039 int unit_type_valid;
1043 int withholding_valid;
1080 char currency[OFX_CURRENCY_LENGTH];
1087 int account_id_valid;
1092 int ledger_balance_valid;
1095 int ledger_balance_date_valid;
1099 int date_asof_valid;
1109 int available_balance_valid;
1112 int available_balance_date_valid;
1116 int margin_balance_valid;
1120 int short_balance_valid;
1124 int buying_power_valid;
1131 int date_start_valid;
1143 int marketing_info_valid;
1160 char currency[OFX_CURRENCY_LENGTH];
1180 int account_id_valid;
1191 int unique_id_valid;
1194 int unique_id_type_valid;
1204 } heldinaccount_type;
1205 int heldinaccount_type_valid;
1213 int position_type_valid;
1221 int unit_price_valid;
1225 int market_value_valid;
1229 int date_unit_price_valid;
1238 char memo[OFX_MEMO_LENGTH];
1244 OFX_401K_POSN_SOURCE_PRETAX,
1245 OFX_401K_POSN_SOURCE_AFTERTAX,
1246 OFX_401K_POSN_SOURCE_MATCH,
1247 OFX_401K_POSN_SOURCE_PROFITSHARING,
1248 OFX_401K_POSN_SOURCE_ROLLOVER,
1249 OFX_401K_POSN_SOURCE_OTHERVEST,
1250 OFX_401K_POSN_SOURCE_OTHERNONVEST
1252 int inv_401k_source_valid;
1255 char currency[OFX_CURRENCY_LENGTH];
1260 int currency_ratio_valid;
1266 int amounts_are_foreign_currency_valid;
1270 int security_data_valid;
1365 char fid[OFX_FID_LENGTH];
1366 char org[OFX_ORG_LENGTH];
1367 char url[OFX_URL_LENGTH];
1385 char fid[OFX_FID_LENGTH];
1386 char org[OFX_ORG_LENGTH];
1387 char userid[OFX_USERID_LENGTH];
1388 char userpass[OFX_USERPASS_LENGTH];
1389 char header_version[OFX_HEADERVERSION_LENGTH];
1390 char appid[OFX_APPID_LENGTH];
1391 char appver[OFX_APPVER_LENGTH];
1392 char clientuid[OFX_CLIENTUID_LENGTH];
1395 #define OFX_AMOUNT_LENGTH (32 + 1)
1396 #define OFX_PAYACCT_LENGTH (32 + 1)
1397 #define OFX_STATE_LENGTH (5 + 1)
1398 #define OFX_POSTALCODE_LENGTH (11 + 1)
1399 #define OFX_NAME_LENGTH (32 + 1)
1403 char amount[OFX_AMOUNT_LENGTH];
1404 char account[OFX_PAYACCT_LENGTH];
1406 char memo[OFX_MEMO_LENGTH];
1411 char name[OFX_NAME_LENGTH];
1412 char address1[OFX_NAME_LENGTH];
1413 char city[OFX_NAME_LENGTH];
1414 char state[OFX_STATE_LENGTH];
1415 char postalcode[OFX_POSTALCODE_LENGTH];
1416 char phone[OFX_NAME_LENGTH];
1446 char* libofx_request_payment_status(
const struct OfxFiLogin* login,
const char* transactionid );
1467 #if __GNUC__ && defined(IN_LIBOFX)
1468 # pragma GCC visibility pop
1471 #endif // end of LIBOFX_H
char fi_id[OFX_FITID_LENGTH]
LIBOFX_API int ofx_show_position
An abstraction of a security, such as a stock, mutual fund, etc.
struct OfxAccountData * account_ptr
LIBOFX_API int ofx_DEBUG1_msg
An abstraction of a transaction in an account.
LIBOFX_API int ofx_DEBUG5_msg
char unique_id2_type[OFX_UNIQUE_ID_TYPE_LENGTH]
char currency[OFX_CURRENCY_LENGTH]
char account_id[OFX_ACCOUNT_ID_LENGTH]
char payee_id[OFX_SVRTID2_LENGTH]
void ofx_set_account_cb(LibofxContextPtr ctx, LibofxProcAccountCallback cb, void *user_data)
An abstraction of an account.
Information returned by the OFX Partner Server about a financial institution.
void ofx_set_security_cb(LibofxContextPtr ctx, LibofxProcSecurityCallback cb, void *user_data)
char unique_id[OFX_UNIQUE_ID_LENGTH]
char marketing_info[OFX_MARKETING_INFO_LENGTH]
char unique_id_type[OFX_UNIQUE_ID_TYPE_LENGTH]
int(* LibofxProcPositionCallback)(const struct OfxPositionData data, void *position_data)
The callback function for the OfxPositionData structure.
LIBOFX_API int ofx_DEBUG3_msg
int libofx_free_context(LibofxContextPtr)
Free all resources used by this context.
An abstraction of an OFX STATUS element.
char ticker[OFX_TICKER_LENGTH]
double cash_for_fractional
FiIdCorrectionAction fi_id_correction_action
char server_transaction_id[OFX_SVRTID2_LENGTH]
LIBOFX_API int ofx_DEBUG2_msg
void ofx_set_position_cb(LibofxContextPtr ctx, LibofxProcPositionCallback cb, void *user_data)
char name[OFX_TRANSACTION_NAME_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 fi_id_corrected[OFX_FITID_LENGTH]
An abstraction of an account statement.
int(* LibofxProcSecurityCallback)(const struct OfxSecurityData data, void *security_data)
The callback function for the OfxSecurityData structure.
struct OfxAccountData * account_ptr
LIBOFX_API int ofx_WARNING_msg
LIBOFX_API int ofx_INFO_msg
char currency[OFX_CURRENCY_LENGTH]
Information sufficient to log into an financial institution.
time_t available_balance_date
void ofx_set_statement_cb(LibofxContextPtr ctx, LibofxProcStatementCallback cb, void *user_data)
char fiasset_class[OFX_FIASSET_CLASS_LENGTH]
int ofx_element_name_valid
int(* LibofxProcAccountCallback)(const struct OfxAccountData data, void *account_data)
The callback function for the OfxAccountData structure.
LIBOFX_API int ofx_DEBUG_msg
char account_number[OFX_ACCTID_LENGTH]
char account_id[OFX_ACCOUNT_ID_LENGTH]
LibofxContextPtr libofx_get_new_context()
Initialise the library and return a new context.
char account_id[OFX_ACCOUNT_ID_LENGTH]
char * libofx_request_accountinfo(const struct OfxFiLogin *login)
Creates an OFX account info (list) request in string form.
char account_name[OFX_ACCOUNT_NAME_LENGTH]
char currency[OFX_CURRENCY_LENGTH]
void ofx_set_status_cb(LibofxContextPtr ctx, LibofxProcStatusCallback cb, void *user_data)
char unique_id_type[OFX_UNIQUE_ID_TYPE_LENGTH]
char memo[OFX_MEMO2_LENGTH]
LIBOFX_API int ofx_DEBUG4_msg
int subacct_funding_valid
char unique_id2[OFX_UNIQUE_ID_LENGTH]
char currency[OFX_CURRENCY_LENGTH]
char bank_id[OFX_BANKID_LENGTH]
char currency[OFX_CURRENCY_LENGTH]
int(* LibofxProcStatementCallback)(const struct OfxStatementData data, void *statement_data)
The callback function for the OfxStatementData structure.
char reference_number[OFX_REFERENCE_NUMBER_LENGTH]
char unique_id_type[OFX_UNIQUE_ID_TYPE_LENGTH]
struct OfxAccountData * account_ptr
int amounts_are_foreign_currency
char memo[OFX_MEMO2_LENGTH]
void ofx_set_transaction_cb(LibofxContextPtr ctx, LibofxProcTransactionCallback cb, void *user_data)
int subacct_security_valid
int amounts_are_foreign_currency
char fiid[OFX_FIID_LENGTH]
int(* LibofxProcTransactionCallback)(const struct OfxTransactionData data, void *transaction_data)
The callback function for the OfxTransactionData structure.
char account_id[OFX_ACCOUNT_ID_LENGTH]
char secname[OFX_SECNAME_LENGTH]
long int standard_industrial_code
int transactiontype_valid
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.
char currency[OFX_CURRENCY_LENGTH]
char loan_id[OFX_LOANID_LENGTH]
LIBOFX_API int ofx_ERROR_msg
int(* LibofxProcStatusCallback)(const struct OfxStatusData data, void *status_data)
The callback function for the OfxStatusData structure.
LIBOFX_API int ofx_PARSER_msg
time_t ledger_balance_date
int libofx_proc_file(LibofxContextPtr libofx_context, const char *p_filename, enum LibofxFileFormat ftype)
libofx_proc_file is the entry point of the library.
int amounts_are_foreign_currency
char rating[OFX_SECURITY_RATING_LENGTH]
char check_number[OFX_CHECK_NUMBER_LENGTH]
struct OfxSecurityData * security_data_ptr
char unique_id[OFX_UNIQUE_ID_LENGTH]
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.
time_t date_funds_available
char unique_id[OFX_UNIQUE_ID_LENGTH]
@ OFX_SELLREASON_MATURITY
char related_fi_tid[OFX_FITID_LENGTH]
char memo[OFX_MEMO_LENGTH]
LIBOFX_API int ofx_STATUS_msg
An abstraction of a security position held in an account.