45 int ofx_proc_security_cb(
struct OfxSecurityData data,
void * security_data)
47 char dest_string[255];
48 cout <<
"ofx_proc_security():\n";
49 if (data.unique_id_valid ==
true)
51 cout <<
" Unique ID of the security: " << data.
unique_id <<
"\n";
53 if (data.unique_id_type_valid ==
true)
55 cout <<
" Format of the Unique ID: " << data.
unique_id_type <<
"\n";
57 if (data.unique_id2_valid ==
true)
59 cout <<
" Unique ID of the underlying security: " << data.
unique_id2 <<
"\n";
61 if (data.unique_id2_type_valid ==
true)
63 cout <<
" Format of the underlying Unique ID: " << data.
unique_id2_type <<
"\n";
65 if (data.security_type_valid ==
true)
68 strncpy(dest_string,
"DEBTINFO: Debt security",
sizeof(dest_string));
70 strncpy(dest_string,
"MFINFO: Mutual fund security",
sizeof(dest_string));
72 strncpy(dest_string,
"OPTINFO: Option security",
sizeof(dest_string));
74 strncpy(dest_string,
"STOCKINFO: Stock security",
sizeof(dest_string));
76 strncpy(dest_string,
"OTHERINFO: Other type of security",
sizeof(dest_string));
78 strncpy(dest_string,
"ERROR: unrecognized",
sizeof(dest_string));
79 cout <<
" Security type: " << dest_string <<
"\n";
81 if (data.secname_valid ==
true)
83 cout <<
" Name of the security: " << data.
secname <<
"\n";
85 if (data.ticker_valid ==
true)
87 cout <<
" Ticker symbol: " << data.
ticker <<
"\n";
89 if (data.rating_valid ==
true)
91 cout <<
" Rating of the security: " << data.
rating <<
"\n";
93 if (data.unitprice_valid ==
true)
95 if (data.security_type_valid ==
true 97 cout <<
" Price (percent of par): " << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(4) << data.
unitprice <<
"%\n";
99 cout <<
" Price of each unit of the security: " << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2) << data.
unitprice <<
"\n";
101 if (data.date_unitprice_valid ==
true)
103 strftime(dest_string,
sizeof(dest_string),
"%c %Z", localtime(&(data.
date_unitprice)));
104 cout <<
" Date as of which the unitprice is valid: " << dest_string <<
"\n";
106 if (data.amounts_are_foreign_currency_valid ==
true)
110 if (data.currency_valid ==
true)
112 cout <<
" Currency: " << data.
currency <<
"\n";
114 if (data.currency_ratio_valid ==
true)
116 cout <<
" Ratio of default currency to currency: " << data.
currency_ratio <<
"\n";
118 if (data.memo_valid ==
true)
120 cout <<
" Extra security information (memo): " << data.
memo <<
"\n";
122 if (data.asset_class_valid ==
true)
124 if (data.asset_class == OfxSecurityData::OFX_ASSET_CLASS_DOMESTICBOND)
125 strncpy(dest_string,
"DOMESTICBOND: Domestic bond",
sizeof(dest_string));
126 else if (data.asset_class == OfxSecurityData::OFX_ASSET_CLASS_INTLBOND)
127 strncpy(dest_string,
"INTLBOND: International bond",
sizeof(dest_string));
128 else if (data.asset_class == OfxSecurityData::OFX_ASSET_CLASS_LARGESTOCK)
129 strncpy(dest_string,
"LARGESTOCK: Large cap stock",
sizeof(dest_string));
130 else if (data.asset_class == OfxSecurityData::OFX_ASSET_CLASS_SMALLSTOCK)
131 strncpy(dest_string,
"SMALLSTOCK: Small cap stock",
sizeof(dest_string));
132 else if (data.asset_class == OfxSecurityData::OFX_ASSET_CLASS_INTLSTOCK)
133 strncpy(dest_string,
"INTLSTOCK: International stock",
sizeof(dest_string));
134 else if (data.asset_class == OfxSecurityData::OFX_ASSET_CLASS_MONEYMRKT)
135 strncpy(dest_string,
"MONEYMRKT: Money market",
sizeof(dest_string));
136 else if (data.asset_class == OfxSecurityData::OFX_ASSET_CLASS_OTHER)
137 strncpy(dest_string,
"OTHER: Other",
sizeof(dest_string));
139 strncpy(dest_string,
"ERROR: unrecognized",
sizeof(dest_string));
140 cout <<
" Asset class: " << dest_string <<
"\n";
142 if (data.fiasset_class_valid ==
true)
144 cout <<
" FI defined asset class: " << data.
fiasset_class <<
"\n";
146 if (data.par_value_valid ==
true)
148 cout <<
" Par value: " << data.
par_value <<
"\n";
150 if (data.debt_type_valid ==
true)
152 if (data.debt_type == OfxSecurityData::OFX_DEBT_TYPE_COUPON)
153 strncpy(dest_string,
"COUPON: Coupon debt",
sizeof(dest_string));
154 else if (data.debt_type == OfxSecurityData::OFX_DEBT_TYPE_ZERO)
155 strncpy(dest_string,
"ZERO: Zero coupon debt",
sizeof(dest_string));
157 strncpy(dest_string,
"ERROR: unrecognized",
sizeof(dest_string));
158 cout <<
" Debt type: " << dest_string <<
"\n";
160 if (data.debt_class_valid ==
true)
162 if (data.debt_class == OfxSecurityData::OFX_DEBTCLASS_TREASURY)
163 strncpy(dest_string,
"TREASURY: Treasury debt",
sizeof(dest_string));
164 else if (data.debt_class == OfxSecurityData::OFX_DEBTCLASS_MUNICIPAL)
165 strncpy(dest_string,
"MUNICIPAL: Municipal debt",
sizeof(dest_string));
166 else if (data.debt_class == OfxSecurityData::OFX_DEBTCLASS_CORPORATE)
167 strncpy(dest_string,
"CORPORATE: Corporate debt",
sizeof(dest_string));
168 else if (data.debt_class == OfxSecurityData::OFX_DEBTCLASS_OTHER)
169 strncpy(dest_string,
"OTHER: Other debt class",
sizeof(dest_string));
171 strncpy(dest_string,
"ERROR: unrecognized",
sizeof(dest_string));
172 cout <<
" Debt class: " << dest_string <<
"\n";
174 if (data.coupon_rate_valid ==
true)
176 cout <<
" Coupon rate: " << data.
coupon_rate <<
"%\n";
178 if (data.date_coupon_valid ==
true)
180 strftime(dest_string,
sizeof(dest_string),
"%c %Z", localtime(&(data.
date_coupon)));
181 cout <<
" Date for the next coupon: " << dest_string <<
"\n";
183 if (data.coupon_freq_valid ==
true)
185 if (data.coupon_freq == OfxSecurityData::OFX_COUPON_FREQ_MONTHLY)
186 strncpy(dest_string,
"MONTHLY: Monthly coupon",
sizeof(dest_string));
187 else if (data.coupon_freq == OfxSecurityData::OFX_COUPON_FREQ_QUARTERLY)
188 strncpy(dest_string,
"QUARTERLY: Quarterly coupon",
sizeof(dest_string));
189 else if (data.coupon_freq == OfxSecurityData::OFX_COUPON_FREQ_SEMIANNUAL)
190 strncpy(dest_string,
"SEMIANNUAL: Semiannual coupon",
sizeof(dest_string));
191 else if (data.coupon_freq == OfxSecurityData::OFX_COUPON_FREQ_ANNUAL)
192 strncpy(dest_string,
"ANNUAL: Annual coupon",
sizeof(dest_string));
193 else if (data.coupon_freq == OfxSecurityData::OFX_COUPON_FREQ_OTHER)
194 strncpy(dest_string,
"OTHER: Other frequency",
sizeof(dest_string));
196 strncpy(dest_string,
"ERROR: unrecognized",
sizeof(dest_string));
197 cout <<
" Coupon frequency: " << dest_string <<
"\n";
199 if (data.call_price_valid ==
true)
201 cout <<
" Call price (unit price): " << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2) << data.
call_price <<
"\n";
203 if (data.yield_to_call_valid ==
true)
205 cout <<
" Yield to next call (rate): " << data.
yield_to_call <<
"%\n";
207 if (data.call_date_valid ==
true)
209 strftime(dest_string,
sizeof(dest_string),
"%c %Z", localtime(&(data.
call_date)));
210 cout <<
" Date for the next call: " << dest_string <<
"\n";
212 if (data.call_type_valid ==
true)
214 if (data.call_type == OfxSecurityData::OFX_CALL_TYPE_CALL)
215 strncpy(dest_string,
"CALL: Call",
sizeof(dest_string));
216 else if (data.call_type == OfxSecurityData::OFX_CALL_TYPE_PUT)
217 strncpy(dest_string,
"PUT: Put",
sizeof(dest_string));
218 else if (data.call_type == OfxSecurityData::OFX_CALL_TYPE_PREFUND)
219 strncpy(dest_string,
"PREFUND: Prefund",
sizeof(dest_string));
220 else if (data.call_type == OfxSecurityData::OFX_CALL_TYPE_MATURITY)
221 strncpy(dest_string,
"MATURITY: Maturity",
sizeof(dest_string));
223 strncpy(dest_string,
"ERROR: unrecognized",
sizeof(dest_string));
224 cout <<
" Call type: " << dest_string <<
"\n";
226 if (data.yield_to_maturity_valid ==
true)
230 if (data.maturity_date_valid ==
true)
232 strftime(dest_string,
sizeof(dest_string),
"%c %Z", localtime(&(data.
maturity_date)));
233 cout <<
" Maturity date: " << dest_string <<
"\n";
235 if (data.mutual_fund_type_valid ==
true)
237 if (data.mutual_fund_type == OfxSecurityData::OFX_MFTYPE_OPENEND)
238 strncpy(dest_string,
"OPENEND: Open ended",
sizeof(dest_string));
239 else if (data.mutual_fund_type == OfxSecurityData::OFX_MFTYPE_CLOSEEND)
240 strncpy(dest_string,
"CLOSEEND: Closed ended",
sizeof(dest_string));
241 else if (data.mutual_fund_type == OfxSecurityData::OFX_MFTYPE_OTHER)
242 strncpy(dest_string,
"OTHER: Other type",
sizeof(dest_string));
244 strncpy(dest_string,
"ERROR: unrecognized",
sizeof(dest_string));
245 cout <<
" Mutual fund type: " << dest_string <<
"\n";
246 if (data.stock_type_valid ==
true)
248 if (data.stock_type == OfxSecurityData::OFX_STOCKTYPE_COMMON)
249 strncpy(dest_string,
"COMMON: Common stock",
sizeof(dest_string));
250 else if (data.stock_type == OfxSecurityData::OFX_STOCKTYPE_PREFERRED)
251 strncpy(dest_string,
"PREFERRED: Preferred stock",
sizeof(dest_string));
252 else if (data.stock_type == OfxSecurityData::OFX_STOCKTYPE_CONVERTIBLE)
253 strncpy(dest_string,
"CONVERTIBLE: Convertable stock",
sizeof(dest_string));
254 else if (data.stock_type == OfxSecurityData::OFX_STOCKTYPE_OTHER)
255 strncpy(dest_string,
"OTHER: Other type",
sizeof(dest_string));
257 strncpy(dest_string,
"ERROR: unrecognized",
sizeof(dest_string));
258 cout <<
" Stock type: " << dest_string <<
"\n";
261 if (data.yield_valid ==
true)
263 cout <<
" Current yield (rate): " << data.
yield <<
"%\n";
265 if (data.yield_asof_date_valid ==
true)
267 strftime(dest_string,
sizeof(dest_string),
"%c %Z", localtime(&(data.
yield_asof_date)));
268 cout <<
" Date for which current yield is valid: " << dest_string <<
"\n";
270 if (data.option_type_valid ==
true)
272 if (data.option_type == OfxSecurityData::OFX_OPTION_TYPE_CALL)
273 strncpy(dest_string,
"CALL: Call option",
sizeof(dest_string));
274 else if (data.option_type == OfxSecurityData::OFX_OPTION_TYPE_PUT)
275 strncpy(dest_string,
"PUT: Put option",
sizeof(dest_string));
277 strncpy(dest_string,
"ERROR: unrecognized",
sizeof(dest_string));
278 cout <<
" Option type: " << dest_string <<
"\n";
280 if (data.strike_price_valid ==
true)
284 if (data.date_expire_valid ==
true)
286 strftime(dest_string,
sizeof(dest_string),
"%c %Z", localtime(&(data.
date_expire)));
287 cout <<
" Expiration date: " << dest_string <<
"\n";
289 if (data.shares_per_cont_valid ==
true)
299 char dest_string[255];
300 cout <<
"ofx_proc_transaction():\n";
302 if (data.account_id_valid ==
true)
304 cout <<
" Account ID : " << data.
account_id <<
"\n";
310 strncpy(dest_string,
"CREDIT: Generic credit",
sizeof(dest_string));
311 else if (data.transactiontype ==
OFX_DEBIT)
312 strncpy(dest_string,
"DEBIT: Generic debit",
sizeof(dest_string));
313 else if (data.transactiontype ==
OFX_INT)
314 strncpy(dest_string,
"INT: Interest earned or paid (Note: Depends on signage of amount)",
sizeof(dest_string));
315 else if (data.transactiontype ==
OFX_DIV)
316 strncpy(dest_string,
"DIV: Dividend",
sizeof(dest_string));
317 else if (data.transactiontype ==
OFX_FEE)
318 strncpy(dest_string,
"FEE: FI fee",
sizeof(dest_string));
320 strncpy(dest_string,
"SRVCHG: Service charge",
sizeof(dest_string));
321 else if (data.transactiontype ==
OFX_DEP)
322 strncpy(dest_string,
"DEP: Deposit",
sizeof(dest_string));
323 else if (data.transactiontype ==
OFX_ATM)
324 strncpy(dest_string,
"ATM: ATM debit or credit (Note: Depends on signage of amount)",
sizeof(dest_string));
325 else if (data.transactiontype ==
OFX_POS)
326 strncpy(dest_string,
"POS: Point of sale debit or credit (Note: Depends on signage of amount)",
sizeof(dest_string));
327 else if (data.transactiontype ==
OFX_XFER)
328 strncpy(dest_string,
"XFER: Transfer",
sizeof(dest_string));
329 else if (data.transactiontype ==
OFX_CHECK)
330 strncpy(dest_string,
"CHECK: Check",
sizeof(dest_string));
332 strncpy(dest_string,
"PAYMENT: Electronic payment",
sizeof(dest_string));
333 else if (data.transactiontype ==
OFX_CASH)
334 strncpy(dest_string,
"CASH: Cash withdrawal",
sizeof(dest_string));
336 strncpy(dest_string,
"DIRECTDEP: Direct deposit",
sizeof(dest_string));
338 strncpy(dest_string,
"DIRECTDEBIT: Merchant initiated debit",
sizeof(dest_string));
340 strncpy(dest_string,
"REPEATPMT: Repeating payment/standing order",
sizeof(dest_string));
341 else if (data.transactiontype ==
OFX_OTHER)
342 strncpy(dest_string,
"OTHER: Other",
sizeof(dest_string));
344 strncpy(dest_string,
"Unknown transaction type",
sizeof(dest_string));
345 cout <<
" Transaction type: " << dest_string <<
"\n";
349 if (data.date_initiated_valid ==
true)
351 strftime(dest_string,
sizeof(dest_string),
"%c %Z", localtime(&(data.
date_initiated)));
352 cout <<
" Date initiated: " << dest_string <<
"\n";
354 if (data.date_posted_valid ==
true)
356 strftime(dest_string,
sizeof(dest_string),
"%c %Z", localtime(&(data.
date_posted)));
357 cout <<
" Date posted: " << dest_string <<
"\n";
359 if (data.date_funds_available_valid ==
true)
362 cout <<
" Date funds are available: " << dest_string <<
"\n";
364 if (data.amount_valid ==
true)
366 cout <<
" Total money amount: " << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2) << data.
amount <<
"\n";
368 if (data.units_valid ==
true)
370 if (data.invtransactiontype_valid)
372 cout <<
" # of units: " << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(4) << data.
units;
373 strncpy(dest_string,
" (bonds: face value; options: contracts; all others: shares)",
sizeof(dest_string));
376 if (data.security_data_ptr->security_type_valid ==
true)
379 strncpy(dest_string,
" (face value)",
sizeof(dest_string));
383 strncpy(dest_string,
" (shares)",
sizeof(dest_string));
385 strncpy(dest_string,
" (contracts)",
sizeof(dest_string));
391 cout <<
" # of units: " << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2) << data.
units;
394 if (data.oldunits_valid ==
true)
396 if (data.invtransactiontype_valid)
397 cout <<
" # of units before split: " << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(4) << data.
oldunits <<
"\n";
399 cout <<
" # of units before split: " << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2) << data.
oldunits <<
"\n";
401 if (data.newunits_valid ==
true)
403 cout <<
" # of units after split: " << setprecision(4) << data.
newunits <<
"\n";
405 if (data.unitprice_valid ==
true)
407 if (data.invtransactiontype_valid)
409 cout <<
" Unit price: " << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(4) << data.
unitprice;
410 strncpy(dest_string,
" (bonds: % of par; options: premium per share of underlying; all others: price per share)\n",
sizeof(dest_string));
413 if (data.security_data_ptr->security_type_valid ==
true)
417 strncpy(dest_string,
"% (% of par)\n",
sizeof(dest_string));
422 strncpy(dest_string,
" (price per share)\n",
sizeof(dest_string));
424 strncpy(dest_string,
" (premium per share of underlying)\n",
sizeof(dest_string));
430 cout <<
" Unit price: " << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2) << data.
unitprice <<
"\n";
432 if (data.fees_valid ==
true)
434 cout <<
" Fees: " << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2) << data.
fees <<
"\n";
436 if (data.commission_valid ==
true)
438 cout <<
" Commission: " << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2) << data.
commission <<
"\n";
440 if (data.amounts_are_foreign_currency_valid ==
true)
444 if (data.currency_valid ==
true)
446 cout <<
" Currency: " << data.
currency <<
"\n";
448 if (data.currency_ratio_valid ==
true)
450 cout <<
" Ratio of default currency to currency: " << data.
currency_ratio <<
"\n";
452 if (data.fi_id_valid ==
true)
454 cout <<
" Financial institution's ID for this transaction: " << data.
fi_id <<
"\n";
456 if (data.fi_id_corrected_valid ==
true)
458 cout <<
" Financial institution ID replaced or corrected by this transaction: " << data.
fi_id_corrected <<
"\n";
460 if (data.fi_id_correction_action_valid ==
true)
462 cout <<
" Action to take on the corrected transaction: ";
468 cout <<
"ofx_proc_transaction(): This should not happen!\n";
470 if (data.invtransactiontype_valid ==
true)
472 cout <<
" Investment transaction type: ";
474 strncpy(dest_string,
"BUYDEBT (Buy debt security)",
sizeof(dest_string));
475 else if (data.invtransactiontype ==
OFX_BUYMF)
476 strncpy(dest_string,
"BUYMF (Buy mutual fund)",
sizeof(dest_string));
477 else if (data.invtransactiontype ==
OFX_BUYOPT)
478 strncpy(dest_string,
"BUYOPT (Buy option)",
sizeof(dest_string));
480 strncpy(dest_string,
"BUYOTHER (Buy other security type)",
sizeof(dest_string));
482 strncpy(dest_string,
"BUYSTOCK (Buy stock)",
sizeof(dest_string));
484 strncpy(dest_string,
"CLOSUREOPT (Close a position for an option)",
sizeof(dest_string));
485 else if (data.invtransactiontype ==
OFX_INCOME)
486 strncpy(dest_string,
"INCOME (Investment income is realized as cash into the investment account)",
sizeof(dest_string));
488 strncpy(dest_string,
"INVEXPENSE (Misc investment expense that is associated with a specific security)",
sizeof(dest_string));
490 strncpy(dest_string,
"JRNLFUND (Journaling cash holdings between subaccounts within the same investment account)",
sizeof(dest_string));
492 strncpy(dest_string,
"MARGININTEREST (Margin interest expense)",
sizeof(dest_string));
494 strncpy(dest_string,
"REINVEST (Reinvestment of income)",
sizeof(dest_string));
496 strncpy(dest_string,
"RETOFCAP (Return of capital)",
sizeof(dest_string));
498 strncpy(dest_string,
"SELLDEBT (Sell debt security. Used when debt is sold, called, or reached maturity)",
sizeof(dest_string));
499 else if (data.invtransactiontype ==
OFX_SELLMF)
500 strncpy(dest_string,
"SELLMF (Sell mutual fund)",
sizeof(dest_string));
502 strncpy(dest_string,
"SELLOPT (Sell option)",
sizeof(dest_string));
504 strncpy(dest_string,
"SELLOTHER (Sell other type of security)",
sizeof(dest_string));
506 strncpy(dest_string,
"SELLSTOCK (Sell stock)",
sizeof(dest_string));
507 else if (data.invtransactiontype ==
OFX_SPLIT)
508 strncpy(dest_string,
"SPLIT (Stock or mutial fund split)",
sizeof(dest_string));
510 strncpy(dest_string,
"TRANSFER (Transfer holdings in and out of the investment account)",
sizeof(dest_string));
512 strncpy(dest_string,
"INVBANKTRAN (Transfer cash in and out of the investment account)",
sizeof(dest_string));
514 strncpy(dest_string,
"ERROR, this investment transaction type is unknown. This is a bug in ofxdump",
sizeof(dest_string));
516 cout << dest_string <<
"\n";
518 if (data.unique_id_valid ==
true)
520 cout <<
" Unique ID of the security being traded: " << data.
unique_id <<
"\n";
522 if (data.unique_id_type_valid ==
true)
524 cout <<
" Format of the Unique ID: " << data.
unique_id_type <<
"\n";
526 if (data.server_transaction_id_valid ==
true)
530 if (data.check_number_valid ==
true)
534 if (data.reference_number_valid ==
true)
538 if (data.standard_industrial_code_valid ==
true)
542 if (data.payee_id_valid ==
true)
544 cout <<
" Payee_id: " << data.
payee_id <<
"\n";
546 if (data.name_valid ==
true)
548 cout <<
" Name of payee or transaction description: " << data.
name <<
"\n";
550 if (data.memo_valid ==
true)
552 cout <<
" Extra transaction information (memo): " << data.
memo <<
"\n";
554 if (data.accrued_interest_valid ==
true)
556 cout <<
" Accrued Interest: " << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2) << data.
accrued_interest <<
"\n";
558 if (data.avg_cost_basis_valid ==
true)
560 cout <<
" Average cost basis: " << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2) << data.
avg_cost_basis <<
"\n";
562 if (data.buy_type_valid ==
true)
564 if (data.buy_type == OfxTransactionData::OFX_BUY_TYPE_BUY)
565 strncpy(dest_string,
"BUY: Buy",
sizeof(dest_string));
566 else if (data.buy_type == OfxTransactionData::OFX_BUY_TYPE_BUYTOCOVER)
567 strncpy(dest_string,
"BUYTOCOVER: Buy to cover",
sizeof(dest_string));
568 else if (data.buy_type == OfxTransactionData::OFX_BUY_TYPE_BUYTOOPEN)
569 strncpy(dest_string,
"BUYTOOPEN: Buy to open",
sizeof(dest_string));
570 else if (data.buy_type == OfxTransactionData::OFX_BUY_TYPE_BUYTOCLOSE)
571 strncpy(dest_string,
"BUYTOCLOSE: Buy to close",
sizeof(dest_string));
573 strncpy(dest_string,
"ERROR: unrecognized",
sizeof(dest_string));
574 cout <<
" Buy type: " << dest_string <<
"\n";
576 if (data.denominator_valid ==
true)
578 cout <<
" Stock split ratio denominator: " << data.
denominator <<
"\n";
580 if (data.date_payroll_valid ==
true)
582 strftime(dest_string,
sizeof(dest_string),
"%c %Z", localtime(&(data.
date_payroll)));
583 cout <<
" Date 401(k) funds were deducted from payroll: " << dest_string <<
"\n";
585 if (data.date_purchase_valid ==
true)
587 strftime(dest_string,
sizeof(dest_string),
"%c %Z", localtime(&(data.
date_purchase)));
588 cout <<
" Original purchase date of the security: " << dest_string <<
"\n";
590 if (data.gain_valid ==
true)
592 cout <<
" Average cost basis: " << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2) << data.
gain <<
"\n";
594 if (data.cash_for_fractional_valid ==
true)
596 cout <<
" Average cost basis: " << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2) << data.
cash_for_fractional <<
"\n";
598 if (data.income_type_valid ==
true)
601 strncpy(dest_string,
"CGLONG: Long term capital gains",
sizeof(dest_string));
603 strncpy(dest_string,
"CGSHORT: Short term capital gains",
sizeof(dest_string));
605 strncpy(dest_string,
"DIVIDEND",
sizeof(dest_string));
607 strncpy(dest_string,
"INTEREST",
sizeof(dest_string));
609 strncpy(dest_string,
"MISC: Miscellaneous",
sizeof(dest_string));
611 strncpy(dest_string,
"ERROR: unrecognized",
sizeof(dest_string));
612 cout <<
" Income type: " << dest_string <<
"\n";
614 if (data.inv_401k_source_valid ==
true)
616 if (data.inv_401k_source == OfxTransactionData::OFX_401K_SOURCE_PRETAX)
617 strncpy(dest_string,
"PRETAX",
sizeof(dest_string));
618 else if (data.inv_401k_source == OfxTransactionData::OFX_401K_SOURCE_AFTERTAX)
619 strncpy(dest_string,
"AFTERTAX",
sizeof(dest_string));
620 else if (data.inv_401k_source == OfxTransactionData::OFX_401K_SOURCE_MATCH)
621 strncpy(dest_string,
"MATCH",
sizeof(dest_string));
622 else if (data.inv_401k_source == OfxTransactionData::OFX_401K_SOURCE_PROFITSHARING)
623 strncpy(dest_string,
"PROFITSHARING",
sizeof(dest_string));
624 else if (data.inv_401k_source == OfxTransactionData::OFX_401K_SOURCE_ROLLOVER)
625 strncpy(dest_string,
"ROLLOVER",
sizeof(dest_string));
626 else if (data.inv_401k_source == OfxTransactionData::OFX_401K_SOURCE_OTHERVEST)
627 strncpy(dest_string,
"OTHERVEST",
sizeof(dest_string));
628 else if (data.inv_401k_source == OfxTransactionData::OFX_401K_SOURCE_OTHERNONVEST)
629 strncpy(dest_string,
"OTHERNONVEST",
sizeof(dest_string));
631 strncpy(dest_string,
"ERROR: unrecognized",
sizeof(dest_string));
632 cout <<
" Source of 401(k) money: " << dest_string <<
"\n";
634 if (data.load_valid ==
true)
636 cout <<
" Load (amount): " << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2) << data.
load <<
"\n";
638 if (data.loan_id_valid ==
true)
640 cout <<
" 401(k) loan id: " << data.
loan_id <<
"\n";
642 if (data.loan_interest_valid ==
true)
644 cout <<
" 401(k) loan interest (amount): " << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2) << data.
loan_interest <<
"\n";
646 if (data.loan_principal_valid ==
true)
648 cout <<
" 401(k) loan principle (amount): " << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2) << data.
loan_principal <<
"\n";
650 if (data.markdown_valid ==
true)
652 cout <<
" Markdown (unitprice): " << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2) << data.
markdown <<
"\n";
654 if (data.markup_valid ==
true)
656 cout <<
" Markup (unitprice): " << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2) << data.
markup <<
"\n";
658 if (data.numerator_valid ==
true)
660 cout <<
" Stock split ratio numerator: " << data.
numerator <<
"\n";
662 if (data.opt_action_valid ==
true)
664 if (data.opt_action == OfxTransactionData::OFX_OPTACTION_EXERCISE)
665 strncpy(dest_string,
"EXERCISE",
sizeof(dest_string));
666 else if (data.opt_action == OfxTransactionData::OFX_OPTACTION_ASSIGN)
667 strncpy(dest_string,
"ASSIGN",
sizeof(dest_string));
668 else if (data.opt_action == OfxTransactionData::OFX_OPTACTION_EXPIRE)
669 strncpy(dest_string,
"EXPIRE",
sizeof(dest_string));
671 strncpy(dest_string,
"ERROR: unrecognized",
sizeof(dest_string));
672 cout <<
" Option action: " << dest_string <<
"\n";
674 if (data.penalty_valid ==
true)
676 cout <<
" Penalty withheld (amount): " << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2) << data.
penalty <<
"\n";
678 if (data.pos_type_valid ==
true)
680 if (data.pos_type == OfxTransactionData::OFX_POSTYPE_LONG)
681 strncpy(dest_string,
"LONG",
sizeof(dest_string));
682 else if (data.pos_type == OfxTransactionData::OFX_POSTYPE_SHORT)
683 strncpy(dest_string,
"SHORT",
sizeof(dest_string));
685 strncpy(dest_string,
"ERROR: unrecognized",
sizeof(dest_string));
686 cout <<
" Position Type: " << dest_string <<
"\n";
688 if (data.prior_year_contrib_valid ==
true)
690 cout <<
" Prior year 401(k) contribution: " << (data.
prior_year_contrib ?
"Yes" :
"No") <<
"\n";
692 if (data.related_fi_tid_valid ==
true)
694 cout <<
" Related transaction TID: " << data.
related_fi_tid <<
"\n";
696 if (data.related_type_valid ==
true)
698 if (data.related_type == OfxTransactionData::OFX_RELTYPE_SPREAD)
699 strncpy(dest_string,
"SPREAD",
sizeof(dest_string));
700 else if (data.related_type == OfxTransactionData::OFX_RELTYPE_STRADDLE)
701 strncpy(dest_string,
"STRADDLE",
sizeof(dest_string));
702 else if (data.related_type == OfxTransactionData::OFX_RELTYPE_NONE)
703 strncpy(dest_string,
"NONE",
sizeof(dest_string));
704 else if (data.related_type == OfxTransactionData::OFX_RELTYPE_OTHER)
705 strncpy(dest_string,
"OTHER",
sizeof(dest_string));
707 strncpy(dest_string,
"ERROR: unrecognized",
sizeof(dest_string));
708 cout <<
" Related Option Type: " << dest_string <<
"\n";
710 if (data.option_secured_valid ==
true)
712 if (data.option_secured == OfxTransactionData::OFX_SECURED_NAKED)
713 strncpy(dest_string,
"NAKED",
sizeof(dest_string));
714 else if (data.option_secured == OfxTransactionData::OFX_SECURED_COVERED)
715 strncpy(dest_string,
"COVERED: Cash covered",
sizeof(dest_string));
717 strncpy(dest_string,
"ERROR: unrecognized",
sizeof(dest_string));
718 cout <<
" How is the option secured: " << dest_string <<
"\n";
720 if (data.sell_reason_valid ==
true)
723 strncpy(dest_string,
"CALL: the debt was called",
sizeof(dest_string));
725 strncpy(dest_string,
"SELL: the debt was sold",
sizeof(dest_string));
727 strncpy(dest_string,
"MATURITY: the debt reached maturity",
sizeof(dest_string));
729 strncpy(dest_string,
"ERROR: unrecognized",
sizeof(dest_string));
730 cout <<
" Reason for the debt sell: " << dest_string <<
"\n";
732 if (data.sell_type_valid ==
true)
734 if (data.sell_type == OfxTransactionData::OFX_SELL_TYPE_SELL)
735 strncpy(dest_string,
"SELL: Sell",
sizeof(dest_string));
736 else if (data.sell_type == OfxTransactionData::OFX_SELL_TYPE_SELLSHORT)
737 strncpy(dest_string,
"SELLSHORT: Sell short",
sizeof(dest_string));
738 else if (data.sell_type == OfxTransactionData::OFX_SELL_TYPE_SELLTOOPEN)
739 strncpy(dest_string,
"SELLTOOPEN: Sell to open",
sizeof(dest_string));
740 else if (data.sell_type == OfxTransactionData::OFX_SELL_TYPE_SELLTOCLOSE)
741 strncpy(dest_string,
"SELLTOCLOSE: Sell to close",
sizeof(dest_string));
743 strncpy(dest_string,
"ERROR: unrecognized",
sizeof(dest_string));
744 cout <<
" Sell type: " << dest_string <<
"\n";
746 if (data.shares_per_cont_valid ==
true)
748 cout <<
" Shares per option contract: " << data.
shares_per_cont <<
"\n";
750 if (data.state_withholding_valid ==
true)
752 cout <<
" State taxes withheld: " << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2) << data.
state_withholding <<
"\n";
756 if (data.subacct_from == OfxTransactionData::OFX_SUBACCT_CASH)
757 strncpy(dest_string,
"CASH",
sizeof(dest_string));
758 else if (data.subacct_from == OfxTransactionData::OFX_SUBACCT_MARGIN)
759 strncpy(dest_string,
"MARGIN",
sizeof(dest_string));
760 else if (data.subacct_from == OfxTransactionData::OFX_SUBACCT_SHORT)
761 strncpy(dest_string,
"SHORT",
sizeof(dest_string));
762 else if (data.subacct_from == OfxTransactionData::OFX_SUBACCT_OTHER)
763 strncpy(dest_string,
"OTHER",
sizeof(dest_string));
765 strncpy(dest_string,
"ERROR: unrecognized",
sizeof(dest_string));
766 cout <<
" From sub account type: " << dest_string <<
"\n";
770 if (data.subacct_funding == OfxTransactionData::OFX_SUBACCT_CASH)
771 strncpy(dest_string,
"CASH",
sizeof(dest_string));
772 else if (data.subacct_funding == OfxTransactionData::OFX_SUBACCT_MARGIN)
773 strncpy(dest_string,
"MARGIN",
sizeof(dest_string));
774 else if (data.subacct_funding == OfxTransactionData::OFX_SUBACCT_SHORT)
775 strncpy(dest_string,
"SHORT",
sizeof(dest_string));
776 else if (data.subacct_funding == OfxTransactionData::OFX_SUBACCT_OTHER)
777 strncpy(dest_string,
"OTHER",
sizeof(dest_string));
779 strncpy(dest_string,
"ERROR: unrecognized",
sizeof(dest_string));
780 cout <<
" Funding sub account type: " << dest_string <<
"\n";
784 if (data.subacct_security == OfxTransactionData::OFX_SUBACCT_CASH)
785 strncpy(dest_string,
"CASH",
sizeof(dest_string));
786 else if (data.subacct_security == OfxTransactionData::OFX_SUBACCT_MARGIN)
787 strncpy(dest_string,
"MARGIN",
sizeof(dest_string));
788 else if (data.subacct_security == OfxTransactionData::OFX_SUBACCT_SHORT)
789 strncpy(dest_string,
"SHORT",
sizeof(dest_string));
790 else if (data.subacct_security == OfxTransactionData::OFX_SUBACCT_OTHER)
791 strncpy(dest_string,
"OTHER",
sizeof(dest_string));
793 strncpy(dest_string,
"ERROR: unrecognized",
sizeof(dest_string));
794 cout <<
" Security sub account type: " << dest_string <<
"\n";
798 if (data.subacct_to == OfxTransactionData::OFX_SUBACCT_CASH)
799 strncpy(dest_string,
"CASH",
sizeof(dest_string));
800 else if (data.subacct_to == OfxTransactionData::OFX_SUBACCT_MARGIN)
801 strncpy(dest_string,
"MARGIN",
sizeof(dest_string));
802 else if (data.subacct_to == OfxTransactionData::OFX_SUBACCT_SHORT)
803 strncpy(dest_string,
"SHORT",
sizeof(dest_string));
804 else if (data.subacct_to == OfxTransactionData::OFX_SUBACCT_OTHER)
805 strncpy(dest_string,
"OTHER",
sizeof(dest_string));
807 strncpy(dest_string,
"ERROR: unrecognized",
sizeof(dest_string));
808 cout <<
" To sub account type: " << dest_string <<
"\n";
810 if (data.taxes_valid ==
true)
812 cout <<
" Tax on the trade (amount): " << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2) << data.
taxes <<
"\n";
814 if (data.tax_exempt_valid ==
true)
816 cout <<
" Tax exempt: " << (data.
tax_exempt ?
"Yes" :
"No") <<
"\n";
818 if (data.transfer_action_valid ==
true)
820 if (data.transfer_action == OfxTransactionData::OFX_TFERACTION_IN)
821 strncpy(dest_string,
"IN",
sizeof(dest_string));
822 else if (data.transfer_action == OfxTransactionData::OFX_TFERACTION_OUT)
823 strncpy(dest_string,
"OUT",
sizeof(dest_string));
825 strncpy(dest_string,
"ERROR: unrecognized",
sizeof(dest_string));
826 cout <<
" Action for the transfer: " << dest_string <<
"\n";
828 if (data.unit_type_valid ==
true)
830 if (data.unit_type == OfxTransactionData::OFX_UNITTYPE_SHARES)
831 strncpy(dest_string,
"SHARES",
sizeof(dest_string));
832 else if (data.unit_type == OfxTransactionData::OFX_UNITTYPE_CURRENCY)
833 strncpy(dest_string,
"CURRENCY",
sizeof(dest_string));
835 strncpy(dest_string,
"ERROR: unrecognized",
sizeof(dest_string));
836 cout <<
" Type of the Units value: " << dest_string <<
"\n";
838 if (data.withholding_valid ==
true)
840 cout <<
" Federal tax withheld (amount): " << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2) << data.
withholding <<
"\n";
844 ofx_proc_security_cb(*(data.security_data_ptr), NULL );
850 int ofx_proc_position_cb(
struct OfxPositionData data,
void * position_data)
852 char dest_string[255];
853 cout <<
"ofx_proc_position():\n";
854 if (data.account_id_valid ==
true)
856 cout <<
" Account ID: " << data.
account_id <<
"\n";
858 if (data.unique_id_valid ==
true)
860 cout <<
" Unique ID of the security: " << data.
unique_id <<
"\n";
862 if (data.unique_id_type_valid ==
true)
864 cout <<
" Format of the Unique ID: " << data.
unique_id_type <<
"\n";
866 if (data.heldinaccount_type_valid ==
true)
869 strncpy(dest_string,
"CASH: Cash subaccount",
sizeof(dest_string));
871 strncpy(dest_string,
"MARGIN: Margin subaccount",
sizeof(dest_string));
873 strncpy(dest_string,
"SHORT: Short subaccount",
sizeof(dest_string));
875 strncpy(dest_string,
"OTHER: Other subaccount",
sizeof(dest_string));
877 strncpy(dest_string,
"ERROR: unrecognized",
sizeof(dest_string));
878 cout <<
" Held in account type: " << dest_string <<
"\n";
880 if (data.position_type_valid ==
true)
882 if (data.position_type == OfxPositionData::OFX_POSITION_SHORT)
883 strncpy(dest_string,
"SHORT: Short (writer for options, short for all others)",
sizeof(dest_string));
884 else if (data.position_type == OfxPositionData::OFX_POSITION_LONG)
885 strncpy(dest_string,
"LONG: Long (holder for options, long for all others)",
sizeof(dest_string));
887 strncpy(dest_string,
"ERROR: unrecognized",
sizeof(dest_string));
888 cout <<
" Position type: " << dest_string <<
"\n";
890 if (data.units_valid ==
true)
892 cout <<
" Units: " << setprecision(4) << data.
units;
893 strncpy(dest_string,
" (bonds: face value; options: contracts; all others: shares)\n",
sizeof(dest_string));
894 if (data.security_data_valid ==
true)
899 strncpy(dest_string,
" (face value)\n",
sizeof(dest_string));
903 strncpy(dest_string,
" (shares)\n",
sizeof(dest_string));
905 strncpy(dest_string,
" (contracts)\n",
sizeof(dest_string));
910 if (data.unit_price_valid ==
true)
912 if (data.security_data_valid ==
true)
914 cout <<
" Unit price: " << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(4) << data.
unit_price;
915 strncpy(dest_string,
" (bonds: % of par; options: premium per share of underlying; all others: price per share)\n",
sizeof(dest_string));
919 strncpy(dest_string,
"% (% of par)\n",
sizeof(dest_string));
923 strncpy(dest_string,
" (price per share)\n",
sizeof(dest_string));
925 strncpy(dest_string,
" (premium per share of underlying)\n",
sizeof(dest_string));
930 cout <<
" Unit price: " << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2) << data.
unit_price <<
"\n";
932 if (data.market_value_valid ==
true)
936 if (data.amounts_are_foreign_currency_valid ==
true)
940 if (data.currency_valid ==
true)
942 cout <<
" Currency: " << data.
currency <<
"\n";
944 if (data.currency_ratio_valid ==
true)
946 cout <<
" Ratio of default currency to currency: " << data.
currency_ratio <<
"\n";
948 if (data.date_unit_price_valid ==
true)
950 strftime(dest_string,
sizeof(dest_string),
"%c %Z", localtime(&(data.
date_unit_price)));
951 cout <<
" Date of unit price: " << dest_string <<
"\n";
953 if (data.memo_valid ==
true)
955 cout <<
" Extra position information (memo): " << data.
memo <<
"\n";
957 if (data.inv_401k_source_valid ==
true)
959 if (data.inv_401k_source == OfxPositionData::OFX_401K_POSN_SOURCE_PRETAX)
960 strncpy(dest_string,
"PRETAX",
sizeof(dest_string));
961 else if (data.inv_401k_source == OfxPositionData::OFX_401K_POSN_SOURCE_AFTERTAX)
962 strncpy(dest_string,
"AFTERTAX",
sizeof(dest_string));
963 else if (data.inv_401k_source == OfxPositionData::OFX_401K_POSN_SOURCE_MATCH)
964 strncpy(dest_string,
"MATCH",
sizeof(dest_string));
965 else if (data.inv_401k_source == OfxPositionData::OFX_401K_POSN_SOURCE_PROFITSHARING)
966 strncpy(dest_string,
"PROFITSHARING",
sizeof(dest_string));
967 else if (data.inv_401k_source == OfxPositionData::OFX_401K_POSN_SOURCE_ROLLOVER)
968 strncpy(dest_string,
"ROLLOVER",
sizeof(dest_string));
969 else if (data.inv_401k_source == OfxPositionData::OFX_401K_POSN_SOURCE_OTHERVEST)
970 strncpy(dest_string,
"OTHERVEST",
sizeof(dest_string));
971 else if (data.inv_401k_source == OfxPositionData::OFX_401K_POSN_SOURCE_OTHERNONVEST)
972 strncpy(dest_string,
"OTHERNONVEST",
sizeof(dest_string));
974 strncpy(dest_string,
"ERROR: unrecognized",
sizeof(dest_string));
975 cout <<
" Source of 401(k) money: " << dest_string <<
"\n";
977 if (data.security_data_valid ==
true)
985 int ofx_proc_statement_cb(
struct OfxStatementData data,
void * statement_data)
987 char dest_string[255];
988 cout <<
"ofx_proc_statement():\n";
989 if (data.currency_valid ==
true)
991 cout <<
" Default Currency: " << data.
currency <<
"\n";
993 if (data.account_id_valid ==
true)
995 cout <<
" Account ID: " << data.
account_id <<
"\n";
997 if (data.date_asof_valid ==
true)
999 strftime(dest_string,
sizeof(dest_string),
"%c %Z", localtime(&(data.
date_asof)));
1000 cout <<
" Statement as-of date: " << dest_string <<
"\n";
1002 if (data.date_start_valid ==
true)
1004 strftime(dest_string,
sizeof(dest_string),
"%c %Z", localtime(&(data.
date_start)));
1005 cout <<
" Start date of this statement: " << dest_string <<
"\n";
1007 if (data.date_end_valid ==
true)
1009 strftime(dest_string,
sizeof(dest_string),
"%c %Z", localtime(&(data.
date_end)));
1010 cout <<
" End date of this statement: " << dest_string <<
"\n";
1012 if (data.ledger_balance_valid ==
true)
1014 cout <<
" Ledger balance: " << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2) << data.
ledger_balance <<
"\n";
1016 if (data.ledger_balance_date_valid ==
true)
1018 strftime(dest_string,
sizeof(dest_string),
"%c %Z", localtime(&(data.
ledger_balance_date)));
1019 cout <<
" Ledger balance date: " << dest_string <<
"\n";
1021 if (data.available_balance_valid ==
true)
1023 cout <<
" Available balance: " << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2) << data.
available_balance <<
"\n";
1025 if (data.available_balance_date_valid ==
true)
1028 cout <<
" Available balance date: " << dest_string <<
"\n";
1030 if (data.margin_balance_valid ==
true)
1032 cout <<
" Margin balance: " << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2) << data.
margin_balance <<
"\n";
1034 if (data.short_balance_valid ==
true)
1036 cout <<
" Short balance: " << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2) << data.
short_balance <<
"\n";
1038 if (data.buying_power_valid ==
true)
1040 cout <<
" Buying power: " << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2) << data.
buying_power <<
"\n";
1042 if (data.marketing_info_valid ==
true)
1044 cout <<
" Marketing information: " << data.
marketing_info <<
"\n";
1050 int ofx_proc_account_cb(
struct OfxAccountData data,
void * account_data)
1052 cout <<
"ofx_proc_account():\n";
1053 if (data.account_id_valid ==
true)
1055 cout <<
" Account ID: " << data.
account_id <<
"\n";
1056 cout <<
" Account name: " << data.
account_name <<
"\n";
1058 if (data.account_type_valid ==
true)
1060 cout <<
" Account type: ";
1061 switch (data.account_type)
1064 cout <<
"CHECKING\n";
1067 cout <<
"SAVINGS\n";
1070 cout <<
"MONEYMRKT\n";
1073 cout <<
"CREDITLINE\n";
1079 cout <<
"CREDITCARD\n";
1082 cout <<
"INVESTMENT\n";
1085 cout <<
"ofx_proc_account() WRITEME: This is an unknown account type!";
1088 if (data.currency_valid ==
true)
1090 cout <<
" Default Currency: " << data.
currency <<
"\n";
1093 if (data.bank_id_valid)
1094 cout <<
" Bank ID: " << data.
bank_id << endl;;
1096 if (data.branch_id_valid)
1097 cout <<
" Branch ID: " << data.branch_id << endl;
1099 if (data.account_number_valid)
1108 int ofx_proc_status_cb(
struct OfxStatusData data,
void * status_data)
1110 cout <<
"ofx_proc_status():\n";
1113 cout <<
" Ofx entity this status is relevant to: " << data.ofx_element_name <<
" \n";
1115 if (data.severity_valid ==
true)
1117 cout <<
" Severity: ";
1118 switch (data.severity)
1130 cout <<
"WRITEME: Unknown status severity!\n";
1135 cout <<
" Code: " << data.
code <<
", name: " << data.
name <<
"\n Description: " << data.
description <<
"\n";
1137 if (data.server_message_valid ==
true)
1151 if (cmdline_parser (argc, argv, &args_info) != 0)
1167 bool skiphelp =
false;
1172 cout <<
"The supported file formats for the 'input-file-format' argument are:" << endl;
1173 for (
int i = 0; LibofxImportFormatList[i].
format !=
LAST; i++)
1175 cout <<
" " << LibofxImportFormatList[i].
description << endl;
1198 cout <<
"Sorry, currently, only the first file is processed as the library can't deal with more right now. The following files were ignored:" << endl;
1199 for (
unsigned i = 1 ; i < args_info.
inputs_num ; ++i )
1201 cout <<
"file: " << args_info.
inputs[i] << endl ;
1210 cmdline_parser_print_help();
char fiasset_class[OFX_FIASSET_CLASS_LENGTH]
time_t ledger_balance_date
int msg_info_flag
Output informational messages about the progress of the library (default=on).
An abstraction of an account.
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 currency[OFX_CURRENCY_LENGTH]
char unique_id_type[OFX_UNIQUE_ID_TYPE_LENGTH]
int msg_warning_flag
Output warning messages about abnormal conditions and unknown constructs (default=on).
char * import_format_arg
Force the file format of the file(s) specified (default='AUTODETECT').
Where the command line options are stored.
char reference_number[OFX_REFERENCE_NUMBER_LENGTH]
void ofx_set_position_cb(LibofxContextPtr ctx, LibofxProcPositionCallback cb, void *user_data)
int amounts_are_foreign_currency
char unique_id[OFX_UNIQUE_ID_LENGTH]
An abstraction of a security position held in an account.
char account_id[OFX_ACCOUNT_ID_LENGTH]
char account_id[OFX_ACCOUNT_ID_LENGTH]
char unique_id2[OFX_UNIQUE_ID_LENGTH]
char currency[OFX_CURRENCY_LENGTH]
char check_number[OFX_CHECK_NUMBER_LENGTH]
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
int msg_debug_flag
Output messages meant for debugging (default=off).
unsigned int list_import_formats_given
Whether list-import-formats was given.
char currency[OFX_CURRENCY_LENGTH]
LibofxContextPtr libofx_get_new_context()
Initialise the library and return a new context.
int amounts_are_foreign_currency
long int standard_industrial_code
char account_id[OFX_ACCOUNT_ID_LENGTH]
char memo[OFX_MEMO2_LENGTH]
void ofx_set_statement_cb(LibofxContextPtr ctx, LibofxProcStatementCallback cb, void *user_data)
struct OfxSecurityData * security_data_ptr
char unique_id[OFX_UNIQUE_ID_LENGTH]
void ofx_set_status_cb(LibofxContextPtr ctx, LibofxProcStatusCallback cb, void *user_data)
double cash_for_fractional
void ofx_set_account_cb(LibofxContextPtr ctx, LibofxProcAccountCallback cb, void *user_data)
int subacct_funding_valid
char account_id[OFX_ACCOUNT_ID_LENGTH]
char unique_id[OFX_UNIQUE_ID_LENGTH]
char rating[OFX_SECURITY_RATING_LENGTH]
char fi_id[OFX_FITID_LENGTH]
char memo[OFX_MEMO_LENGTH]
char account_name[OFX_ACCOUNT_NAME_LENGTH]
time_t available_balance_date
char server_transaction_id[OFX_SVRTID2_LENGTH]
char bank_id[OFX_BANKID_LENGTH]
char related_fi_tid[OFX_FITID_LENGTH]
int msg_error_flag
Output error messages (default=on).
An abstraction of an OFX STATUS element.
void ofx_set_security_cb(LibofxContextPtr ctx, LibofxProcSecurityCallback cb, void *user_data)
int amounts_are_foreign_currency
unsigned inputs_num
unamed options number
char unique_id_type[OFX_UNIQUE_ID_TYPE_LENGTH]
int subacct_security_valid
char unique_id2_type[OFX_UNIQUE_ID_TYPE_LENGTH]
int msg_status_flag
Output status messages (default=on).
int msg_parser_flag
Output file parsing messages (default=off).
char ticker[OFX_TICKER_LENGTH]
char payee_id[OFX_SVRTID2_LENGTH]
An abstraction of a security, such as a stock, mutual fund, etc.
int ofx_element_name_valid
void ofx_set_transaction_cb(LibofxContextPtr ctx, LibofxProcTransactionCallback cb, void *user_data)
int main(int argc, char *argv[])
An abstraction of a transaction in an account.
time_t date_funds_available
char currency[OFX_CURRENCY_LENGTH]
int libofx_proc_file(LibofxContextPtr libofx_context, const char *p_filename, enum LibofxFileFormat ftype)
libofx_proc_file is the entry point of the library.
char ** inputs
unamed options (options without names)
char account_number[OFX_ACCTID_LENGTH]
char unique_id_type[OFX_UNIQUE_ID_TYPE_LENGTH]
char currency[OFX_CURRENCY_LENGTH]
An abstraction of an account statement.
char fi_id_corrected[OFX_FITID_LENGTH]
char secname[OFX_SECNAME_LENGTH]
char loan_id[OFX_LOANID_LENGTH]