%: %.gen
./$^ $o
-hostside: hostside.o serialio.o client.o obc.o commands.o utils.o \
- nmra.o encode.o retransmit.o output.o auproto-pic.o \
- parseutils.o \
- record-l.o record-y.o record.o \
- -loop
- $(LINK)
-
clean:
rm -f *.o *.d $(TARGETS) selectors.h
rm -f auproto-pic.h *~ core proto-expanded
+++ /dev/null
-/**/
-
-#include <stdarg.h>
-#include <string.h>
-#include <stdlib.h>
-#include <errno.h>
-
-#include "multiplex.h"
-#include "../layout/dlist.h"
-
-struct ClientList clients;
-
-static void new_client(int fd, OutBufferError error,
- char *desc, Selector default_selectors) {
- Client *cl;
- int r;
-
- cl= mmalloc(sizeof(*cl));
- cl->sel= default_selectors;
-
- cl->ci.out.desc= desc;
- cl->ci.out.fd= fd;
- cl->ci.out.error= error;
- cmdin_new(&cl->ci);
-
- LIST_LINK_TAIL(clients, cl);
-}
-
-static void stdin_error(OutBufferChain *ch, const char *e1, const char *e2) {
- if (!e1)
- exit(0);
- fprintf(stderr,"stdin: %s: %s\n", e1, e2);
- exit(12);
-}
-
-void stdin_client(void) {
- new_client(0, stdin_error, (char*)"stdin", sel_picio|sel_picioh);
-}
+++ /dev/null
-/*
- */
-
-FIXME this should go in a config file
-
-#include "realtime.h"
-
-#define NOTA_TRAIN { 0,0,0,0, "internal-error-not-a-train" }
-
-#define SPEED_MMS2INTERN(mms /* mm/s */) \
- (((mms) * SPEED_UNIT + 999) / 1000)
-
-const TrainInfo info_trains[]= {
- /* data here is all made up ! */
- NOTA_TRAIN,
- { SPEED_MMS2INTERN(1000), 20, 900, 20 },
- { SPEED_MMS2INTERN(400), 10, 50, 10 },
- { 0,0,0,0,0 }
-};
+++ /dev/null
-void vbadcmd(ParseState *ps, const char *fmt, va_list al) {
- voerror(&ps->ci->out,fmt,al);
-}
-
+++ /dev/null
-/*
- * mulitplexer daemon
- * transmissions to clients of their selected messages
- */
-
-#include <string.h>
-#include <stdarg.h>
-
-#include "multiplex.h"
-#include "auproto-pic.h"
-
-#define FOR_CLS(s) do{ \
- Client *cl, *next_cl; \
- for (cl= clients.head; \
- cl; \
- cl= next_cl) { \
- OutBufferChain *ch= &cl->ch; \
- next_cl= cl->next; \
- if (!(sel & cl->sel)) continue; \
- s; \
- } \
- }while(0)
-
-void sovprintf(Selector sel, const char *fmt, va_list al) {
- FOR_CLS( ovprintf(ch, fmt, al) );
-}
-
-void soprintf(Selector sel, const char *fmt, ...)
- { va_list al; va_start(al,fmt); sovprintf(sel,fmt,al); va_end(al); }
-
-void sowrite(Selector sel, const char *data, int l) {
- FOR_CLS( owrite(ch, data, l) );
-}