2 This is a Optical-Character-Recognition program
3 Copyright (C) 2000-2006 Joerg Schulenburg
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 see README for email address */
27 /* initialize job structure */
28 void job_init(job_t
*job
) {
31 /* FIXME jb: init pix */
35 list_init( &job
->res
.boxlist
);
36 list_init( &job
->res
.linelist
);
45 /* init temporaries */
46 list_init( &job
->tmp
.dblist
);
48 /* FIXME jb: init ppo */
49 job
->tmp
.ppo
.p
= NULL
;
57 job
->cfg
.dust_size
= -1; /* auto detect */
58 job
->cfg
.only_numbers
= 0;
60 job
->cfg
.out_format
= UTF8
; /* old: ISO8859_1; */
62 job
->cfg
.db_path
= (char*)NULL
;
63 job
->cfg
.cfilter
= (char*)NULL
;
64 job
->cfg
.certainty
= 95;
67 /* free job structure */
68 void job_free(job_t
*job
) {
70 /* if tmp is just a copy of the pointer to the original image */
71 if (job
->tmp
.ppo
.p
==job
->src
.p
.p
) job
->tmp
.ppo
.p
=NULL
;
73 /* FIMXE jb: free lists
74 * list_free( &job->res.linelist );
75 * list_free( &job->tmp.dblist );
78 list_and_data_free(&(job
->res
.boxlist
), (void (*)(void *))free_box
);
80 /* FIXME jb: free pix */
81 if (job
->src
.p
.p
) { free(job
->src
.p
.p
); job
->src
.p
.p
=NULL
; }
83 /* FIXME jb: free pix */
84 if (job
->tmp
.ppo
.p
) { free(job
->tmp
.ppo
.p
); job
->tmp
.ppo
.p
=NULL
; }