"Fossies" - the Fresh Open Source Software Archive 
Member "xorriso-1.5.4/libisofs/filter.h" (30 Jan 2021, 2148 Bytes) of package /linux/misc/xorriso-1.5.4.pl02.tar.gz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
For more information about "filter.h" see the
Fossies "Dox" file reference documentation.
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
34 struct filter_context {
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_*/