printf("stack: %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n",
stack[0], stack[1], stack[2], stack[3], stack[4],
stack[5], stack[6], stack[7], stack[8], stack[9]);
+
switch(program[pc++]){
case BCNOP: trace("nop\n");
break;
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <strings.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/time.h>
{
struct sockaddr_in sa;
- bzero((char *) &sa, sizeof(sa));
+ memset(&sa, 0, sizeof(sa));
sa.sin_family = AF_INET;
sa.sin_addr.s_addr = INADDR_ANY;
sa.sin_port = htons(port);
opti++;
}
+ //Initialize systems
+ sds_init();
+ task_init();
+
+ //Open communication
open_filedescriptors();
write(fd, "\n", 1);
struct sds sdss[MAXSDSS];
uint8_t c;
+void sds_init()
+{
+ memset(&sdss, 0, sizeof(struct sds)*MAXSDSS);
+}
+
void sds_register(int fd)
{
uint8_t cs;
bool used;
};
+void sds_init();
void sds_register(int fd);
bool sds_update(int fd);
void sds_publish(int id, int fd);
#include "misc.h"
#include "task.h"
-struct task tasks[MAXTASKS];// = {0};
+struct task tasks[MAXTASKS];
uint8_t c;
+void task_init()
+{
+ memset(&tasks, 0, sizeof(struct task)*MAXTASKS);
+}
+
int task_register(int fd)
{
uint8_t ct;
bool used;
};
+void task_init();
int task_register(int fd);
void task_delete(int fd);
struct task *task_get(int num);
toByteVal :: BC -> [Char]
toByteVal b
-# bt = toChar $ consIndex{|*|} b + 1
+# bt = toChar $ consIndex{|*|} b
= [bt:case b of
(BCPush i) = i
(BCLab i) = [toChar i]