#include <config.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <ctype.h>#include <fcntl.h>#include <errno.h>#include <unistd.h>#include <cmml.h>Defines | |
| #define | BUFSIZE 100000 |
Functions | |
| static void | PrintUsage (char *prog) |
| static int | read_stream (CMML *cmml, const CMML_Stream *stream, void *user_data) |
| static int | read_head (CMML *cmml, const CMML_Head *head, void *user_data) |
| static int | read_clip (CMML *cmml, const CMML_Clip *clip, void *user_data) |
| int | main (int argc, char *argv[]) |
Variables | |
| static FILE * | outfile |
Usage: cmml-fix [options] filename
Transform a sloppy CMML file to a valid one.
Possible options:
-i clip_id, --id clip_id
Start parsing from the named clip.
-s seconds, --sec seconds
Start parsing from the given seconds offset
-u utc, --utc utc
Start parsing from the given utc time
-o filename, --output filename
Specify the output filename. The file is written
to standard output by default.
-h, --help Display this help information
-v, --version Display version information
| #define BUFSIZE 100000 |
the size of the print buffer
| static void PrintUsage | ( | char * | prog | ) | [static] |
PrintUsage: prints out help on how to use this program
| prog | the program's name |
| static int read_stream | ( | CMML * | cmml, | |
| const CMML_Stream * | stream, | |||
| void * | user_data | |||
| ) | [static] |
read_stream: the callback for a stream element
| cmml | the CMML* handle in use | |
| stream | the stream element's content represented in a CMML_Stream* | |
| user_data | user defined data |
References BUFSIZE, cmml_error_snprint(), cmml_get_last_error(), cmml_stream_pretty_snprint(), and outfile.
read_head: the callback for a head element
| cmml | the CMML* handle in use | |
| head | the head element's content represented in a CMML_Head* | |
| user_data | user defined data |
References BUFSIZE, cmml_error_snprint(), cmml_get_last_error(), cmml_head_pretty_snprint(), and outfile.
read_clip: the callback for a clip element
| cmml | the CMML* handle in use | |
| clip | the clip element's content represented in a CMML_Clip* | |
| user_data | user defined data |
References BUFSIZE, cmml_clip_pretty_snprint(), cmml_error_snprint(), cmml_get_last_error(), and outfile.
| int main | ( | int | argc, | |
| char * | argv[] | |||
| ) |
main function of cmml-fix, which opens the CMML file, seeks to any given offsets, registers the callbacks, and then steps through the file in chunks of BUFSIZE size, during which the callbacks get activated as the relevant elements get parsed.
References BUFSIZE, cmml_close(), CMML_EOF, cmml_error_snprint(), cmml_get_last_error(), cmml_get_preamble(), cmml_new(), cmml_open(), cmml_preamble_snprint(), cmml_read(), cmml_set_read_callbacks(), cmml_set_sloppy(), cmml_skip_to_id(), cmml_skip_to_secs(), cmml_skip_to_utc(), outfile, PrintUsage(), read_clip(), read_head(), read_stream(), secs, and CMML_Error::type.
FILE* outfile [static] |
outfile: defines FILE pointer to print output to
Referenced by main(), read_clip(), read_head(), and read_stream().
1.5.5