aboutsummaryrefslogtreecommitdiff
path: root/src/main/extractor_datasource.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/extractor_datasource.h')
-rw-r--r--src/main/extractor_datasource.h28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/main/extractor_datasource.h b/src/main/extractor_datasource.h
index f25cc4b..dc548a6 100644
--- a/src/main/extractor_datasource.h
+++ b/src/main/extractor_datasource.h
@@ -29,7 +29,7 @@
29 29
30/** 30/**
31 * Handle to a datasource we can use for the plugins. 31 * Handle to a datasource we can use for the plugins.
32 */ 32 */
33struct EXTRACTOR_Datasource; 33struct EXTRACTOR_Datasource;
34 34
35 35
@@ -43,7 +43,8 @@ struct EXTRACTOR_Datasource;
43 */ 43 */
44struct EXTRACTOR_Datasource * 44struct EXTRACTOR_Datasource *
45EXTRACTOR_datasource_create_from_file_ (const char *filename, 45EXTRACTOR_datasource_create_from_file_ (const char *filename,
46 EXTRACTOR_MetaDataProcessor proc, void *proc_cls); 46 EXTRACTOR_MetaDataProcessor proc,
47 void *proc_cls);
47 48
48 49
49/** 50/**
@@ -57,8 +58,9 @@ EXTRACTOR_datasource_create_from_file_ (const char *filename,
57 */ 58 */
58struct EXTRACTOR_Datasource * 59struct EXTRACTOR_Datasource *
59EXTRACTOR_datasource_create_from_buffer_ (const char *buf, 60EXTRACTOR_datasource_create_from_buffer_ (const char *buf,
60 size_t size, 61 size_t size,
61 EXTRACTOR_MetaDataProcessor proc, void *proc_cls); 62 EXTRACTOR_MetaDataProcessor proc,
63 void *proc_cls);
62 64
63 65
64/** 66/**
@@ -81,14 +83,14 @@ EXTRACTOR_datasource_destroy_ (struct EXTRACTOR_Datasource *ds);
81 */ 83 */
82ssize_t 84ssize_t
83EXTRACTOR_datasource_read_ (void *cls, 85EXTRACTOR_datasource_read_ (void *cls,
84 void *data, 86 void *data,
85 size_t size); 87 size_t size);
86 88
87 89
88/** 90/**
89 * Seek in the datasource. Use 'SEEK_CUR' for whence and 'pos' of 0 to 91 * Seek in the datasource. Use 'SEEK_CUR' for whence and 'pos' of 0 to
90 * obtain the current position in the file. 92 * obtain the current position in the file.
91 * 93 *
92 * @param cls must be a 'struct EXTRACTOR_Datasource' 94 * @param cls must be a 'struct EXTRACTOR_Datasource'
93 * @param pos position to seek (see 'man lseek')o 95 * @param pos position to seek (see 'man lseek')o
94 * @param whence how to see (absolute to start, relative, absolute to end) 96 * @param whence how to see (absolute to start, relative, absolute to end)
@@ -97,20 +99,20 @@ EXTRACTOR_datasource_read_ (void *cls,
97 */ 99 */
98int64_t 100int64_t
99EXTRACTOR_datasource_seek_ (void *cls, 101EXTRACTOR_datasource_seek_ (void *cls,
100 int64_t pos, 102 int64_t pos,
101 int whence); 103 int whence);
102 104
103 105
104/** 106/**
105 * Determine the overall size of the data source (after compression). 107 * Determine the overall size of the data source (after compression).
106 * 108 *
107 * @param cls must be a 'struct EXTRACTOR_Datasource' 109 * @param cls must be a 'struct EXTRACTOR_Datasource'
108 * @param force force computing the size if it is unavailable 110 * @param force force computing the size if it is unavailable
109 * @return overall file size, -1 on error or unknown 111 * @return overall file size, -1 on error or unknown
110 */ 112 */
111int64_t 113int64_t
112EXTRACTOR_datasource_get_size_ (void *cls, 114EXTRACTOR_datasource_get_size_ (void *cls,
113 int force); 115 int force);
114 116
115 117
116#endif 118#endif