Script for Parsing Events p/daniel.roehrig/derenkernel
authorDaniel Röhrig <daniel.roehrig@mailbox.tu-berlin.de>
Mon, 9 Dec 2013 15:08:14 +0000 (16:08 +0100)
committerDaniel Röhrig <daniel.roehrig@mailbox.tu-berlin.de>
Mon, 9 Dec 2013 15:08:14 +0000 (16:08 +0100)
But not a very pretty one. Early Alpha quality.

framework/scripts/SIGNALS [new file with mode: 0644]
framework/scripts/parse_signals.sh [new file with mode: 0755]

diff --git a/framework/scripts/SIGNALS b/framework/scripts/SIGNALS
new file mode 100644 (file)
index 0000000..214695d
--- /dev/null
@@ -0,0 +1,2 @@
+ADMIT#42#void (fw_task_t *task);#A new task is admitted to the run queue
+SCHEDULE#13#void (void);#Shedule the next task
diff --git a/framework/scripts/parse_signals.sh b/framework/scripts/parse_signals.sh
new file mode 100755 (executable)
index 0000000..0f295ab
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+header="#include <fw_list.h>\n\n#ifndef FW_COMM_H_\n#define FW_COMM_H_\n"
+prototypes="/**"
+define=""
+footer="void fw_subscribe(topic_t topic, void *callback);\n\n\
+void fw_notify(topic_t topic, void *data);\n\n\
+void fw_init_comm(void);\n\n\
+#endif /* FW_COMM_H_ */"
+
+
+while read line
+do
+    NAME=$(echo $line | cut -d# -f1) 
+    NUM=$(echo $line | cut -d# -f2) 
+    PROTO=$(echo $line | cut -d# -f3) 
+    COMMENT=$(echo $line | cut -d# -f4) 
+
+    prototypes="$prototypes\n * $NAME: $PROTO"
+    define="$define\n#define $NAME $NUM"
+done < SIGNALS
+prototypes="$prototypes\n *\n */"
+echo $header
+echo $define
+echo "$prototypes"
+echo "$footer"