aboutsummaryrefslogtreecommitdiff
path: root/src/pipe.c
diff options
context:
space:
mode:
authorne_mene <[email protected]>2026-03-01 15:54:19 +0100
committerne_mene <[email protected]>2026-03-01 15:54:19 +0100
commit915b623c32d3edb881d248153706338e7ae9054c (patch)
treee48e5d607ef4e1904da76f4cf86bd8a61f476250 /src/pipe.c
parent41175c11234c0a2a83257beb86694f3af129a689 (diff)
create, layout and example bar
Diffstat (limited to 'src/pipe.c')
-rw-r--r--src/pipe.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/pipe.c b/src/pipe.c
index 88006a4..edce5de 100644
--- a/src/pipe.c
+++ b/src/pipe.c
@@ -1,10 +1,14 @@
-#include "pipe.h"
+
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/stat.h>
+#include <string.h>
#include <ctype.h>
+#include "pipe.h"
+#include "bardata.h"
+
FILE *named_pipe;
void init_pipe() {
@@ -25,9 +29,9 @@ void await_change() {
printf("Received: %s\n", buff);
int argc = 0, chr_on = 0, i = 0;
- char argv[4][256];
+ char argv[MAX_ARGS][MAX_ARG_LEN];
- while (argc < 4) {
+ while (argc < MAX_ARGS) {
char chr = buff[i];
if (chr == '\0') {
break;
@@ -58,4 +62,13 @@ void make_change(char argv[MAX_ARGS][MAX_ARG_LEN], int argc) {
for (int i = 0; i < argc; i++) {
printf("Arg %d: %s\n", i + 1, argv[i]);
}
+
+ char *cmd = argv[0];
+ if (strcmp(cmd, "create") == 0) {
+ new_component(argv[1]);
+ return;
+ }
+ if (strcmp(cmd, "layout") == 0) {
+ set_layout(argv, argc);
+ }
}