return mvcp_malloc_failed;
}
+static mvcp_error_code mvcp_list_parse( mvcp_list_entry entry, char* line)
+{
+ mvcp_tokeniser tokeniser = mvcp_tokeniser_init( );
+ mvcp_tokeniser_parse_new( tokeniser, line, " " );
+
+ if ( mvcp_tokeniser_count( tokeniser ) > 0 )
+ {
+ entry->clip = atoi( mvcp_tokeniser_get_string( tokeniser, 0 ) );
+ mvcp_util_strip( mvcp_tokeniser_get_string( tokeniser, 1 ), '\"' );
+ strcpy( entry->full, mvcp_tokeniser_get_string( tokeniser, 1 ) );
+ entry->in = atol( mvcp_tokeniser_get_string( tokeniser, 2 ) );
+ entry->out = atol( mvcp_tokeniser_get_string( tokeniser, 3 ) );
+ entry->max = atol( mvcp_tokeniser_get_string( tokeniser, 4 ) );
+ entry->size = atol( mvcp_tokeniser_get_string( tokeniser, 5 ) );
+ entry->fps = atof( mvcp_tokeniser_get_string( tokeniser, 6 ) );
+ }
+ mvcp_tokeniser_close( tokeniser );
+
+ return mvcp_ok;
+}
+
/** Get a particular file entry in the list.
*/
if ( index < mvcp_list_count( list ) )
{
char *line = mvcp_response_get_line( list->response, index + 2 );
- mvcp_tokeniser tokeniser = mvcp_tokeniser_init( );
- mvcp_tokeniser_parse_new( tokeniser, line, " " );
-
- if ( mvcp_tokeniser_count( tokeniser ) > 0 )
- {
- entry->clip = atoi( mvcp_tokeniser_get_string( tokeniser, 0 ) );
- mvcp_util_strip( mvcp_tokeniser_get_string( tokeniser, 1 ), '\"' );
- strcpy( entry->full, mvcp_tokeniser_get_string( tokeniser, 1 ) );
- entry->in = atol( mvcp_tokeniser_get_string( tokeniser, 2 ) );
- entry->out = atol( mvcp_tokeniser_get_string( tokeniser, 3 ) );
- entry->max = atol( mvcp_tokeniser_get_string( tokeniser, 4 ) );
- entry->size = atol( mvcp_tokeniser_get_string( tokeniser, 5 ) );
- entry->fps = atof( mvcp_tokeniser_get_string( tokeniser, 6 ) );
- }
- mvcp_tokeniser_close( tokeniser );
+ mvcp_list_parse( entry, line );
}
return error;
}