aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-07-24 19:48:28 +0000
committerChristian Grothoff <christian@grothoff.org>2012-07-24 19:48:28 +0000
commitc84dfab73816abe94060b6c784fef551d4bc6084 (patch)
tree126ea945f540076eff71ebaf0110b429098ca77b
parent23616b3c641d36b9faea97278fcfc91ca18f6d24 (diff)
downloadlibextractor-c84dfab73816abe94060b6c784fef551d4bc6084.tar.gz
libextractor-c84dfab73816abe94060b6c784fef551d4bc6084.zip
-getting plugin main to compile
-rw-r--r--src/main/TODO1
-rw-r--r--src/main/extractor.c47
2 files changed, 4 insertions, 44 deletions
diff --git a/src/main/TODO b/src/main/TODO
index 8324766..aa0a31a 100644
--- a/src/main/TODO
+++ b/src/main/TODO
@@ -1,4 +1,3 @@
1* extractor_plugin_main (a lot)
2* extractor_ipc.c (a bit) 1* extractor_ipc.c (a bit)
3* extractor.c (a lot) 2* extractor.c (a lot)
4* extractor_ipc_w32.c (a lot) 3* extractor_ipc_w32.c (a lot)
diff --git a/src/main/extractor.c b/src/main/extractor.c
index 12f3691..a381928 100644
--- a/src/main/extractor.c
+++ b/src/main/extractor.c
@@ -25,55 +25,13 @@
25#include <sys/types.h> 25#include <sys/types.h>
26#include <signal.h> 26#include <signal.h>
27#include <ltdl.h> 27#include <ltdl.h>
28
29#include "extractor_datasource.h" 28#include "extractor_datasource.h"
30#include "extractor_ipc.h" 29#include "extractor_ipc.h"
31#include "extractor_plugpath.h" 30#include "extractor_plugpath.h"
32#include "extractor_plugins.h" 31#include "extractor_plugins.h"
33 32
34/**
35 * Maximum length of a Mime-Type string.
36 */
37#define MAX_MIME_LEN 256
38
39/**
40 * Set to 1 to get failure info,
41 * 2 for actual debug info.
42 */
43#define DEBUG 1
44
45
46/**
47 * Writes 'size' bytes from 'buf' to 'fd', returns only when
48 * writing is not possible, or when all 'size' bytes were written
49 * (never does partial writes).
50 *
51 * @param fd fd to write into
52 * @param buf buffer to read from
53 * @param size number of bytes to write
54 * @return number of bytes written (that is 'size'), or -1 on error
55 */
56ssize_t
57EXTRACTOR_write_all_ (int fd,
58 const void *buf,
59 size_t size)
60{
61 const char *data = buf;
62 size_t off = 0;
63 ssize_t ret;
64
65 while (off < size)
66 {
67 ret = write (fd, &data[off], size - off);
68 if (ret <= 0)
69 return -1;
70 off += ret;
71 }
72 return size;
73}
74
75
76 33
34#if 0
77/** 35/**
78 * Open a file 36 * Open a file
79 */ 37 */
@@ -528,6 +486,9 @@ load_in_process_plugin (struct EXTRACTOR_PluginList *plugin)
528 break; 486 break;
529 } 487 }
530} 488}
489#endif
490
491
531 492
532 493
533/** 494/**