utils: add key-value offset support to get_cmdline_val()
[project/procd.git] / utils / utils.h
index 37fa2167eed00019bd90f831234d23c590a1f725..d0c621e796e6c84182a9bc69be27a83f0aab3a11 100644 (file)
@@ -19,6 +19,8 @@
 #include <libubox/blob.h>
 #include <libubox/blobmsg.h>
 
+#define CMDLINE_SIZE 2048
+
 struct blobmsg_list_node {
        struct avl_node avl;
        struct blob_attr *data;
@@ -49,5 +51,13 @@ int blobmsg_list_fill(struct blobmsg_list *list, void *data, int len, bool array
 void blobmsg_list_free(struct blobmsg_list *list);
 bool blobmsg_list_equal(struct blobmsg_list *l1, struct blobmsg_list *l2);
 void blobmsg_list_move(struct blobmsg_list *list, struct blobmsg_list *src);
+char *get_cmdline_val_offset(const char *name, char *out, int len, int offset);
+char *get_active_console(char *out, int len);
+
+#define get_cmdline_val(name, out, len) \
+       get_cmdline_val_offset(name, out, len, 0)
+
+int patch_fd(const char *device, int fd, int flags);
+int patch_stdio(const char *device);
 
 #endif