LibOFX
ofxdump.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  ofxdump.cpp
3  -------------------
4  copyright : (C) 2002 by Benoit GrĂ©goire
5  email : benoitg@coeus.ca
6 ***************************************************************************/
22 /***************************************************************************
23  * *
24  * This program is free software; you can redistribute it and/or modify *
25  * it under the terms of the GNU General Public License as published by *
26  * the Free Software Foundation; either version 2 of the License, or *
27  * (at your option) any later version. *
28  * *
29  ***************************************************************************/
30 #include <iostream>
31 #include <iomanip>
32 #include <cstdlib>
33 #include <cstring>
34 #include <string>
35 #include "libofx.h"
36 #include <stdio.h> /* for printf() */
37 #include <config.h> /* Include config constants, e.g., VERSION TF */
38 #include <errno.h>
39 
40 #include "cmdline.h" /* Gengetopt generated parser */
41 
42 using namespace std;
43 
44 
45 int ofx_proc_security_cb(struct OfxSecurityData data, void * security_data)
46 {
47  char dest_string[255];
48  cout << "ofx_proc_security():\n";
49  if (data.unique_id_valid == true)
50  {
51  cout << " Unique ID of the security being traded: " << data.unique_id << "\n";
52  }
53  if (data.unique_id_type_valid == true)
54  {
55  cout << " Format of the Unique ID: " << data.unique_id_type << "\n";
56  }
57  if (data.secname_valid == true)
58  {
59  cout << " Name of the security: " << data.secname << "\n";
60  }
61  if (data.ticker_valid == true)
62  {
63  cout << " Ticker symbol: " << data.ticker << "\n";
64  }
65  if (data.unitprice_valid == true)
66  {
67  cout << " Price of each unit of the security: " << data.unitprice << "\n";
68  }
69  if (data.date_unitprice_valid == true)
70  {
71  strftime(dest_string, sizeof(dest_string), "%c %Z", localtime(&(data.date_unitprice)));
72  cout << " Date as of which the unitprice is valid: " << dest_string << "\n";
73  }
74  if (data.currency_valid == true)
75  {
76  cout << " Currency of the unitprice: " << data.currency << "\n";
77  }
78  if (data.memo_valid == true)
79  {
80  cout << " Extra transaction information (memo): " << data.memo << "\n";
81  }
82  cout << "\n";
83  return 0;
84 }
85 
86 int ofx_proc_transaction_cb(struct OfxTransactionData data, void * transaction_data)
87 {
88  char dest_string[255];
89  cout << "ofx_proc_transaction():\n";
90 
91  if (data.account_id_valid == true)
92  {
93  cout << " Account ID : " << data.account_id << "\n";
94  }
95 
96  if (data.transactiontype_valid == true)
97  {
98  if (data.transactiontype == OFX_CREDIT)
99  strncpy(dest_string, "CREDIT: Generic credit", sizeof(dest_string));
100  else if (data.transactiontype == OFX_DEBIT)
101  strncpy(dest_string, "DEBIT: Generic debit", sizeof(dest_string));
102  else if (data.transactiontype == OFX_INT)
103  strncpy(dest_string, "INT: Interest earned or paid (Note: Depends on signage of amount)", sizeof(dest_string));
104  else if (data.transactiontype == OFX_DIV)
105  strncpy(dest_string, "DIV: Dividend", sizeof(dest_string));
106  else if (data.transactiontype == OFX_FEE)
107  strncpy(dest_string, "FEE: FI fee", sizeof(dest_string));
108  else if (data.transactiontype == OFX_SRVCHG)
109  strncpy(dest_string, "SRVCHG: Service charge", sizeof(dest_string));
110  else if (data.transactiontype == OFX_DEP)
111  strncpy(dest_string, "DEP: Deposit", sizeof(dest_string));
112  else if (data.transactiontype == OFX_ATM)
113  strncpy(dest_string, "ATM: ATM debit or credit (Note: Depends on signage of amount)", sizeof(dest_string));
114  else if (data.transactiontype == OFX_POS)
115  strncpy(dest_string, "POS: Point of sale debit or credit (Note: Depends on signage of amount)", sizeof(dest_string));
116  else if (data.transactiontype == OFX_XFER)
117  strncpy(dest_string, "XFER: Transfer", sizeof(dest_string));
118  else if (data.transactiontype == OFX_CHECK)
119  strncpy(dest_string, "CHECK: Check", sizeof(dest_string));
120  else if (data.transactiontype == OFX_PAYMENT)
121  strncpy(dest_string, "PAYMENT: Electronic payment", sizeof(dest_string));
122  else if (data.transactiontype == OFX_CASH)
123  strncpy(dest_string, "CASH: Cash withdrawal", sizeof(dest_string));
124  else if (data.transactiontype == OFX_DIRECTDEP)
125  strncpy(dest_string, "DIRECTDEP: Direct deposit", sizeof(dest_string));
126  else if (data.transactiontype == OFX_DIRECTDEBIT)
127  strncpy(dest_string, "DIRECTDEBIT: Merchant initiated debit", sizeof(dest_string));
128  else if (data.transactiontype == OFX_REPEATPMT)
129  strncpy(dest_string, "REPEATPMT: Repeating payment/standing order", sizeof(dest_string));
130  else if (data.transactiontype == OFX_OTHER)
131  strncpy(dest_string, "OTHER: Other", sizeof(dest_string));
132  else
133  strncpy(dest_string, "Unknown transaction type", sizeof(dest_string));
134  cout << " Transaction type: " << dest_string << "\n";
135  }
136 
137 
138  if (data.date_initiated_valid == true)
139  {
140  strftime(dest_string, sizeof(dest_string), "%c %Z", localtime(&(data.date_initiated)));
141  cout << " Date initiated: " << dest_string << "\n";
142  }
143  if (data.date_posted_valid == true)
144  {
145  strftime(dest_string, sizeof(dest_string), "%c %Z", localtime(&(data.date_posted)));
146  cout << " Date posted: " << dest_string << "\n";
147  }
148  if (data.date_funds_available_valid == true)
149  {
150  strftime(dest_string, sizeof(dest_string), "%c %Z", localtime(&(data.date_funds_available)));
151  cout << " Date funds are available: " << dest_string << "\n";
152  }
153  if (data.amount_valid == true)
154  {
155  cout << " Total money amount: " << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2) << data.amount << "\n";
156  }
157  if (data.units_valid == true)
158  {
159  cout << " # of units: " << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2) << data.units << "\n";
160  }
161  if (data.oldunits_valid == true)
162  {
163  cout << " # of units before split: " << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2) << data.oldunits << "\n";
164  }
165  if (data.newunits_valid == true)
166  {
167  cout << " # of units after split: " << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2) << data.newunits << "\n";
168  }
169  if (data.unitprice_valid == true)
170  {
171  cout << " Unit price: " << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2) << data.unitprice << "\n";
172  }
173  if (data.fees_valid == true)
174  {
175  cout << " Fees: " << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2) << data.fees << "\n";
176  }
177  if (data.commission_valid == true)
178  {
179  cout << " Commission: " << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2) << data.commission << "\n";
180  }
181  if (data.fi_id_valid == true)
182  {
183  cout << " Financial institution's ID for this transaction: " << data.fi_id << "\n";
184  }
185  if (data.fi_id_corrected_valid == true)
186  {
187  cout << " Financial institution ID replaced or corrected by this transaction: " << data.fi_id_corrected << "\n";
188  }
189  if (data.fi_id_correction_action_valid == true)
190  {
191  cout << " Action to take on the corrected transaction: ";
192  if (data.fi_id_correction_action == DELETE)
193  cout << "DELETE\n";
194  else if (data.fi_id_correction_action == REPLACE)
195  cout << "REPLACE\n";
196  else
197  cout << "ofx_proc_transaction(): This should not happen!\n";
198  }
199  if (data.invtransactiontype_valid == true)
200  {
201  cout << " Investment transaction type: ";
202  if (data.invtransactiontype == OFX_BUYDEBT)
203  strncpy(dest_string, "BUYDEBT (Buy debt security)", sizeof(dest_string));
204  else if (data.invtransactiontype == OFX_BUYMF)
205  strncpy(dest_string, "BUYMF (Buy mutual fund)", sizeof(dest_string));
206  else if (data.invtransactiontype == OFX_BUYOPT)
207  strncpy(dest_string, "BUYOPT (Buy option)", sizeof(dest_string));
208  else if (data.invtransactiontype == OFX_BUYOTHER)
209  strncpy(dest_string, "BUYOTHER (Buy other security type)", sizeof(dest_string));
210  else if (data.invtransactiontype == OFX_BUYSTOCK)
211  strncpy(dest_string, "BUYSTOCK (Buy stock))", sizeof(dest_string));
212  else if (data.invtransactiontype == OFX_CLOSUREOPT)
213  strncpy(dest_string, "CLOSUREOPT (Close a position for an option)", sizeof(dest_string));
214  else if (data.invtransactiontype == OFX_INCOME)
215  strncpy(dest_string, "INCOME (Investment income is realized as cash into the investment account)", sizeof(dest_string));
216  else if (data.invtransactiontype == OFX_INVEXPENSE)
217  strncpy(dest_string, "INVEXPENSE (Misc investment expense that is associated with a specific security)", sizeof(dest_string));
218  else if (data.invtransactiontype == OFX_JRNLFUND)
219  strncpy(dest_string, "JRNLFUND (Journaling cash holdings between subaccounts within the same investment account)", sizeof(dest_string));
220  else if (data.invtransactiontype == OFX_MARGININTEREST)
221  strncpy(dest_string, "MARGININTEREST (Margin interest expense)", sizeof(dest_string));
222  else if (data.invtransactiontype == OFX_REINVEST)
223  strncpy(dest_string, "REINVEST (Reinvestment of income)", sizeof(dest_string));
224  else if (data.invtransactiontype == OFX_RETOFCAP)
225  strncpy(dest_string, "RETOFCAP (Return of capital)", sizeof(dest_string));
226  else if (data.invtransactiontype == OFX_SELLDEBT)
227  strncpy(dest_string, "SELLDEBT (Sell debt security. Used when debt is sold, called, or reached maturity)", sizeof(dest_string));
228  else if (data.invtransactiontype == OFX_SELLMF)
229  strncpy(dest_string, "SELLMF (Sell mutual fund)", sizeof(dest_string));
230  else if (data.invtransactiontype == OFX_SELLOPT)
231  strncpy(dest_string, "SELLOPT (Sell option)", sizeof(dest_string));
232  else if (data.invtransactiontype == OFX_SELLOTHER)
233  strncpy(dest_string, "SELLOTHER (Sell other type of security)", sizeof(dest_string));
234  else if (data.invtransactiontype == OFX_SELLSTOCK)
235  strncpy(dest_string, "SELLSTOCK (Sell stock)", sizeof(dest_string));
236  else if (data.invtransactiontype == OFX_SPLIT)
237  strncpy(dest_string, "SPLIT (Stock or mutial fund split)", sizeof(dest_string));
238  else if (data.invtransactiontype == OFX_TRANSFER)
239  strncpy(dest_string, "TRANSFER (Transfer holdings in and out of the investment account)", sizeof(dest_string));
240  else
241  strncpy(dest_string, "ERROR, this investment transaction type is unknown. This is a bug in ofxdump", sizeof(dest_string));
242 
243  cout << dest_string << "\n";
244  }
245  if (data.unique_id_valid == true)
246  {
247  cout << " Unique ID of the security being traded: " << data.unique_id << "\n";
248  }
249  if (data.unique_id_type_valid == true)
250  {
251  cout << " Format of the Unique ID: " << data.unique_id_type << "\n";
252  }
253  if (data.security_data_valid == true)
254  {
255  ofx_proc_security_cb(*(data.security_data_ptr), NULL );
256  }
257 
258  if (data.server_transaction_id_valid == true)
259  {
260  cout << " Server's transaction ID (confirmation number): " << data.server_transaction_id << "\n";
261  }
262  if (data.check_number_valid == true)
263  {
264  cout << " Check number: " << data.check_number << "\n";
265  }
266  if (data.reference_number_valid == true)
267  {
268  cout << " Reference number: " << data.reference_number << "\n";
269  }
270  if (data.standard_industrial_code_valid == true)
271  {
272  cout << " Standard Industrial Code: " << data.standard_industrial_code << "\n";
273  }
274  if (data.payee_id_valid == true)
275  {
276  cout << " Payee_id: " << data.payee_id << "\n";
277  }
278  if (data.name_valid == true)
279  {
280  cout << " Name of payee or transaction description: " << data.name << "\n";
281  }
282  if (data.memo_valid == true)
283  {
284  cout << " Extra transaction information (memo): " << data.memo << "\n";
285  }
286  cout << "\n";
287  return 0;
288 }//end ofx_proc_transaction()
289 
290 int ofx_proc_statement_cb(struct OfxStatementData data, void * statement_data)
291 {
292  char dest_string[255];
293  cout << "ofx_proc_statement():\n";
294  if (data.currency_valid == true)
295  {
296  cout << " Currency: " << data.currency << "\n";
297  }
298  if (data.account_id_valid == true)
299  {
300  cout << " Account ID: " << data.account_id << "\n";
301  }
302  if (data.date_start_valid == true)
303  {
304  strftime(dest_string, sizeof(dest_string), "%c %Z", localtime(&(data.date_start)));
305  cout << " Start date of this statement: " << dest_string << "\n";
306  }
307  if (data.date_end_valid == true)
308  {
309  strftime(dest_string, sizeof(dest_string), "%c %Z", localtime(&(data.date_end)));
310  cout << " End date of this statement: " << dest_string << "\n";
311  }
312  if (data.ledger_balance_valid == true)
313  {
314  cout << " Ledger balance: " << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2) << data.ledger_balance << "\n";
315  }
316  if (data.ledger_balance_date_valid == true)
317  {
318  strftime(dest_string, sizeof(dest_string), "%c %Z", localtime(&(data.ledger_balance_date)));
319  cout << " Ledger balance date: " << dest_string << "\n";
320  }
321  if (data.available_balance_valid == true)
322  {
323  cout << " Available balance: " << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2) << data.available_balance << "\n";
324  }
325  if (data.available_balance_date_valid == true)
326  {
327  strftime(dest_string, sizeof(dest_string), "%c %Z", localtime(&(data.available_balance_date)));
328  cout << " Available balance date: " << dest_string << "\n";
329  }
330  if (data.marketing_info_valid == true)
331  {
332  cout << " Marketing information: " << data.marketing_info << "\n";
333  }
334  cout << "\n";
335  return 0;
336 }//end ofx_proc_statement()
337 
338 int ofx_proc_account_cb(struct OfxAccountData data, void * account_data)
339 {
340  cout << "ofx_proc_account():\n";
341  if (data.account_id_valid == true)
342  {
343  cout << " Account ID: " << data.account_id << "\n";
344  cout << " Account name: " << data.account_name << "\n";
345  }
346  if (data.account_type_valid == true)
347  {
348  cout << " Account type: ";
349  switch (data.account_type)
350  {
352  cout << "CHECKING\n";
353  break;
355  cout << "SAVINGS\n";
356  break;
358  cout << "MONEYMRKT\n";
359  break;
361  cout << "CREDITLINE\n";
362  break;
364  cout << "CMA\n";
365  break;
367  cout << "CREDITCARD\n";
368  break;
370  cout << "INVESTMENT\n";
371  break;
372  default:
373  cout << "ofx_proc_account() WRITEME: This is an unknown account type!";
374  }
375  }
376  if (data.currency_valid == true)
377  {
378  cout << " Currency: " << data.currency << "\n";
379  }
380 
381  if (data.bank_id_valid)
382  cout << " Bank ID: " << data.bank_id << endl;;
383 
384  if (data.branch_id_valid)
385  cout << " Branch ID: " << data.branch_id << endl;
386 
387  if (data.account_number_valid)
388  cout << " Account #: " << data.account_number << endl;
389 
390  cout << "\n";
391  return 0;
392 }//end ofx_proc_account()
393 
394 
395 
396 int ofx_proc_status_cb(struct OfxStatusData data, void * status_data)
397 {
398  cout << "ofx_proc_status():\n";
399  if (data.ofx_element_name_valid == true)
400  {
401  cout << " Ofx entity this status is relevant to: " << data.ofx_element_name << " \n";
402  }
403  if (data.severity_valid == true)
404  {
405  cout << " Severity: ";
406  switch (data.severity)
407  {
408  case OfxStatusData::INFO :
409  cout << "INFO\n";
410  break;
411  case OfxStatusData::WARN :
412  cout << "WARN\n";
413  break;
414  case OfxStatusData::ERROR :
415  cout << "ERROR\n";
416  break;
417  default:
418  cout << "WRITEME: Unknown status severity!\n";
419  }
420  }
421  if (data.code_valid == true)
422  {
423  cout << " Code: " << data.code << ", name: " << data.name << "\n Description: " << data.description << "\n";
424  }
425  if (data.server_message_valid == true)
426  {
427  cout << " Server Message: " << data.server_message << "\n";
428  }
429  cout << "\n";
430  return 0;
431 }
432 
433 
434 int main (int argc, char *argv[])
435 {
436  gengetopt_args_info args_info;
437 
438  /* let's call our cmdline parser */
439  if (cmdline_parser (argc, argv, &args_info) != 0)
440  exit(1) ;
441 
442  // if (args_info.msg_parser_given)
443  // cout << "The msg_parser option was given!" << endl;
444 
445  // cout << "The flag is " << ( args_info.msg_parser_flag ? "on" : "off" ) <<
446  // "." << endl ;
447  args_info.msg_parser_flag ? ofx_PARSER_msg = true : ofx_PARSER_msg = false;
448  args_info.msg_debug_flag ? ofx_DEBUG_msg = true : ofx_DEBUG_msg = false;
449  args_info.msg_warning_flag ? ofx_WARNING_msg = true : ofx_WARNING_msg = false;
450  args_info.msg_error_flag ? ofx_ERROR_msg = true : ofx_ERROR_msg = false;
451  args_info.msg_info_flag ? ofx_INFO_msg = true : ofx_INFO_msg = false;
452  args_info.msg_status_flag ? ofx_STATUS_msg = true : ofx_STATUS_msg;
453 
454  bool skiphelp = false;
455 
456  if (args_info.list_import_formats_given)
457  {
458  skiphelp = true;
459  cout << "The supported file formats for the 'input-file-format' argument are:" << endl;
460  for (int i = 0; LibofxImportFormatList[i].format != LAST; i++)
461  {
462  cout << " " << LibofxImportFormatList[i].description << endl;
463  }
464  }
465 
466  LibofxContextPtr libofx_context = libofx_get_new_context();
467 
468  //char **inputs ; /* unamed options */
469  //unsigned inputs_num ; /* unamed options number */
470  if (args_info.inputs_num > 0)
471  {
472  const char* filename = args_info.inputs[0];
473 
474 
475  ofx_set_statement_cb(libofx_context, ofx_proc_statement_cb, 0);
476  ofx_set_account_cb(libofx_context, ofx_proc_account_cb, 0);
477  ofx_set_transaction_cb(libofx_context, ofx_proc_transaction_cb, 0);
478  ofx_set_security_cb(libofx_context, ofx_proc_security_cb, 0);
479  ofx_set_status_cb(libofx_context, ofx_proc_status_cb, 0);
480 
481  enum LibofxFileFormat file_format = libofx_get_file_format_from_str(LibofxImportFormatList, args_info.import_format_arg);
483  if (args_info.inputs_num > 1)
484  {
485  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;
486  for ( unsigned i = 1 ; i < args_info.inputs_num ; ++i )
487  {
488  cout << "file: " << args_info.inputs[i] << endl ;
489  }
490  }
491  libofx_proc_file(libofx_context, args_info.inputs[0], file_format);
492  }
493  else
494  {
495  if ( !skiphelp )
497  }
498  return 0;
499 }
gengetopt_args_info::msg_parser_flag
int msg_parser_flag
Output file parsing messages (default=off).
Definition: ofxdump/cmdline.h:50
OfxTransactionData::unitprice
double unitprice
Definition: libofx.h:509
OfxTransactionData::commission
double commission
Definition: libofx.h:601
OfxStatusData::ERROR
@ ERROR
Definition: libofx.h:233
LibofxFileFormat
LibofxFileFormat
Definition: libofx.h:123
gengetopt_args_info::import_format_arg
char * import_format_arg
Force the file format of the file(s) specified (default='AUTODETECT').
Definition: ofxdump/cmdline.h:46
OfxStatementData::available_balance
double available_balance
Definition: libofx.h:669
OfxTransactionData::name
char name[OFX_TRANSACTION_NAME_LENGTH]
Definition: libofx.h:594
OfxSecurityData
An abstraction of a security, such as a stock, mutual fund, etc.
Definition: libofx.h:352
OfxTransactionData
An abstraction of a transaction in an account.
Definition: libofx.h:475
OfxSecurityData::memo
char memo[OFX_MEMO2_LENGTH]
Definition: libofx.h:391
OfxAccountData::OFX_INVESTMENT
@ OFX_INVESTMENT
Definition: libofx.h:305
OFX_BUYSTOCK
@ OFX_BUYSTOCK
Definition: libofx.h:443
OFX_CLOSUREOPT
@ OFX_CLOSUREOPT
Definition: libofx.h:444
OfxTransactionData::fees
double fees
Definition: libofx.h:604
OFX_DEP
@ OFX_DEP
Definition: libofx.h:424
OfxAccountData
An abstraction of an account.
Definition: libofx.h:271
OFX_BUYDEBT
@ OFX_BUYDEBT
Definition: libofx.h:439
OfxStatementData::date_end
time_t date_end
Definition: libofx.h:688
OFX_BUYMF
@ OFX_BUYMF
Definition: libofx.h:440
OFX_INT
@ OFX_INT
Definition: libofx.h:420
OfxTransactionData::amount
double amount
Definition: libofx.h:513
OFX_SRVCHG
@ OFX_SRVCHG
Definition: libofx.h:423
ofx_INFO_msg
int ofx_INFO_msg
Definition: messages.cpp:38
OFX_SPLIT
@ OFX_SPLIT
Definition: libofx.h:457
OFX_BUYOTHER
@ OFX_BUYOTHER
Definition: libofx.h:442
OfxTransactionData::fi_id_corrected
char fi_id_corrected[256]
Definition: libofx.h:563
OfxStatementData::currency
char currency[OFX_CURRENCY_LENGTH]
Definition: libofx.h:647
OfxStatusData
An abstraction of an OFX STATUS element.
Definition: libofx.h:209
OFX_CREDIT
@ OFX_CREDIT
Definition: libofx.h:418
OfxStatementData::account_id
char account_id[OFX_ACCOUNT_ID_LENGTH]
Definition: libofx.h:650
OfxStatementData::date_start
time_t date_start
Definition: libofx.h:681
OfxStatusData::INFO
@ INFO
Definition: libofx.h:231
OfxTransactionData::account_id
char account_id[OFX_ACCOUNT_ID_LENGTH]
Definition: libofx.h:483
OfxTransactionData::fi_id_correction_action
FiIdCorrectionAction fi_id_correction_action
Definition: libofx.h:568
OfxSecurityData::secname
char secname[OFX_SECNAME_LENGTH]
Definition: libofx.h:368
ofx_ERROR_msg
int ofx_ERROR_msg
Definition: messages.cpp:40
gengetopt_args_info::inputs
char ** inputs
unnamed options (options without names)
Definition: ofxconnect/cmdline.h:114
OfxSecurityData::unitprice
double unitprice
Definition: libofx.h:379
cmdline.h
The header file for the command line option parser generated by GNU Gengetopt version 2....
OfxStatementData
An abstraction of an account statement.
Definition: libofx.h:637
OfxStatementData::marketing_info
char marketing_info[OFX_MARKETING_INFO_LENGTH]
Definition: libofx.h:693
OfxAccountData::bank_id
char bank_id[OFX_BANKID_LENGTH]
Definition: libofx.h:318
gengetopt_args_info::msg_error_flag
int msg_error_flag
Output error messages (default=on).
Definition: ofxdump/cmdline.h:56
gengetopt_args_info::msg_debug_flag
int msg_debug_flag
Output messages meant for debugging (default=off).
Definition: ofxdump/cmdline.h:52
gengetopt_args_info::list_import_formats_given
unsigned int list_import_formats_given
Whether list-import-formats was given.
Definition: ofxdump/cmdline.h:66
cmdline_parser_print_help
void cmdline_parser_print_help(void)
Definition: ofxconnect/cmdline.c:201
OfxTransactionData::date_posted
time_t date_posted
Definition: libofx.h:540
OFX_DEBIT
@ OFX_DEBIT
Definition: libofx.h:419
OFX_DIRECTDEBIT
@ OFX_DIRECTDEBIT
Definition: libofx.h:432
OFX_TRANSFER
@ OFX_TRANSFER
Definition: libofx.h:458
LAST
@ LAST
Definition: libofx.h:130
OfxTransactionData::payee_id
char payee_id[OFX_SVRTID2_LENGTH]
Definition: libofx.h:591
OfxSecurityData::unique_id
char unique_id[OFX_UNIQUE_ID_LENGTH]
Definition: libofx.h:361
OfxStatusData::ofx_element_name_valid
int ofx_element_name_valid
Definition: libofx.h:217
ofx_set_status_cb
void ofx_set_status_cb(LibofxContextPtr ctx, LibofxProcStatusCallback cb, void *user_data)
Definition: context.cpp:178
OfxStatusData::WARN
@ WARN
Definition: libofx.h:232
ofx_STATUS_msg
int ofx_STATUS_msg
Definition: messages.cpp:37
OFX_FEE
@ OFX_FEE
Definition: libofx.h:422
OfxSecurityData::date_unitprice
time_t date_unitprice
Definition: libofx.h:383
libofx_get_new_context
LibofxContextPtr libofx_get_new_context(void)
Initialise the library and return a new context.
Definition: context.cpp:153
ofx_set_statement_cb
void ofx_set_statement_cb(LibofxContextPtr ctx, LibofxProcStatementCallback cb, void *user_data)
Definition: context.cpp:213
OfxStatusData::server_message
char * server_message
Definition: libofx.h:242
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: file_preproc.cpp:54
OFX_SELLOTHER
@ OFX_SELLOTHER
Definition: libofx.h:455
libofx.h
Main header file containing the LibOfx API.
OFX_CHECK
@ OFX_CHECK
Definition: libofx.h:428
OFX_INVEXPENSE
@ OFX_INVEXPENSE
Definition: libofx.h:446
OFX_RETOFCAP
@ OFX_RETOFCAP
Definition: libofx.h:451
OFX_XFER
@ OFX_XFER
Definition: libofx.h:427
OfxAccountData::OFX_SAVINGS
@ OFX_SAVINGS
Definition: libofx.h:300
OFX_ATM
@ OFX_ATM
Definition: libofx.h:425
OfxAccountData::OFX_CREDITLINE
@ OFX_CREDITLINE
Definition: libofx.h:302
OfxTransactionData::check_number
char check_number[OFX_CHECK_NUMBER_LENGTH]
Definition: libofx.h:579
OFX_POS
@ OFX_POS
Definition: libofx.h:426
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: file_preproc.cpp:67
OFX_REINVEST
@ OFX_REINVEST
Definition: libofx.h:450
OfxAccountData::OFX_MONEYMRKT
@ OFX_MONEYMRKT
Definition: libofx.h:301
OfxTransactionData::security_data_valid
int security_data_valid
Definition: libofx.h:538
OfxAccountData::OFX_CREDITCARD
@ OFX_CREDITCARD
Definition: libofx.h:304
ofx_DEBUG_msg
int ofx_DEBUG_msg
Definition: messages.cpp:31
OfxSecurityData::unique_id_type
char unique_id_type[OFX_UNIQUE_ID_TYPE_LENGTH]
Definition: libofx.h:364
LibofxFileFormatInfo::format
enum LibofxFileFormat format
Definition: libofx.h:135
OFX_CASH
@ OFX_CASH
Definition: libofx.h:430
DELETE
@ DELETE
Definition: libofx.h:463
ofx_set_transaction_cb
void ofx_set_transaction_cb(LibofxContextPtr ctx, LibofxProcTransactionCallback cb, void *user_data)
Definition: context.cpp:204
ofx_set_security_cb
void ofx_set_security_cb(LibofxContextPtr ctx, LibofxProcSecurityCallback cb, void *user_data)
Definition: context.cpp:195
OfxAccountData::account_id
char account_id[OFX_ACCOUNT_ID_LENGTH]
Definition: libofx.h:285
OfxTransactionData::unique_id_type
char unique_id_type[OFX_UNIQUE_ID_TYPE_LENGTH]
Definition: libofx.h:533
OfxTransactionData::server_transaction_id
char server_transaction_id[OFX_SVRTID2_LENGTH]
Definition: libofx.h:573
OFX_PAYMENT
@ OFX_PAYMENT
Definition: libofx.h:429
OfxAccountData::account_number
char account_number[OFX_ACCTID_LENGTH]
Definition: libofx.h:314
OfxSecurityData::currency
char currency[OFX_CURRENCY_LENGTH]
Definition: libofx.h:388
OfxTransactionData::reference_number
char reference_number[OFX_REFERENCE_NUMBER_LENGTH]
Definition: libofx.h:584
OFX_INCOME
@ OFX_INCOME
Definition: libofx.h:445
OfxAccountData::OFX_CMA
@ OFX_CMA
Definition: libofx.h:303
OfxTransactionData::date_initiated
time_t date_initiated
Definition: libofx.h:547
OFX_JRNLFUND
@ OFX_JRNLFUND
Definition: libofx.h:447
gengetopt_args_info::msg_status_flag
int msg_status_flag
Output status messages (default=on).
Definition: ofxdump/cmdline.h:60
OfxTransactionData::standard_industrial_code
long int standard_industrial_code
Definition: libofx.h:587
main
int main(int argc, char *argv[])
Definition: ofxdump.cpp:434
OfxTransactionData::transactiontype_valid
int transactiontype_valid
Definition: libofx.h:491
ofx_WARNING_msg
int ofx_WARNING_msg
Definition: messages.cpp:39
OFX_DIRECTDEP
@ OFX_DIRECTDEP
Definition: libofx.h:431
gengetopt_args_info::inputs_num
unsigned inputs_num
unnamed options number
Definition: ofxconnect/cmdline.h:115
cmdline_parser
int cmdline_parser(int argc, char **argv, struct gengetopt_args_info *args_info)
Definition: ofxconnect/cmdline.c:423
OFX_SELLMF
@ OFX_SELLMF
Definition: libofx.h:453
ofx_set_account_cb
void ofx_set_account_cb(LibofxContextPtr ctx, LibofxProcAccountCallback cb, void *user_data)
Definition: context.cpp:186
ofx_PARSER_msg
int ofx_PARSER_msg
Definition: messages.cpp:30
OFX_REPEATPMT
@ OFX_REPEATPMT
Definition: libofx.h:433
OfxAccountData::OFX_CHECKING
@ OFX_CHECKING
Definition: libofx.h:299
OFX_SELLDEBT
@ OFX_SELLDEBT
Definition: libofx.h:452
LibofxFileFormatInfo::description
const char * description
Definition: libofx.h:137
OFX_BUYOPT
@ OFX_BUYOPT
Definition: libofx.h:441
gengetopt_args_info::msg_warning_flag
int msg_warning_flag
Output warning messages about abnormal conditions and unknown constructs (default=on).
Definition: ofxdump/cmdline.h:54
OfxAccountData::account_name
char account_name[OFX_ACCOUNT_NAME_LENGTH]
Definition: libofx.h:292
OFX_SELLOPT
@ OFX_SELLOPT
Definition: libofx.h:454
gengetopt_args_info
Where the command line options are stored.
Definition: ofxconnect/cmdline.h:42
OFX_SELLSTOCK
@ OFX_SELLSTOCK
Definition: libofx.h:456
OFX_DIV
@ OFX_DIV
Definition: libofx.h:421
OfxStatementData::ledger_balance_date
time_t ledger_balance_date
Definition: libofx.h:661
OfxTransactionData::unique_id
char unique_id[OFX_UNIQUE_ID_LENGTH]
Definition: libofx.h:531
OfxTransactionData::fi_id
char fi_id[256]
Definition: libofx.h:519
OfxStatusData::description
const char * description
Definition: libofx.h:225
OFX_OTHER
@ OFX_OTHER
Definition: libofx.h:434
OfxStatusData::code
int code
Definition: libofx.h:223
OfxTransactionData::units
double units
Definition: libofx.h:506
OfxTransactionData::date_funds_available
time_t date_funds_available
Definition: libofx.h:555
OfxTransactionData::memo
char memo[OFX_MEMO2_LENGTH]
Definition: libofx.h:598
OfxStatementData::ledger_balance
double ledger_balance
Definition: libofx.h:658
gengetopt_args_info::msg_info_flag
int msg_info_flag
Output informational messages about the progress of the library (default=on).
Definition: ofxdump/cmdline.h:58
OfxAccountData::currency
char currency[OFX_CURRENCY_LENGTH]
Definition: libofx.h:310
OfxSecurityData::ticker
char ticker[OFX_TICKER_LENGTH]
Definition: libofx.h:376
OfxStatusData::code_valid
int code_valid
Definition: libofx.h:226
OfxStatementData::available_balance_date_valid
int available_balance_date_valid
Definition: libofx.h:675
OFX_MARGININTEREST
@ OFX_MARGININTEREST
Definition: libofx.h:449
OfxStatusData::name
const char * name
Definition: libofx.h:224
REPLACE
@ REPLACE
Definition: libofx.h:465