aboutsummaryrefslogtreecommitdiff
path: root/README
diff options
context:
space:
mode:
Diffstat (limited to 'README')
-rw-r--r--README55
1 files changed, 1 insertions, 54 deletions
diff --git a/README b/README
index 368fa4e..7ab303b 100644
--- a/README
+++ b/README
@@ -10,6 +10,7 @@ keywords from common file-types.
10 10
11libextractor is a GNU package (http://www.gnu.org/). 11libextractor is a GNU package (http://www.gnu.org/).
12 12
13More detailed documentation is available in the GNU libextractor manual.
13 14
14 15
15extract 16extract
@@ -31,57 +32,3 @@ Dependencies
31When building libextractor binaries, please make sure all of these 32When building libextractor binaries, please make sure all of these
32dependencies are available. Otherwise the build system may 33dependencies are available. Otherwise the build system may
33automatically build only a subset of libextractor. 34automatically build only a subset of libextractor.
34
35
36
37Writing plugins
38===============
39
40
41If you want to write your own extractor for some filetype, all you
42need to do is write a little library that implements a single method
43with this signature:
44
45
46int
47EXTRACTOR_XXX_extract
48 (const char *data,
49 size_t data_size,
50 EXTRACTOR_MetaDataProcessor proc,
51 void *proc_cls,
52 const char * options);
53
54where XXX is the name of the library file that you will tell
55libextractor to load, minus the suffix. For example, if you link your
56extractor into a file called 'libextractor_my.so', the method above should
57be called 'EXTRACTOR_my_extract'.
58
59data is a pointer to the contents of the file and data_size is the
60size of data. The extract method must call the proc function with all
61of the meta data found.
62
63An example implementation can be found in mp3_extractor.c.
64
65
66
67Notes
68=====
69
70On Mac OS X, libextractor will avoid using GCC 3.1, because of
71problems compiling one of the extractors. GCC 3.3 and 2.95.2 are
72known to work well; as such, libextractor will first look for 3.3 (by
73attempting to run gcc-3.3, cpp-3.3, and g++-3.3) and then 2.95.2 (by
74attempting to run gcc2 and g++2).
75
76If libextractor fails to find the plugins, a possible method of last
77resort is to set the environment variable LIBEXTRACTOR_PREFIX to the
78parent of the directory where the plugins are installed (i.e., if the
79plugins are in "/foo/bar/lib/libextractor/*.so", set the variable to
80"/foo/bar/lib"). This should not be needed if "extract" is in
81"/foo/bar/bin/extract" and "/foo/bar/bin" is in the PATH, if you are
82running Linux and "libextractor.so" is in
83"/foo/bar/lib/libextractor.so", or if you are on linux and the binary
84using libextractor resides in "/foo/bar/bin", or if you are under
85Windows and "GetModuleFileName" returns "/foo/bar/bin". If none of
86these common circumstances apply, you may have to set the environment
87variable.