xorriso  1.5.4.pl02
About: GNU xorriso creates, loads, manipulates and writes ISO 9660 filesystem images with Rock Ridge extensions. It is suitable for incremental data backup and for production of bootable ISO 9660 images. GNU xorriso is a statical compilation of the libraries libburn, libisofs, libisoburn, and libjte.
  Fossies Dox: xorriso-1.5.4.pl02.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

filter.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008 Vreixo Formoso
3  *
4  * This file is part of the libisofs project; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License version 2
6  * or later as published by the Free Software Foundation.
7  * See COPYING file for details.
8  */
9 #ifndef LIBISO_FILTER_H_
10 #define LIBISO_FILTER_H_
11 
12 /*
13  * Definitions of filters.
14  */
15 
16 
17 /* dev_id for stream identification */
18 
19 /* libisofs/filters/xor_encrypt.c */
20 #define XOR_ENCRYPT_DEV_ID 1
21 
22 /* libisofs/filters/external.c */
23 #define ISO_FILTER_EXTERNAL_DEV_ID 2
24 
25 /* libisofs/filters/zisofs.c */
26 #define ISO_FILTER_ZISOFS_DEV_ID 3
27 
28 /* libisofs/filters/gzip.c */
29 #define ISO_FILTER_GZIP_DEV_ID 4
30 
31 
32 typedef struct filter_context FilterContext;
33 
35  int version; /* reserved for future usage, set to 0 */
36  int refcount;
37 
38  /** filter specific shared data */
39  void *data;
40 
41  /**
42  * Factory method to create a filtered stream from another stream.
43  *
44  * @param original
45  * The original stream to be filtered. If the filter needs a ref to
46  * it (most cases), it should take a ref to it with iso_stream_ref().
47  * @param filtered
48  * Will be filled with the filtered IsoStream (reference belongs to
49  * caller).
50  * @return
51  * 1 on success, < 0 on error
52  */
53  int (*get_filter)(FilterContext *filter, IsoStream *original,
54  IsoStream **filtered);
55 
56  /**
57  * Free implementation specific data. Should never be called by user.
58  * Use iso_filter_unref() instead.
59  */
60  void (*free)(FilterContext *filter);
61 };
62 
63 /**
64  *
65  * @param flag
66  * Reserved for future usage, pass always 0 for now.
67  * TODO in a future a different value can mean filter caching, where
68  * the filter is applied once and the filtered file is stored in a temp
69  * dir. This prevent filter to be applied several times.
70  */
71 int iso_file_add_filter(IsoFile *file, FilterContext *filter, int flag);
72 
73 void iso_filter_ref(FilterContext *filter);
74 void iso_filter_unref(FilterContext *filter);
75 
76 #endif /*LIBISO_FILTER_H_*/
void iso_filter_unref(FilterContext *filter)
Definition: filter.c:25
void iso_filter_ref(FilterContext *filter)
Definition: filter.c:20
int iso_file_add_filter(IsoFile *file, FilterContext *filter, int flag)
Definition: filter.c:33
Definition: node.h:149
void(* free)(FilterContext *filter)
Definition: filter.h:60
int refcount
Definition: filter.h:36
int version
Definition: filter.h:35
int(* get_filter)(FilterContext *filter, IsoStream *original, IsoStream **filtered)
Definition: filter.h:53
void * data
Definition: filter.h:39