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