summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/librcscripts/api/dynbuf.h')
-rw-r--r--src/core/librcscripts/api/dynbuf.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/core/librcscripts/api/dynbuf.h b/src/core/librcscripts/api/dynbuf.h
index 3b0049e..5c937b6 100644
--- a/src/core/librcscripts/api/dynbuf.h
+++ b/src/core/librcscripts/api/dynbuf.h
@@ -33,21 +33,24 @@ typedef struct
size_t length; /* Length of data block */
size_t rd_index; /* Current read index */
size_t wr_index; /* Current write index */
+ bool file_map; /* File mapped as dynbuf */
} dyn_buf_t;
dyn_buf_t *new_dyn_buf (void);
-void free_dyn_buf (dyn_buf_t * dynbuf);
+dyn_buf_t *new_dyn_buf_mmap_file (const char *name);
-int write_dyn_buf (dyn_buf_t * dynbuf, const char *buf, size_t length);
+void free_dyn_buf (dyn_buf_t *dynbuf);
-int write_dyn_buf_from_fd (int fd, dyn_buf_t * dynbuf, size_t length);
+int write_dyn_buf (dyn_buf_t *dynbuf, const char *buf, size_t length);
-int sprintf_dyn_buf (dyn_buf_t * dynbuf, const char *format, ...);
+int write_dyn_buf_from_fd (int fd, dyn_buf_t *dynbuf, size_t length);
-int read_dyn_buf (dyn_buf_t * dynbuf, char *buf, size_t length);
+int sprintf_dyn_buf (dyn_buf_t *dynbuf, const char *format, ...);
-int read_dyn_buf_to_fd (int fd, dyn_buf_t * dynbuf, size_t length);
+int read_dyn_buf (dyn_buf_t *dynbuf, char *buf, size_t length);
+
+int read_dyn_buf_to_fd (int fd, dyn_buf_t *dynbuf, size_t length);
char *read_line_dyn_buf (dyn_buf_t *dynbuf);