MCPcopy Create free account
hub / github.com/HandBrake/HandBrake / hb_open_csv_file

Function hb_open_csv_file

test/parsecsv.c:40–68  ·  view source on GitHub ↗

Open a CSV File */

Source from the content-addressed store, hash-verified

38
39/* Open a CSV File */
40hb_csv_file_t *hb_open_csv_file( const char *filepath )
41{
42 hb_csv_file_t *file = NULL;
43 FILE * fileref;
44
45 if( filepath == NULL )
46 {
47 return file;
48 }
49
50 fileref = hb_fopen(filepath, "r");
51 if( fileref == NULL )
52 {
53 return file;
54 }
55
56 file = malloc( sizeof( hb_csv_file_t ) );
57 if( file == NULL )
58 {
59 return file;
60 }
61
62 file->fileref = fileref;
63 file->eof = 0;
64 file->parse_state = CSV_PARSE_SEEK;
65 file->curr_col = 0;
66 file->curr_row = 0;
67 return file;
68}
69
70void hb_close_csv_file( hb_csv_file_t *file )
71{

Callers 1

write_chapter_namesFunction · 0.85

Calls 1

hb_fopenFunction · 0.85

Tested by 1

write_chapter_namesFunction · 0.68