aboutsummaryrefslogtreecommitdiff
path: root/src/main/extractor_ipc.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/extractor_ipc.h')
-rw-r--r--src/main/extractor_ipc.h57
1 files changed, 30 insertions, 27 deletions
diff --git a/src/main/extractor_ipc.h b/src/main/extractor_ipc.h
index 0109b66..8e7fe09 100644
--- a/src/main/extractor_ipc.h
+++ b/src/main/extractor_ipc.h
@@ -27,7 +27,7 @@
27 * as follows. Each message begins with a 1-character opcode which 27 * as follows. Each message begins with a 1-character opcode which
28 * specifies the message type. The main library starts the plugins 28 * specifies the message type. The main library starts the plugins
29 * by forking the helper process and establishes two pipes for 29 * by forking the helper process and establishes two pipes for
30 * communication in both directions. 30 * communication in both directions.
31 * First, the main library send an 'INIT_STATE' message 31 * First, the main library send an 'INIT_STATE' message
32 * to the plugin. The start message specifies the name (and size) 32 * to the plugin. The start message specifies the name (and size)
33 * of a shared memory segment which will contain parts of the (uncompressed) 33 * of a shared memory segment which will contain parts of the (uncompressed)
@@ -39,7 +39,7 @@
39 * size of the file (or -1 if unknown) and the number of bytes 39 * size of the file (or -1 if unknown) and the number of bytes
40 * ready in the shared memory segment. The plugin then answers 40 * ready in the shared memory segment. The plugin then answers
41 * with either: 41 * with either:
42 * 1) MESSAGE_DONE to indicate that no further processing is 42 * 1) MESSAGE_DONE to indicate that no further processing is
43 * required for this file; the IPC continues with the 43 * required for this file; the IPC continues with the
44 * EXTRACT_START message for the next file afterwards; 44 * EXTRACT_START message for the next file afterwards;
45 * 2) MESSAGE_SEEK to indicate that the plugin would like to 45 * 2) MESSAGE_SEEK to indicate that the plugin would like to
@@ -161,7 +161,7 @@ struct StartMessage
161 161
162/** 162/**
163 * Sent from LE to a plugin to tell it that shm contents 163 * Sent from LE to a plugin to tell it that shm contents
164 * were updated. 164 * were updated.
165 */ 165 */
166#define MESSAGE_UPDATED_SHM 0x02 166#define MESSAGE_UPDATED_SHM 0x02
167 167
@@ -245,7 +245,7 @@ struct SeekRequestMessage
245 /** 245 /**
246 * Requested offset; a positive value from the end of the 246 * Requested offset; a positive value from the end of the
247 * file is used of 'whence' is SEEK_END; a postive value 247 * file is used of 'whence' is SEEK_END; a postive value
248 * from the start is used of 'whence' is SEEK_SET. 248 * from the start is used of 'whence' is SEEK_SET.
249 * 'SEEK_CUR' is never used. 249 * 'SEEK_CUR' is never used.
250 */ 250 */
251 uint64_t file_offset; 251 uint64_t file_offset;
@@ -292,9 +292,9 @@ struct MetaMessage
292 */ 292 */
293 uint32_t value_size; 293 uint32_t value_size;
294 294
295 /* followed by mime_length bytes of 0-terminated 295 /* followed by mime_length bytes of 0-terminated
296 mime-type (unless mime_length is 0) */ 296 mime-type (unless mime_length is 0) */
297 297
298 /* followed by value_size bytes of value */ 298 /* followed by value_size bytes of value */
299 299
300}; 300};
@@ -355,7 +355,7 @@ EXTRACTOR_IPC_shared_memory_destroy_ (struct EXTRACTOR_SharedMemory *shm);
355 */ 355 */
356unsigned int 356unsigned int
357EXTRACTOR_IPC_shared_memory_change_rc_ (struct EXTRACTOR_SharedMemory *shm, 357EXTRACTOR_IPC_shared_memory_change_rc_ (struct EXTRACTOR_SharedMemory *shm,
358 int delta); 358 int delta);
359 359
360 360
361/** 361/**
@@ -369,9 +369,9 @@ EXTRACTOR_IPC_shared_memory_change_rc_ (struct EXTRACTOR_SharedMemory *shm,
369 */ 369 */
370ssize_t 370ssize_t
371EXTRACTOR_IPC_shared_memory_set_ (struct EXTRACTOR_SharedMemory *shm, 371EXTRACTOR_IPC_shared_memory_set_ (struct EXTRACTOR_SharedMemory *shm,
372 struct EXTRACTOR_Datasource *ds, 372 struct EXTRACTOR_Datasource *ds,
373 uint64_t off, 373 uint64_t off,
374 size_t size); 374 size_t size);
375 375
376 376
377/** 377/**
@@ -391,10 +391,10 @@ EXTRACTOR_datasource_get_pos_ (struct EXTRACTOR_Datasource *ds);
391 * @param plugin the plugin 391 * @param plugin the plugin
392 * @param shm memory to share with the process 392 * @param shm memory to share with the process
393 * @return NULL on error, otherwise IPC channel 393 * @return NULL on error, otherwise IPC channel
394 */ 394 */
395struct EXTRACTOR_Channel * 395struct EXTRACTOR_Channel *
396EXTRACTOR_IPC_channel_create_ (struct EXTRACTOR_PluginList *plugin, 396EXTRACTOR_IPC_channel_create_ (struct EXTRACTOR_PluginList *plugin,
397 struct EXTRACTOR_SharedMemory *shm); 397 struct EXTRACTOR_SharedMemory *shm);
398 398
399 399
400/** 400/**
@@ -418,8 +418,8 @@ EXTRACTOR_IPC_channel_destroy_ (struct EXTRACTOR_Channel *channel);
418 */ 418 */
419ssize_t 419ssize_t
420EXTRACTOR_IPC_channel_send_ (struct EXTRACTOR_Channel *channel, 420EXTRACTOR_IPC_channel_send_ (struct EXTRACTOR_Channel *channel,
421 const void *data, 421 const void *data,
422 size_t size); 422 size_t size);
423 423
424 424
425/** 425/**
@@ -434,12 +434,15 @@ EXTRACTOR_IPC_channel_send_ (struct EXTRACTOR_Channel *channel,
434 * @param value_len number of bytes in 'value' 434 * @param value_len number of bytes in 'value'
435 */ 435 */
436typedef void (*EXTRACTOR_ChannelMessageProcessor) (void *cls, 436typedef void (*EXTRACTOR_ChannelMessageProcessor) (void *cls,
437 struct EXTRACTOR_PluginList *plugin, 437 struct EXTRACTOR_PluginList *
438 enum EXTRACTOR_MetaType meta_type, 438 plugin,
439 enum EXTRACTOR_MetaFormat meta_format, 439 enum EXTRACTOR_MetaType
440 const char *mime, 440 meta_type,
441 const void *value, 441 enum EXTRACTOR_MetaFormat
442 size_t value_len); 442 meta_format,
443 const char *mime,
444 const void *value,
445 size_t value_len);
443 446
444 447
445/** 448/**
@@ -454,10 +457,10 @@ typedef void (*EXTRACTOR_ChannelMessageProcessor) (void *cls,
454 */ 457 */
455ssize_t 458ssize_t
456EXTRACTOR_IPC_process_reply_ (struct EXTRACTOR_PluginList *plugin, 459EXTRACTOR_IPC_process_reply_ (struct EXTRACTOR_PluginList *plugin,
457 const void *data, 460 const void *data,
458 size_t size, 461 size_t size,
459 EXTRACTOR_ChannelMessageProcessor proc, 462 EXTRACTOR_ChannelMessageProcessor proc,
460 void *proc_cls); 463 void *proc_cls);
461 464
462 465
463/** 466/**
@@ -473,9 +476,9 @@ EXTRACTOR_IPC_process_reply_ (struct EXTRACTOR_PluginList *plugin,
473 */ 476 */
474int 477int
475EXTRACTOR_IPC_channel_recv_ (struct EXTRACTOR_Channel **channels, 478EXTRACTOR_IPC_channel_recv_ (struct EXTRACTOR_Channel **channels,
476 unsigned int num_channels, 479 unsigned int num_channels,
477 EXTRACTOR_ChannelMessageProcessor proc, 480 EXTRACTOR_ChannelMessageProcessor proc,
478 void *proc_cls); 481 void *proc_cls);
479 482
480 483
481#endif 484#endif