| 1 |
/* Copyright (C) 2008 Vincent Penquerc'h. |
| 2 |
This file is part of the Kate codec library. |
| 3 |
Written by Vincent Penquerc'h. |
| 4 |
|
| 5 |
Use, distribution and reproduction of this library is governed |
| 6 |
by a BSD style source license included with this source in the |
| 7 |
file 'COPYING'. Please read these terms before distributing. */ |
| 8 |
|
| 9 |
|
| 10 |
#ifndef KATE_kstream_h_GUARD |
| 11 |
#define KATE_kstream_h_GUARD |
| 12 |
|
| 13 |
#include <stdio.h> |
| 14 |
#include <ogg/ogg.h> |
| 15 |
#include "kate/kate.h" |
| 16 |
|
| 17 |
enum { kstream_uninitialized, kstream_header_info, kstream_data, kstream_eos }; |
| 18 |
|
| 19 |
typedef struct kate_stream { |
| 20 |
ogg_stream_state os; |
| 21 |
kate_state k; |
| 22 |
kate_info ki; |
| 23 |
kate_comment kc; |
| 24 |
int init; |
| 25 |
char *filename; |
| 26 |
FILE *fout; |
| 27 |
unsigned int stream_index; |
| 28 |
int ret; |
| 29 |
void *data; |
| 30 |
} kate_stream; |
| 31 |
|
| 32 |
typedef struct { |
| 33 |
size_t n_kate_streams; |
| 34 |
kate_stream **kate_streams; |
| 35 |
} kate_stream_set; |
| 36 |
|
| 37 |
extern int kstream_init(kate_stream *ks,ogg_page *og,int stream_index); |
| 38 |
extern int kstream_clear(kate_stream *ks); |
| 39 |
extern char *get_filename(const char *basename,const kate_stream *ks,const kate_stream_set *streams); |
| 40 |
|
| 41 |
extern void init_kate_stream_set(kate_stream_set *streams); |
| 42 |
extern kate_stream *add_kate_stream(kate_stream_set *streams,ogg_page *og,int stream_index); |
| 43 |
extern kate_stream *find_kate_stream_for_page(kate_stream_set *streams,ogg_page *og); |
| 44 |
extern void remove_kate_stream(const kate_stream *ks,kate_stream_set *streams); |
| 45 |
extern void clear_and_remove_kate_stream(kate_stream *ks,kate_stream_set *streams); |
| 46 |
extern void clear_kate_stream_set(kate_stream_set *streams); |
| 47 |
extern kate_stream *find_kate_stream_for_file(kate_stream_set *streams,FILE *f); |
| 48 |
|
| 49 |
#endif |
| 50 |
|