next up previous contents index
Next: Attributes Up: Frontend API Previous: Frontend API   Contents   Index

Initializing and finalizing

The header that contains the prototypes, etc is gocr.h.

It's mandatory that you call two functions when using GOCR. They are:

int gocr_init ( int argc, char **argv );

void gocr_finalize ( void );

The first function parses the arguments your program got, setups all the internal structures of GOCR, initializes all that it's needed to run. It must be called before any other GOCR function. It returns 0 if GOCR could be correctly initialized, -1 otherwise. This is a constant in the API: if a function returns -1, it failed. You should always test the return values. GOCR also outputs to stderr what was the problem.

At the end of your program, or when you don't intend to use GOCR anymore, you must call the second function.

Currently, GOCR accept the following arguments: none yet.



root 2002-02-17