1 /* Ogginfo
2  *
3  * A tool to describe ogg file contents and metadata.
4  *
5  * Copyright 2002-2005 Michael Smith <msmith@xiph.org>
6  * Licensed under the GNU GPL, distributed with this program.
7  */
8 
9 /*No NLS support for now*/
10 #define _(X) (X)
11 
12 #ifdef HAVE_INTTYPES_H
13 # include <inttypes.h>
14 #endif
15 #ifndef PRId64
16 # if defined WIN32 || defined _WIN32
17 #  define PRId64 "I64d"
18 # else
19 #  define PRId64 "lld"
20 # endif
21 #endif
22 
23 typedef struct _stream_processor {
24     void (*process_page)(struct _stream_processor *, ogg_page *);
25     void (*process_end)(struct _stream_processor *);
26     int isillegal;
27     int constraint_violated;
28     int shownillegal;
29     int isnew;
30     long seqno;
31     int lostseq;
32     int seen_file_icons;
33 
34     int start;
35     int end;
36 
37     int num;
38     char *type;
39 
40     ogg_uint32_t serial; /* must be 32 bit unsigned */
41     ogg_stream_state os;
42     void *data;
43 } stream_processor;
44 
45 typedef struct {
46     stream_processor *streams;
47     int allocated;
48     int used;
49 
50     int in_headers;
51 } stream_set;
52 
53 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)
54 # define OI_FORMAT_PRINTF __attribute__((__format__(printf, 1, 2)))
55 #else
56 # define OI_FORMAT_PRINTF
57 #endif
58 
59 void oi_info(char *format, ...) OI_FORMAT_PRINTF;
60 void oi_warn(char *format, ...) OI_FORMAT_PRINTF;
61 void oi_error(char *format, ...) OI_FORMAT_PRINTF;
62 void check_xiph_comment(stream_processor *stream, int i, const char *comment, int comment_length);
63