5 #include "sd-journal.h"
9 ENTRY_CURSOR = 0, /* Nothing actually written yet. */
13 ENTRY_NEW_FIELD, /* In between fields. */
14 ENTRY_TEXT_FIELD, /* In the middle of a text field. */
15 ENTRY_BINARY_FIELD_START, /* Writing the name of a binary field. */
16 ENTRY_BINARY_FIELD_SIZE, /* Writing the size of a binary field. */
17 ENTRY_BINARY_FIELD, /* In the middle of a binary field. */
18 ENTRY_OUTRO, /* Writing '\n' */
19 ENTRY_DONE, /* Need to move to a new field. */
22 typedef struct Uploader {
24 sd_event_source *sigint_event, *sigterm_event;
29 char error[CURL_ERROR_SIZE];
30 struct curl_slist *header;
33 sd_event_source *input_event;
42 entry_state entry_state;
43 const void *field_data;
44 size_t field_pos, field_length;
47 const char *state_file;
50 char *last_cursor, *current_cursor;
53 #define JOURNAL_UPLOAD_POLL_TIMEOUT (10 * USEC_PER_SEC)
55 int start_upload(Uploader *u,
56 size_t (*input_callback)(void *ptr,
62 int open_journal_for_upload(Uploader *u,
67 void close_journal_input(Uploader *u);
68 int check_journal_input(Uploader *u);