Main Page | Class Hierarchy | Data Structures | File List | Data Fields | Globals

ofx2qif.c File Reference


Detailed Description

Code for ofx2qif utility. C example code.

ofx2qif is a OFX "file" to QIF (Quicken Interchange Format) converter. It was written as a second code example, and as a way for LibOFX to immediately provide something usefull, and to give people a reason to try the library. It is not recommended that financial software use the output of this utility for OFX support. The QIF file format is very primitive, and much information is lost. The utility curently supports every tansaction tags of the QIF format except the address lines, and supports many of the !Account tags. It should generate QIF files that will import sucesfully in just about every software with QIF support.

I do not plan on improving working this utility much further, however be I would be more than happy to accept contributions. If you are interested in hacking on ofx2qif, links to QIF documentation are available on the LibOFX home page.

ofx2qif is meant to be the C code example and demo of the library. It uses many of the functions and structures of the LibOFX API. Note that unlike ofxdump, all error output is disabled by default.

usage: ofx2qif path_to_ofx_file/ofx_filename > output_filename.qif

Definition in file ofx2qif.c.

Go to the source code of this file.

Defines

#define QIF_FILE_MAX_SIZE   256000

Functions

int main (int argc, char *argv[])
int ofx_proc_status_cb (struct OfxStatusData data)
 The callback function for the OfxStatusData stucture.

int ofx_proc_security_cb (struct OfxSecurityData data)
 The callback function for the OfxSecurityData stucture.

int ofx_proc_transaction_cb (struct OfxTransactionData data)
 The callback function for the OfxTransactionData stucture.

int ofx_proc_statement_cb (struct OfxStatementData data)
 The callback function for the OfxStatementData stucture.

int ofx_proc_account_cb (struct OfxAccountData data)
 The callback function for the OfxAccountData stucture.


Function Documentation

int main int  argc,
char *  argv[]
 

Tell ofxdump what you want it to send to stderr. See messages.cpp for more details

Definition at line 48 of file ofx2qif.c.

int ofx_proc_account_cb const struct OfxAccountData  data  ) 
 

The callback function for the OfxAccountData stucture.

The ofx_proc_account_cb event is always generated first, to allow the application to create accounts or ask the user to match an existing account before the ofx_proc_statement and ofx_proc_transaction event are received. An OfxAccountData is passed to this event.

Note however that this OfxAccountData structure will also be available as part of OfxStatementData structure passed to ofx_proc_statement event.

Definition at line 221 of file ofx2qif.c.

int ofx_proc_security_cb const struct OfxSecurityData  data  ) 
 

The callback function for the OfxSecurityData stucture.

An ofx_proc_security_cb event is generated for any securities listed in the ofx file. It is generated after ofx_proc_statement but before ofx_proc_transaction. It is meant to be used to allow the client to create a new commodity or security (such as a new stock type). Please note however that this information is usually also available as part of each OfxtransactionData. An OfxSecurityData structure is passed to this event.

Definition at line 71 of file ofx2qif.c.

int ofx_proc_statement_cb const struct OfxStatementData  data  ) 
 

The callback function for the OfxStatementData stucture.

The ofx_proc_statement_cb event is sent after all ofx_proc_transaction events have been sent. An OfxStatementData is passed to this event.

Definition at line 162 of file ofx2qif.c.

int ofx_proc_status_cb const struct OfxStatusData  data  ) 
 

The callback function for the OfxStatusData stucture.

An ofx_proc_status_cb event is sent everytime the server has generated a OFX STATUS element. As such, it could be received at any time(but not during other events). An OfxStatusData structure is passed to this even.

Definition at line 67 of file ofx2qif.c.

int ofx_proc_transaction_cb const struct OfxTransactionData  data  ) 
 

The callback function for the OfxTransactionData stucture.

An ofx_proc_transaction_cb event is generated for every transaction in the ofx response, after ofx_proc_statement (and possibly ofx_proc_security is generated. An OfxTransactionData structure is passed to this event.

Definition at line 77 of file ofx2qif.c.


Generated on Fri Sep 12 00:35:47 2003 for LibOFX by doxygen 1.3.3