summaryrefslogtreecommitdiffstats
path: root/test/parsecsv.h
diff options
context:
space:
mode:
Diffstat (limited to 'test/parsecsv.h')
-rw-r--r--test/parsecsv.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/parsecsv.h b/test/parsecsv.h
new file mode 100644
index 000000000..6247ddb44
--- /dev/null
+++ b/test/parsecsv.h
@@ -0,0 +1,36 @@
+/* $Id: parsecsv.h $
+
+ This file is part of the HandBrake source code.
+ Homepage: <http://handbrake.m0k.org/>.
+ It may be used under the terms of the GNU General Public License. */
+
+/*
+ A very simple CSV file parser.
+ */
+
+typedef struct hb_csv_file_s hb_csv_file_t;
+typedef struct hb_csv_cell_s hb_csv_cell_t;
+
+struct hb_csv_file_s
+{
+ FILE * fileref;
+ int eof;
+ int parse_state;
+ int curr_row;
+ int curr_col;
+};
+
+struct hb_csv_cell_s
+{
+ char cell_text[1024];
+ int cell_row;
+ int cell_col;
+};
+
+/* Open a CSV File */
+hb_csv_file_t *hb_open_csv_file( const char *filepath );
+void hb_close_csv_file( hb_csv_file_t *file );
+
+/* Parse CSV Cells */
+hb_csv_cell_t *hb_read_next_cell( hb_csv_file_t *file );
+void hb_dispose_cell( hb_csv_cell_t *cell ); \ No newline at end of file