inc/libofx.h
Go to the documentation of this file.
/*-*-c-*-*******************************************************************
libofx.h - Main header file for the libofx API
-------------------
copyright : (C) 2002-2011 by Benoit Grégoire
email : benoitg@coeus.ca
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef LIBOFX_H
#define LIBOFX_H
#include <time.h>
#define LIBOFX_MAJOR_VERSION 0
#define LIBOFX_MINOR_VERSION 10
#define LIBOFX_MICRO_VERSION 0
#define LIBOFX_BUILD_VERSION 0
#define LIBOFX_VERSION_RELEASE_STRING "0.10.0"
#ifdef IN_LIBOFX
# include "config.h"
# ifdef HAVE_GCC_VISIBILITY_EXTS
# pragma GCC visibility push(default)
# endif
#endif
#ifdef __cplusplus
extern "C" {
#else
#define true 1
#define false 0
#endif
#define OFX_ELEMENT_NAME_LENGTH 100
#define OFX_SVRTID2_LENGTH (36 + 1)
#define OFX_CHECK_NUMBER_LENGTH (12 + 1)
#define OFX_REFERENCE_NUMBER_LENGTH (32 + 1)
#define OFX_FITID_LENGTH (255 + 1)
#define OFX_TOKEN2_LENGTH (36 + 1)
#define OFX_MEMO_LENGTH (255 + 1)
#define OFX_FIID_LENGTH (32 + 1)
#define OFX_MEMO2_LENGTH (390 + 1)
#define OFX_BALANCE_NAME_LENGTH (32 + 1)
#define OFX_BALANCE_DESCRIPTION_LENGTH (80 + 1)
#define OFX_CURRENCY_LENGTH (3 + 1) /* In ISO-4217 format */
#define OFX_BANKID_LENGTH (9 + 1)
#define OFX_BRANCHID_LENGTH (22 + 1)
#define OFX_ACCTID_LENGTH (22 + 1)
#define OFX_ACCTKEY_LENGTH (22 + 1)
#define OFX_BROKERID_LENGTH (22 + 1)
/* Must be MAX of <BANKID>+<BRANCHID>+<ACCTID>, <ACCTID>+<ACCTKEY> and <ACCTID>+<BROKERID> */
#define OFX_ACCOUNT_ID_LENGTH (OFX_BANKID_LENGTH + OFX_BRANCHID_LENGTH + OFX_ACCTID_LENGTH + 1)
#define OFX_ACCOUNT_NAME_LENGTH 255
#define OFX_MARKETING_INFO_LENGTH (360 + 1)
#define OFX_TRANSACTION_NAME_LENGTH (96 + 1)
#define OFX_UNIQUE_ID_LENGTH (32 + 1)
#define OFX_UNIQUE_ID_TYPE_LENGTH (10 + 1)
#define OFX_SECNAME_LENGTH (120 + 1)
#define OFX_TICKER_LENGTH (32 + 1)
#define OFX_ORG_LENGTH (32 + 1)
#define OFX_FID_LENGTH (32 + 1)
#define OFX_USERID_LENGTH (32 + 1)
#define OFX_USERPASS_LENGTH (32 + 1)
#define OFX_URL_LENGTH (500 + 1)
#define OFX_APPID_LENGTH (32)
#define OFX_APPVER_LENGTH (32)
#define OFX_HEADERVERSION_LENGTH (32)
#define OFX_CLIENTUID_LENGTH (36 + 1)
#define OFX_SECURITY_RATING_LENGTH (32 + 1)
#define OFX_FIASSET_CLASS_LENGTH (32 + 1)
#define OFX_LOANID_LENGTH (32 + 1)
/*
#define OFX_STATEMENT_CB 0;
#define OFX_ACCOUNT_CB 1;
#define OFX_TRACSACTION_CB 2;
#define OFX_SECURITY_CB 3;
#define OFX_STATUS_CB 4;
*/
typedef void * LibofxContextPtr;
LibofxContextPtr libofx_get_new_context();
int libofx_free_context( LibofxContextPtr );
void libofx_set_dtd_dir(LibofxContextPtr libofx_context,
const char *s);
enum LibofxFileFormat
{
AUTODETECT,
OFX,
OFC,
QIF,
UNKNOWN,
LAST
};
struct LibofxFileFormatInfo
{
enum LibofxFileFormat format;
const char * format_name;
const char * description;
};
#ifndef OFX_AQUAMANIAC_UGLY_HACK1
const struct LibofxFileFormatInfo LibofxImportFormatList[] =
{
{AUTODETECT, "AUTODETECT", "AUTODETECT (File format will be automatically detected later)"},
{OFX, "OFX", "OFX (Open Financial eXchange (OFX or QFX))"},
{OFC, "OFC", "OFC (Microsoft Open Financial Connectivity)"},
{QIF, "QIF", "QIF (Intuit Quicken Interchange Format) NOT IMPLEMENTED"},
{LAST, "LAST", "Not a file format, meant as a loop breaking condition"}
};
const struct LibofxFileFormatInfo LibofxExportFormatList[] =
{
{QIF, "QIF", "QIF (Intuit Quicken Interchange Format) NOT IMPLEMENTED"},
{LAST, "LAST", "Not a file format, meant as a loop breaking condition"}
};
enum LibofxFileFormat libofx_get_file_format_from_str(const struct LibofxFileFormatInfo format_list[], const char * file_type_string);
const char * libofx_get_file_format_description(const struct LibofxFileFormatInfo format_list[], enum LibofxFileFormat file_format);
#endif
int libofx_proc_file(LibofxContextPtr libofx_context,
const char * p_filename,
enum LibofxFileFormat ftype);
struct OfxStatusData
{
char ofx_element_name[OFX_ELEMENT_NAME_LENGTH];
int ofx_element_name_valid;
int code;
const char* name;
const char* description;
int code_valid;
enum Severity
{
INFO,
WARN,
ERROR
} severity;
int severity_valid;
char* server_message;
int server_message_valid;
};
typedef int (*LibofxProcStatusCallback)(const struct OfxStatusData data, void * status_data);
struct OfxAccountData
{
char account_id[OFX_ACCOUNT_ID_LENGTH];
char account_name[OFX_ACCOUNT_NAME_LENGTH];
int account_id_valid;/* Use for both account_id and account_name */
enum AccountType
{
OFX_CHECKING,
OFX_SAVINGS,
OFX_MONEYMRKT,
OFX_CREDITLINE,
OFX_CMA,
OFX_CREDITCARD,
OFX_INVESTMENT,
OFX_401K
} account_type;
int account_type_valid;
char currency[OFX_CURRENCY_LENGTH];
int currency_valid;
char account_number[OFX_ACCTID_LENGTH];
int account_number_valid;
char bank_id[OFX_BANKID_LENGTH];
int bank_id_valid;
char broker_id[OFX_BROKERID_LENGTH];
int broker_id_valid;
char branch_id[OFX_BRANCHID_LENGTH];
int branch_id_valid;
};
typedef int (*LibofxProcAccountCallback)(const struct OfxAccountData data, void * account_data);
struct OfxSecurityData
{
enum SecurityType
{
OFX_DEBT_SECURITY,
OFX_FUND_SECURITY,
OFX_OPTION_SECURITY,
OFX_STOCK_SECURITY,
OFX_OTHER_SECURITY,
} security_type;
int security_type_valid;
char unique_id[OFX_UNIQUE_ID_LENGTH];
int unique_id_valid;
char unique_id_type[OFX_UNIQUE_ID_TYPE_LENGTH];
int unique_id_type_valid;
char secname[OFX_SECNAME_LENGTH];
int secname_valid;
char ticker[OFX_TICKER_LENGTH];
int ticker_valid;
double unitprice;
int unitprice_valid;
char rating[OFX_SECURITY_RATING_LENGTH];
int rating_valid;
time_t date_unitprice;
int date_unitprice_valid;
char currency[OFX_CURRENCY_LENGTH];
int currency_valid;
double currency_ratio;
int currency_ratio_valid;
int amounts_are_foreign_currency;
int amounts_are_foreign_currency_valid;
char memo[OFX_MEMO2_LENGTH];
int memo_valid;
char fiid[OFX_FIID_LENGTH];
int fiid_valid;
enum AssetClass
{
OFX_ASSET_CLASS_DOMESTICBOND,
OFX_ASSET_CLASS_INTLBOND,
OFX_ASSET_CLASS_LARGESTOCK,
OFX_ASSET_CLASS_SMALLSTOCK,
OFX_ASSET_CLASS_INTLSTOCK,
OFX_ASSET_CLASS_MONEYMRKT,
OFX_ASSET_CLASS_OTHER
} asset_class;
int asset_class_valid;
char fiasset_class[OFX_FIASSET_CLASS_LENGTH];
int fiasset_class_valid;
enum MutalFundType
{
OFX_MFTYPE_OPENEND,
OFX_MFTYPE_CLOSEEND,
OFX_MFTYPE_OTHER
} mutual_fund_type;
int mutual_fund_type_valid;
enum StockType
{
OFX_STOCKTYPE_COMMON,
OFX_STOCKTYPE_PREFERRED,
OFX_STOCKTYPE_CONVERTIBLE,
OFX_STOCKTYPE_OTHER
} stock_type;
int stock_type_valid;
double yield;
int yield_valid;
time_t yield_asof_date;
int yield_asof_date_valid;
double par_value;
int par_value_valid;
enum DebtType
{
OFX_DEBT_TYPE_COUPON,
OFX_DEBT_TYPE_ZERO
} debt_type;
int debt_type_valid;
enum DebtClass
{
OFX_DEBTCLASS_TREASURY,
OFX_DEBTCLASS_MUNICIPAL,
OFX_DEBTCLASS_CORPORATE,
OFX_DEBTCLASS_OTHER
} debt_class;
int debt_class_valid;
double coupon_rate;
int coupon_rate_valid;
time_t date_coupon;
int date_coupon_valid;
enum CouponFreq
{
OFX_COUPON_FREQ_MONTHLY,
OFX_COUPON_FREQ_QUARTERLY,
OFX_COUPON_FREQ_SEMIANNUAL,
OFX_COUPON_FREQ_ANNUAL,
OFX_COUPON_FREQ_OTHER
} coupon_freq;
int coupon_freq_valid;
double call_price;
int call_price_valid;
double yield_to_call;
int yield_to_call_valid;
time_t call_date;
int call_date_valid;
enum CallType
{
OFX_CALL_TYPE_CALL,
OFX_CALL_TYPE_PUT,
OFX_CALL_TYPE_PREFUND,
OFX_CALL_TYPE_MATURITY
} call_type;
int call_type_valid;
double yield_to_maturity;
int yield_to_maturity_valid;
time_t maturity_date;
int maturity_date_valid;
enum OptionType
{
OFX_OPTION_TYPE_CALL,
OFX_OPTION_TYPE_PUT
} option_type;
int option_type_valid;
double strike_price;
int strike_price_valid;
time_t date_expire;
int date_expire_valid;
double shares_per_cont;
int shares_per_cont_valid;
char unique_id2[OFX_UNIQUE_ID_LENGTH];
int unique_id2_valid;
char unique_id2_type[OFX_UNIQUE_ID_TYPE_LENGTH];
int unique_id2_type_valid;
};/* end struct OfxSecurityData */
typedef int (*LibofxProcSecurityCallback)(const struct OfxSecurityData data, void * security_data);
typedef enum
{
OFX_CREDIT,
OFX_DEBIT,
OFX_INT,
OFX_DIV,
OFX_FEE,
OFX_SRVCHG,
OFX_DEP,
OFX_ATM,
OFX_POS,
OFX_XFER,
OFX_CHECK,
OFX_PAYMENT,
OFX_CASH,
OFX_DIRECTDEP,
OFX_DIRECTDEBIT,
OFX_REPEATPMT,
OFX_OTHER
} TransactionType;
typedef enum
{
OFX_BUYDEBT,
OFX_BUYMF,
OFX_BUYOPT,
OFX_BUYOTHER,
OFX_BUYSTOCK,
OFX_CLOSUREOPT,
OFX_INCOME,
OFX_INVEXPENSE,
OFX_JRNLFUND,
OFX_JRNLSEC,
OFX_MARGININTEREST,
OFX_REINVEST,
OFX_RETOFCAP,
OFX_SELLDEBT,
OFX_SELLMF,
OFX_SELLOPT,
OFX_SELLOTHER,
OFX_SELLSTOCK,
OFX_SPLIT,
OFX_TRANSFER,
OFX_INVBANKTRAN
} InvTransactionType;
typedef enum
{
DELETE,
REPLACE
} FiIdCorrectionAction;
struct OfxTransactionData
{
char account_id[OFX_ACCOUNT_ID_LENGTH];
struct OfxAccountData * account_ptr;
int account_id_valid;
TransactionType transactiontype;
int transactiontype_valid;
InvTransactionType invtransactiontype;
int invtransactiontype_valid;
double units;
int units_valid;
double unitprice;
int unitprice_valid;
double amount;
int amount_valid;
char fi_id[OFX_FITID_LENGTH];
int fi_id_valid;
char unique_id[OFX_UNIQUE_ID_LENGTH];
int unique_id_valid;
char unique_id_type[OFX_UNIQUE_ID_TYPE_LENGTH];
int unique_id_type_valid;
struct OfxSecurityData *security_data_ptr;
int security_data_valid;
time_t date_posted;
int date_posted_valid;
time_t date_initiated;
int date_initiated_valid;
time_t date_funds_available;
int date_funds_available_valid;
char fi_id_corrected[OFX_FITID_LENGTH];
int fi_id_corrected_valid;
FiIdCorrectionAction fi_id_correction_action;
int fi_id_correction_action_valid;
char server_transaction_id[OFX_SVRTID2_LENGTH];
int server_transaction_id_valid;
char check_number[OFX_CHECK_NUMBER_LENGTH];
int check_number_valid;
char reference_number[OFX_REFERENCE_NUMBER_LENGTH];
int reference_number_valid;
long int standard_industrial_code;
int standard_industrial_code_valid;
char payee_id[OFX_SVRTID2_LENGTH];
int payee_id_valid;
char name[OFX_TRANSACTION_NAME_LENGTH];
int name_valid;
char memo[OFX_MEMO2_LENGTH];
int memo_valid;
double commission;
int commission_valid;
double fees;
int fees_valid;
double oldunits;
int oldunits_valid;
double newunits;
int newunits_valid;
double market_value;
int market_value_valid;
char currency[OFX_CURRENCY_LENGTH];
int currency_valid;
double currency_ratio;
int currency_ratio_valid;
int amounts_are_foreign_currency;
int amounts_are_foreign_currency_valid;
double accrued_interest;
int accrued_interest_valid;
double avg_cost_basis;
int avg_cost_basis_valid;
enum BuyType
{
OFX_BUY_TYPE_BUY,
OFX_BUY_TYPE_BUYTOCOVER,
OFX_BUY_TYPE_BUYTOOPEN,
OFX_BUY_TYPE_BUYTOCLOSE
} buy_type;
int buy_type_valid;
double denominator;
int denominator_valid;
time_t date_payroll;
int date_payroll_valid;
time_t date_purchase;
int date_purchase_valid;
double gain;
int gain_valid;
double cash_for_fractional;
int cash_for_fractional_valid;
enum IncomeType
{
OFX_CGLONG,
OFX_CGSHORT,
OFX_DIVIDEND,
OFX_INTEREST,
OFX_MISC
} income_type;
int income_type_valid;
enum Inv401kSource
{
OFX_401K_SOURCE_PRETAX,
OFX_401K_SOURCE_AFTERTAX,
OFX_401K_SOURCE_MATCH,
OFX_401K_SOURCE_PROFITSHARING,
OFX_401K_SOURCE_ROLLOVER,
OFX_401K_SOURCE_OTHERVEST,
OFX_401K_SOURCE_OTHERNONVEST
} inv_401k_source;
int inv_401k_source_valid;
double load;
int load_valid;
char loan_id[OFX_LOANID_LENGTH];
int loan_id_valid;
double loan_interest;
int loan_interest_valid;
double loan_principal;
int loan_principal_valid;
double markdown;
int markdown_valid;
double markup;
int markup_valid;
double numerator;
int numerator_valid;
enum OptAction
{
OFX_OPTACTION_EXERCISE,
OFX_OPTACTION_ASSIGN,
OFX_OPTACTION_EXPIRE
} opt_action;
int opt_action_valid;
double penalty;
int penalty_valid;
enum PosType
{
OFX_POSTYPE_LONG,
OFX_POSTYPE_SHORT
} pos_type;
int pos_type_valid;
int prior_year_contrib;
int prior_year_contrib_valid;
char related_fi_tid[OFX_FITID_LENGTH];
int related_fi_tid_valid;
enum RelatedType
{
OFX_RELTYPE_SPREAD,
OFX_RELTYPE_STRADDLE,
OFX_RELTYPE_NONE,
OFX_RELTYPE_OTHER
} related_type;
int related_type_valid;
enum OptionSecured
{
OFX_SECURED_NAKED,
OFX_SECURED_COVERED
} option_secured;
int option_secured_valid;
enum SellReason
{
OFX_SELLREASON_CALL,
OFX_SELLREASON_SELL,
OFX_SELLREASON_MATURITY
} sell_reason;
int sell_reason_valid;
enum SellType
{
OFX_SELL_TYPE_SELL,
OFX_SELL_TYPE_SELLSHORT,
OFX_SELL_TYPE_SELLTOOPEN,
OFX_SELL_TYPE_SELLTOCLOSE
} sell_type;
int sell_type_valid;
double shares_per_cont;
int shares_per_cont_valid;
double state_withholding;
int state_withholding_valid;
enum SubAcctType
{
OFX_SUBACCT_CASH,
OFX_SUBACCT_MARGIN,
OFX_SUBACCT_SHORT,
OFX_SUBACCT_OTHER
} subacct_from, subacct_funding, subacct_security, subacct_to;
int subacct_from_valid;
int subacct_funding_valid;
int subacct_security_valid;
int subacct_to_valid;
double taxes;
int taxes_valid;
int tax_exempt;
int tax_exempt_valid;
enum TransferAction
{
OFX_TFERACTION_IN,
OFX_TFERACTION_OUT
} transfer_action;
int transfer_action_valid;
enum UnitType
{
OFX_UNITTYPE_SHARES,
OFX_UNITTYPE_CURRENCY
} unit_type;
int unit_type_valid;
double withholding;
int withholding_valid;
/*********** NOT YET COMPLETE!!! *********************/
};
typedef int (*LibofxProcTransactionCallback)(const struct OfxTransactionData data, void * transaction_data);
struct OfxStatementData
{
char currency[OFX_CURRENCY_LENGTH];
int currency_valid;
char account_id[OFX_ACCOUNT_ID_LENGTH];
struct OfxAccountData * account_ptr;
int account_id_valid;
double ledger_balance;
int ledger_balance_valid;
time_t ledger_balance_date;
int ledger_balance_date_valid;
time_t date_asof;
int date_asof_valid;
double available_balance;
int available_balance_valid;
time_t available_balance_date;
int available_balance_date_valid;
double margin_balance;
int margin_balance_valid;
double short_balance;
int short_balance_valid;
double buying_power;
int buying_power_valid;
time_t date_start;
int date_start_valid;
time_t date_end;
int date_end_valid;
char marketing_info[OFX_MARKETING_INFO_LENGTH];
int marketing_info_valid;
};
typedef int (*LibofxProcStatementCallback)(const struct OfxStatementData data, void * statement_data);
struct OfxCurrency
{
char currency[OFX_CURRENCY_LENGTH];
double exchange_rate;
int must_convert;
};
struct OfxPositionData
{
char account_id[OFX_ACCOUNT_ID_LENGTH];
struct OfxAccountData * account_ptr;
int account_id_valid;
char unique_id[OFX_UNIQUE_ID_LENGTH];
int unique_id_valid;
char unique_id_type[OFX_UNIQUE_ID_TYPE_LENGTH];
int unique_id_type_valid;
enum HeldInAccountType
{
OFX_HELDINACCT_CASH,
OFX_HELDINACCT_MARGIN,
OFX_HELDINACCT_SHORT,
OFX_HELDINACCT_OTHER
} heldinaccount_type;
int heldinaccount_type_valid;
enum PositionType
{
OFX_POSITION_SHORT,
OFX_POSITION_LONG
} position_type;
int position_type_valid;
double units;
int units_valid;
double unit_price;
int unit_price_valid;
double market_value;
int market_value_valid;
time_t date_unit_price;
int date_unit_price_valid;
char memo[OFX_MEMO_LENGTH];
int memo_valid;
enum Inv401kPosnSource
{
OFX_401K_POSN_SOURCE_PRETAX,
OFX_401K_POSN_SOURCE_AFTERTAX,
OFX_401K_POSN_SOURCE_MATCH,
OFX_401K_POSN_SOURCE_PROFITSHARING,
OFX_401K_POSN_SOURCE_ROLLOVER,
OFX_401K_POSN_SOURCE_OTHERVEST,
OFX_401K_POSN_SOURCE_OTHERNONVEST
} inv_401k_source;
int inv_401k_source_valid;
char currency[OFX_CURRENCY_LENGTH];
int currency_valid;
double currency_ratio;
int currency_ratio_valid;
int amounts_are_foreign_currency;
int amounts_are_foreign_currency_valid;
struct OfxSecurityData *security_data_ptr;
int security_data_valid;
};
typedef int (*LibofxProcPositionCallback)(const struct OfxPositionData data, void * position_data);
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);
/*int libofx_proc_buffer(LibofxContextPtr ctx,
const char *s, unsigned int size);*/
/* **************************************** */
struct OfxFiServiceInfo
{
char fid[OFX_FID_LENGTH];
char org[OFX_ORG_LENGTH];
char url[OFX_URL_LENGTH];
int accountlist;
int statements;
int billpay;
int investments;
};
struct OfxFiLogin
{
char fid[OFX_FID_LENGTH];
char org[OFX_ORG_LENGTH];
char userid[OFX_USERID_LENGTH];
char userpass[OFX_USERPASS_LENGTH];
char header_version[OFX_HEADERVERSION_LENGTH];
char appid[OFX_APPID_LENGTH];
char appver[OFX_APPVER_LENGTH];
char clientuid[OFX_CLIENTUID_LENGTH];
};
#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)
struct OfxPayment
{
char amount[OFX_AMOUNT_LENGTH];
char account[OFX_PAYACCT_LENGTH];
char datedue[9];
char memo[OFX_MEMO_LENGTH];
};
struct OfxPayee
{
char name[OFX_NAME_LENGTH];
char address1[OFX_NAME_LENGTH];
char city[OFX_NAME_LENGTH];
char state[OFX_STATE_LENGTH];
char postalcode[OFX_POSTALCODE_LENGTH];
char phone[OFX_NAME_LENGTH];
};
char* libofx_request_statement( const struct OfxFiLogin* fi, const struct OfxAccountData* account, time_t date_from );
char* libofx_request_accountinfo( const struct OfxFiLogin* login );
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 );
extern int ofx_PARSER_msg;
extern int ofx_DEBUG_msg;
extern int ofx_DEBUG1_msg;
extern int ofx_DEBUG2_msg;
extern int ofx_DEBUG3_msg;
extern int ofx_DEBUG4_msg;
extern int ofx_DEBUG5_msg;
extern int ofx_STATUS_msg;
extern int ofx_INFO_msg;
extern int ofx_WARNING_msg;
extern int ofx_ERROR_msg;
extern int ofx_show_position;
#ifdef __cplusplus
} // end of extern "C"
#endif
#if defined(HAVE_GCC_VISIBILITY_EXTS) && defined(IN_LIBOFX)
# pragma GCC visibility pop
#endif
#endif // end of LIBOFX_H
OFX_INT
Definition: inc/libofx.h:626
OFX_OTHER
Definition: inc/libofx.h:640
OfxTransactionData::date_posted
time_t date_posted
Definition: inc/libofx.h:747
OfxTransactionData::penalty
double penalty
Definition: inc/libofx.h:928
OFX_RETOFCAP
Definition: inc/libofx.h:657
AUTODETECT
Definition: inc/libofx.h:128
OfxStatementData::ledger_balance_date
time_t ledger_balance_date
Definition: inc/libofx.h:1083
OfxTransactionData::subacct_to_valid
int subacct_to_valid
Definition: inc/libofx.h:1004
OfxAccountData
An abstraction of an account.
Definition: inc/libofx.h:276
OfxPayee
Definition: inc/libofx.h:1398
OFX_JRNLSEC
Definition: inc/libofx.h:654
OfxTransactionData::denominator
double denominator
Definition: inc/libofx.h:859
OFX_POS
Definition: inc/libofx.h:632
libofx_get_file_format_from_str
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.
Definition: build/libofx-0.10.0/lib/file_preproc.cpp:54
OfxStatusData::code_valid
int code_valid
Definition: inc/libofx.h:231
OFX_REPEATPMT
Definition: inc/libofx.h:639
OfxTransactionData::gain
double gain
Definition: inc/libofx.h:868
OfxTransactionData::shares_per_cont
double shares_per_cont
Definition: inc/libofx.h:986
OfxTransactionData::load
double load
Definition: inc/libofx.h:898
OfxTransactionData::OFX_SELLREASON_SELL
Definition: inc/libofx.h:969
DELETE
Definition: inc/libofx.h:670
OfxStatusData::Severity
Severity
Definition: inc/libofx.h:234
LibofxFileFormatInfo
Definition: inc/libofx.h:136
ofx_DEBUG1_msg
int ofx_DEBUG1_msg
Definition: build/libofx-0.10.0/lib/messages.cpp:32
LibofxFileFormatInfo::format
enum LibofxFileFormat format
Definition: inc/libofx.h:138
OFX_ATM
Definition: inc/libofx.h:631
OfxSecurityData::OFX_OTHER_SECURITY
Definition: inc/libofx.h:368
OFX_MARGININTEREST
Definition: inc/libofx.h:655
OfxTransactionData::tax_exempt
int tax_exempt
Definition: inc/libofx.h:1011
InvTransactionType
InvTransactionType
Definition: inc/libofx.h:643
ofx_set_position_cb
void ofx_set_position_cb(LibofxContextPtr ctx, LibofxProcPositionCallback cb, void *user_data)
Definition: build/libofx-0.10.0/lib/context.cpp:237
OfxTransactionData::OFX_SELLREASON_CALL
Definition: inc/libofx.h:968
OfxStatementData::available_balance
double available_balance
Definition: inc/libofx.h:1095
OfxTransactionData::taxes
double taxes
Definition: inc/libofx.h:1007
libofx_request_statement
char * libofx_request_statement(const struct OfxFiLogin *fi, const struct OfxAccountData *account, time_t date_from)
Creates an OFX statement request in string form.
OfxPositionData::amounts_are_foreign_currency
int amounts_are_foreign_currency
Definition: inc/libofx.h:1254
OfxSecurityData::date_coupon
time_t date_coupon
Definition: inc/libofx.h:521
OfxTransactionData::units
double units
Definition: inc/libofx.h:713
OfxPositionData
An abstraction of a security position held in an account.
Definition: inc/libofx.h:1161
OfxTransactionData::subacct_from_valid
int subacct_from_valid
Definition: inc/libofx.h:1001
LibofxFileFormatInfo::description
const char * description
Definition: inc/libofx.h:140
OfxCurrency::exchange_rate
double exchange_rate
Definition: inc/libofx.h:1150
OfxSecurityData::call_date
time_t call_date
Definition: inc/libofx.h:544
OfxTransactionData::OptionSecured
OptionSecured
Definition: inc/libofx.h:958
OfxSecurityData::MutalFundType
MutalFundType
Definition: inc/libofx.h:458
OfxStatusData::description
const char * description
Definition: inc/libofx.h:230
OfxPositionData::unit_price
double unit_price
Definition: inc/libofx.h:1209
OfxStatementData::date_asof
time_t date_asof
Definition: inc/libofx.h:1087
OfxAccountData::OFX_SAVINGS
Definition: inc/libofx.h:305
OfxAccountData::currency
char currency[OFX_CURRENCY_LENGTH]
Definition: inc/libofx.h:316
OfxStatementData::date_start
time_t date_start
Definition: inc/libofx.h:1119
OfxTransactionData::numerator
double numerator
Definition: inc/libofx.h:916
OFX_BUYOTHER
Definition: inc/libofx.h:648
OfxSecurityData::OFX_STOCK_SECURITY
Definition: inc/libofx.h:367
OfxStatementData::date_end
time_t date_end
Definition: inc/libofx.h:1126
OfxFiServiceInfo::accountlist
int accountlist
Definition: inc/libofx.h:1357
OfxAccountData::OFX_CREDITCARD
Definition: inc/libofx.h:309
OfxTransactionData::transactiontype_valid
int transactiontype_valid
Definition: inc/libofx.h:698
OfxTransactionData::withholding
double withholding
Definition: inc/libofx.h:1031
OFX_SELLDEBT
Definition: inc/libofx.h:658
OFX_CHECK
Definition: inc/libofx.h:634
OFX_FEE
Definition: inc/libofx.h:628
OfxStatusData::INFO
Definition: inc/libofx.h:236
OFX_INVBANKTRAN
Definition: inc/libofx.h:665
OfxSecurityData::call_price
double call_price
Definition: inc/libofx.h:536
OfxSecurityData::OFX_FUND_SECURITY
Definition: inc/libofx.h:365
OfxTransactionData::commission
double commission
Definition: inc/libofx.h:808
OfxTransactionData::UnitType
UnitType
Definition: inc/libofx.h:1023
OfxFiServiceInfo::investments
int investments
Definition: inc/libofx.h:1360
OFX
Definition: inc/libofx.h:129
OfxSecurityData::DebtClass
DebtClass
Definition: inc/libofx.h:507
OFX_CASH
Definition: inc/libofx.h:636
OfxTransactionData::OFX_CGSHORT
Definition: inc/libofx.h:878
OfxTransactionData::fi_id_correction_action
FiIdCorrectionAction fi_id_correction_action
Definition: inc/libofx.h:775
OfxTransactionData::TransferAction
TransferAction
Definition: inc/libofx.h:1015
OFX_BUYDEBT
Definition: inc/libofx.h:645
OfxFiServiceInfo::billpay
int billpay
Definition: inc/libofx.h:1359
OfxSecurityData::currency
char currency[OFX_CURRENCY_LENGTH]
Definition: inc/libofx.h:409
OFX_SPLIT
Definition: inc/libofx.h:663
OFX_CLOSUREOPT
Definition: inc/libofx.h:650
OFX_TRANSFER
Definition: inc/libofx.h:664
libofx_request_accountinfo
char * libofx_request_accountinfo(const struct OfxFiLogin *login)
Creates an OFX account info (list) request in string form.
OfxTransactionData::loan_interest
double loan_interest
Definition: inc/libofx.h:904
OfxStatusData::WARN
Definition: inc/libofx.h:237
OfxSecurityData::StockType
StockType
Definition: inc/libofx.h:467
OfxTransactionData::currency_ratio
double currency_ratio
Definition: inc/libofx.h:829
REPLACE
Definition: inc/libofx.h:672
LibofxProcAccountCallback
int(* LibofxProcAccountCallback)(const struct OfxAccountData data, void *account_data)
The callback function for the OfxAccountData stucture.
Definition: inc/libofx.h:349
OfxPositionData::Inv401kPosnSource
Inv401kPosnSource
Definition: inc/libofx.h:1231
OfxPositionData::OFX_HELDINACCT_CASH
Definition: inc/libofx.h:1189
ofx_STATUS_msg
int ofx_STATUS_msg
Definition: build/libofx-0.10.0/lib/messages.cpp:37
OfxTransactionData::markup
double markup
Definition: inc/libofx.h:913
OfxSecurityData::maturity_date
time_t maturity_date
Definition: inc/libofx.h:562
OfxTransactionData::BuyType
BuyType
Definition: inc/libofx.h:850
ofx_WARNING_msg
int ofx_WARNING_msg
Definition: build/libofx-0.10.0/lib/messages.cpp:39
OfxPayment
Definition: inc/libofx.h:1390
OfxTransactionData::market_value
double market_value
Definition: inc/libofx.h:821
OfxPositionData::date_unit_price
time_t date_unit_price
Definition: inc/libofx.h:1217
OfxSecurityData::currency_ratio
double currency_ratio
Definition: inc/libofx.h:413
QIF
Definition: inc/libofx.h:131
libofx_get_new_context
LibofxContextPtr libofx_get_new_context()
Initialise the library and return a new context.
Definition: build/libofx-0.10.0/lib/context.cpp:169
OfxSecurityData::strike_price
double strike_price
Definition: inc/libofx.h:579
LAST
Definition: inc/libofx.h:133
OfxStatusData::code
int code
Definition: inc/libofx.h:228
ofx_PARSER_msg
int ofx_PARSER_msg
Definition: build/libofx-0.10.0/lib/messages.cpp:30
libofx_get_file_format_description
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.
Definition: build/libofx-0.10.0/lib/file_preproc.cpp:37
OfxTransactionData::amounts_are_foreign_currency
int amounts_are_foreign_currency
Definition: inc/libofx.h:835
OfxTransactionData::SellReason
SellReason
Definition: inc/libofx.h:966
OfxTransactionData::standard_industrial_code
long int standard_industrial_code
Definition: inc/libofx.h:794
OfxStatementData::short_balance
double short_balance
Definition: inc/libofx.h:1108
OfxTransactionData::loan_principal
double loan_principal
Definition: inc/libofx.h:907
OfxSecurityData::memo
char memo[OFX_MEMO2_LENGTH]
Definition: inc/libofx.h:422
UNKNOWN
Definition: inc/libofx.h:132
OFX_BUYMF
Definition: inc/libofx.h:646
LibofxProcStatementCallback
int(* LibofxProcStatementCallback)(const struct OfxStatementData data, void *statement_data)
The callback function for the OfxStatementData stucture.
Definition: inc/libofx.h:1142
OfxSecurityData::yield
double yield
Definition: inc/libofx.h:478
ofx_set_statement_cb
void ofx_set_statement_cb(LibofxContextPtr ctx, LibofxProcStatementCallback cb, void *user_data)
Definition: build/libofx-0.10.0/lib/context.cpp:229
OfxPositionData::security_data_ptr
struct OfxSecurityData * security_data_ptr
Definition: inc/libofx.h:1258
OfxTransactionData::date_payroll
time_t date_payroll
Definition: inc/libofx.h:862
OFX_SELLSTOCK
Definition: inc/libofx.h:662
ofx_set_status_cb
void ofx_set_status_cb(LibofxContextPtr ctx, LibofxProcStatusCallback cb, void *user_data)
Definition: build/libofx-0.10.0/lib/context.cpp:194
OfxTransactionData::cash_for_fractional
double cash_for_fractional
Definition: inc/libofx.h:871
ofx_set_account_cb
void ofx_set_account_cb(LibofxContextPtr ctx, LibofxProcAccountCallback cb, void *user_data)
Definition: build/libofx-0.10.0/lib/context.cpp:202
OfxSecurityData::OFX_OPTION_SECURITY
Definition: inc/libofx.h:366
OfxTransactionData::subacct_funding_valid
int subacct_funding_valid
Definition: inc/libofx.h:1002
OfxTransactionData::date_initiated
time_t date_initiated
Definition: inc/libofx.h:754
OFX_CREDIT
Definition: inc/libofx.h:624
OFX_DEP
Definition: inc/libofx.h:630
OFX_JRNLFUND
Definition: inc/libofx.h:653
OFX_SELLMF
Definition: inc/libofx.h:659
OfxAccountData::OFX_MONEYMRKT
Definition: inc/libofx.h:306
OfxTransactionData::unitprice
double unitprice
Definition: inc/libofx.h:716
OfxStatementData::available_balance_date
time_t available_balance_date
Definition: inc/libofx.h:1100
FiIdCorrectionAction
FiIdCorrectionAction
Definition: inc/libofx.h:668
OfxSecurityData::CallType
CallType
Definition: inc/libofx.h:548
OfxStatusData::server_message
char * server_message
Definition: inc/libofx.h:247
LibofxProcTransactionCallback
int(* LibofxProcTransactionCallback)(const struct OfxTransactionData data, void *transaction_data)
The callback function for the OfxTransactionData stucture.
Definition: inc/libofx.h:1046
OfxTransactionData::account_ptr
struct OfxAccountData * account_ptr
Definition: inc/libofx.h:693
OfxTransactionData::IncomeType
IncomeType
Definition: inc/libofx.h:875
OfxSecurityData::date_unitprice
time_t date_unitprice
Definition: inc/libofx.h:404
OfxSecurityData::date_expire
time_t date_expire
Definition: inc/libofx.h:583
TransactionType
TransactionType
Definition: inc/libofx.h:622
OfxStatementData::account_ptr
struct OfxAccountData * account_ptr
Definition: inc/libofx.h:1074
OFX_SRVCHG
Definition: inc/libofx.h:629
OfxSecurityData::shares_per_cont
double shares_per_cont
Definition: inc/libofx.h:587
OFX_BUYSTOCK
Definition: inc/libofx.h:649
OfxTransactionData::RelatedType
RelatedType
Definition: inc/libofx.h:948
ofx_DEBUG5_msg
int ofx_DEBUG5_msg
Definition: build/libofx-0.10.0/lib/messages.cpp:36
OfxAccountData::AccountType
AccountType
Definition: inc/libofx.h:302
OfxPositionData::units
double units
Definition: inc/libofx.h:1205
LibofxProcPositionCallback
int(* LibofxProcPositionCallback)(const struct OfxPositionData data, void *position_data)
The callback function for the OfxPositionData stucture.
Definition: inc/libofx.h:1270
OfxPositionData::OFX_HELDINACCT_SHORT
Definition: inc/libofx.h:1191
OFX_DIRECTDEBIT
Definition: inc/libofx.h:638
OfxTransactionData::PosType
PosType
Definition: inc/libofx.h:932
OFX_SELLOTHER
Definition: inc/libofx.h:661
OFX_PAYMENT
Definition: inc/libofx.h:635
ofx_show_position
int ofx_show_position
Definition: build/libofx-0.10.0/lib/messages.cpp:41
OfxStatementData::buying_power
double buying_power
Definition: inc/libofx.h:1112
OFX_BUYOPT
Definition: inc/libofx.h:647
OfxTransactionData::amount
double amount
Definition: inc/libofx.h:720
OfxTransactionData::state_withholding
double state_withholding
Definition: inc/libofx.h:990
OfxSecurityData::SecurityType
SecurityType
Definition: inc/libofx.h:362
OFX_INCOME
Definition: inc/libofx.h:651
OfxStatusData
An abstraction of an OFX STATUS element.
Definition: inc/libofx.h:214
OfxTransactionData::SellType
SellType
Definition: inc/libofx.h:976
OfxTransactionData::oldunits
double oldunits
Definition: inc/libofx.h:814
OfxTransactionData::avg_cost_basis
double avg_cost_basis
Definition: inc/libofx.h:845
OfxSecurityData::yield_asof_date
time_t yield_asof_date
Definition: inc/libofx.h:481
OfxSecurityData::DebtType
DebtType
Definition: inc/libofx.h:494
OFX_SELLOPT
Definition: inc/libofx.h:660
ofx_set_security_cb
void ofx_set_security_cb(LibofxContextPtr ctx, LibofxProcSecurityCallback cb, void *user_data)
Definition: build/libofx-0.10.0/lib/context.cpp:211
OfxSecurityData::amounts_are_foreign_currency
int amounts_are_foreign_currency
Definition: inc/libofx.h:419
OfxSecurityData::unitprice
double unitprice
Definition: inc/libofx.h:397
OfxTransactionData::accrued_interest
double accrued_interest
Definition: inc/libofx.h:842
OfxTransactionData::markdown
double markdown
Definition: inc/libofx.h:910
OFX_REINVEST
Definition: inc/libofx.h:656
OfxTransactionData::subacct_security_valid
int subacct_security_valid
Definition: inc/libofx.h:1003
OfxPositionData::market_value
double market_value
Definition: inc/libofx.h:1213
OfxSecurityData::yield_to_maturity
double yield_to_maturity
Definition: inc/libofx.h:558
OfxPositionData::currency_ratio
double currency_ratio
Definition: inc/libofx.h:1248
ofx_DEBUG4_msg
int ofx_DEBUG4_msg
Definition: build/libofx-0.10.0/lib/messages.cpp:35
OfxTransactionData::OptAction
OptAction
Definition: inc/libofx.h:920
OfxPositionData::PositionType
PositionType
Definition: inc/libofx.h:1197
LibofxFileFormatInfo::format_name
const char * format_name
Definition: inc/libofx.h:139
OfxStatementData::margin_balance
double margin_balance
Definition: inc/libofx.h:1104
OfxTransactionData::prior_year_contrib
int prior_year_contrib
Definition: inc/libofx.h:940
ofx_ERROR_msg
int ofx_ERROR_msg
Definition: build/libofx-0.10.0/lib/messages.cpp:40
OfxTransactionData::security_data_valid
int security_data_valid
Definition: inc/libofx.h:745
OFC
Definition: inc/libofx.h:130
OfxFiServiceInfo
Information returned by the OFX Partner Server about a financial institution.
Definition: inc/libofx.h:1352
OfxTransactionData::newunits
double newunits
Definition: inc/libofx.h:817
OfxSecurityData
An abstraction of a security, such as a stock, mutual fund, etc.
Definition: inc/libofx.h:358
OfxStatusData::ofx_element_name_valid
int ofx_element_name_valid
Definition: inc/libofx.h:222
OfxSecurityData::OptionType
OptionType
Definition: inc/libofx.h:571
ofx_set_transaction_cb
void ofx_set_transaction_cb(LibofxContextPtr ctx, LibofxProcTransactionCallback cb, void *user_data)
Definition: build/libofx-0.10.0/lib/context.cpp:220
OfxPositionData::OFX_HELDINACCT_MARGIN
Definition: inc/libofx.h:1190
ofx_DEBUG2_msg
int ofx_DEBUG2_msg
Definition: build/libofx-0.10.0/lib/messages.cpp:33
OfxPositionData::account_ptr
struct OfxAccountData * account_ptr
Definition: inc/libofx.h:1167
LibofxProcSecurityCallback
int(* LibofxProcSecurityCallback)(const struct OfxSecurityData data, void *security_data)
The callback function for the OfxSecurityData stucture.
Definition: inc/libofx.h:620
OfxTransactionData::fees
double fees
Definition: inc/libofx.h:811
LibofxProcStatusCallback
int(* LibofxProcStatusCallback)(const struct OfxStatusData data, void *status_data)
The callback function for the OfxStatusData stucture.
Definition: inc/libofx.h:263
ofx_INFO_msg
int ofx_INFO_msg
Definition: build/libofx-0.10.0/lib/messages.cpp:38
OFX_DEBIT
Definition: inc/libofx.h:625
OfxTransactionData
An abstraction of a transaction in an account.
Definition: inc/libofx.h:682
OfxPositionData::HeldInAccountType
HeldInAccountType
Definition: inc/libofx.h:1187
OfxCurrency::must_convert
int must_convert
Definition: inc/libofx.h:1151
OfxTransactionData::date_funds_available
time_t date_funds_available
Definition: inc/libofx.h:762
OfxCurrency
NOT YET SUPPORTED.
Definition: inc/libofx.h:1147
LibofxFileFormat
LibofxFileFormat
Definition: inc/libofx.h:126
OfxAccountData::OFX_CMA
Definition: inc/libofx.h:308
OFX_XFER
Definition: inc/libofx.h:633
OfxTransactionData::date_purchase
time_t date_purchase
Definition: inc/libofx.h:865
ERROR
Definition: build/libofx-0.10.0/lib/messages.hh:34
OfxSecurityData::par_value
double par_value
Definition: inc/libofx.h:490
libofx_proc_file
int libofx_proc_file(LibofxContextPtr libofx_context, const char *p_filename, enum LibofxFileFormat ftype)
libofx_proc_file is the entry point of the library.
Definition: build/libofx-0.10.0/lib/file_preproc.cpp:67
OfxSecurityData::CouponFreq
CouponFreq
Definition: inc/libofx.h:525
OfxStatusData::name
const char * name
Definition: inc/libofx.h:229
OfxSecurityData::AssetClass
AssetClass
Definition: inc/libofx.h:436
OFX_DIV
Definition: inc/libofx.h:627
ofx_DEBUG_msg
int ofx_DEBUG_msg
Definition: build/libofx-0.10.0/lib/messages.cpp:31
OfxTransactionData::OFX_INTEREST
Definition: inc/libofx.h:880
OfxSecurityData::OFX_DEBT_SECURITY
Definition: inc/libofx.h:364
OfxAccountData::OFX_CREDITLINE
Definition: inc/libofx.h:307
OFX_INVEXPENSE
Definition: inc/libofx.h:652
OfxFiServiceInfo::statements
int statements
Definition: inc/libofx.h:1358
OfxAccountData::OFX_INVESTMENT
Definition: inc/libofx.h:310
OfxAccountData::OFX_CHECKING
Definition: inc/libofx.h:304
OfxStatementData::ledger_balance
double ledger_balance
Definition: inc/libofx.h:1080
OfxTransactionData::OFX_CGLONG
Definition: inc/libofx.h:877
OfxTransactionData::Inv401kSource
Inv401kSource
Definition: inc/libofx.h:886
OFX_DIRECTDEP
Definition: inc/libofx.h:637
OfxSecurityData::yield_to_call
double yield_to_call
Definition: inc/libofx.h:540
libofx_free_context
int libofx_free_context(LibofxContextPtr)
Free all ressources used by this context.
Definition: build/libofx-0.10.0/lib/context.cpp:174
OfxStatementData
An abstraction of an account statement.
Definition: inc/libofx.h:1057
OfxTransactionData::SubAcctType
SubAcctType
Definition: inc/libofx.h:994
OfxSecurityData::coupon_rate
double coupon_rate
Definition: inc/libofx.h:517
OfxTransactionData::OFX_DIVIDEND
Definition: inc/libofx.h:879
ofx_DEBUG3_msg
int ofx_DEBUG3_msg
Definition: build/libofx-0.10.0/lib/messages.cpp:34
OfxFiLogin
Information sufficient to log into an financial institution.
Definition: inc/libofx.h:1372