OSDN Git Service

gitattirubes test 2
[handbrake-jp/handbrake-jp.git] / test / parsecsv.h
1 /* $Id: parsecsv.h $
2
3    This file is part of the HandBrake source code.
4    Homepage: <http://handbrake.fr/>.
5    It may be used under the terms of the GNU General Public License. */
6
7 /*
8     A very simple CSV file parser.
9  */
10
11 typedef struct hb_csv_file_s hb_csv_file_t;
12 typedef struct hb_csv_cell_s hb_csv_cell_t;
13
14 struct hb_csv_file_s
15 {
16     FILE  * fileref;
17     int     eof;
18     int     parse_state;
19     int     curr_row;
20     int     curr_col;
21 };
22
23 struct hb_csv_cell_s
24 {
25     char    cell_text[1024];
26     int     cell_row;
27     int     cell_col;
28 };
29
30 /* Open a CSV File */
31 hb_csv_file_t *hb_open_csv_file( const char *filepath );
32 void hb_close_csv_file( hb_csv_file_t *file );
33
34 /* Parse CSV Cells */
35 hb_csv_cell_t *hb_read_next_cell( hb_csv_file_t *file );
36 void hb_dispose_cell( hb_csv_cell_t *cell );