chiark / gitweb /
journal-remote: rework fd and writer reference handling
[elogind.git] / src / journal-remote / journal-remote-parse.h
index 2b6c24ef3ac3d0c6df4cb431b3ead393209fe80c..07d6ddb67feb5a4ad2abce61445a76f84f835f37 100644 (file)
@@ -33,8 +33,9 @@ typedef enum {
 } source_state;
 
 typedef struct RemoteSource {
-        charname;
+        char *name;
         int fd;
+        bool passive_fd;
 
         char *buf;
         size_t size;
@@ -47,16 +48,20 @@ typedef struct RemoteSource {
         source_state state;
         dual_timestamp ts;
 
+        Writer *writer;
+
         sd_event_source *event;
 } RemoteSource;
 
-static inline int source_non_empty(RemoteSource *source) {
+RemoteSource* source_new(int fd, bool passive_fd, char *name, Writer *writer);
+
+static inline size_t source_non_empty(RemoteSource *source) {
         assert(source);
 
-        return source->filled > 0;
+        return source->filled;
 }
 
 void source_free(RemoteSource *source);
 int process_data(RemoteSource *source);
 int push_data(RemoteSource *source, const char *data, size_t size);
-int process_source(RemoteSource *source, Writer *writer, bool compress, bool seal);
+int process_source(RemoteSource *source, bool compress, bool seal);