Reworked msg command to be easier to use. Added group messaging.

This commit is contained in:
2026-01-06 19:47:12 +01:00
parent 0bf6e710d4
commit 904efbd9b9
4 changed files with 177 additions and 161 deletions
+6 -8
View File
@@ -1,15 +1,13 @@
#include <stdlib.h>
#include <string.h>
static char alphs[] = {'-', '_', '0', '1', '2', '3', '4', '5', '6', '7', '8',
'9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u',
'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F',
'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q',
'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '\0'};
static char alphs[] = {'-', '_', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e',
'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '\0'};
// Generate an id used for messages. Could be less than 16 chars, but thats what
// fits into the `command` field of `msgbuf_t`.
// Generate an id used for messages.
// Could be less than 16 chars, but thats what fits into the `command` field of `msgbuf_t`.
void get_id(char *id_buf) {
int alph_size = strlen(alphs) - 1;