From: ian Date: Sun, 4 May 2008 16:01:24 +0000 (+0000) Subject: remove obsolete stuff X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=12d66668dd84be5c13965dd5b825a86cb90e93e3;p=trains.git remove obsolete stuff --- diff --git a/hostside/Makefile b/hostside/Makefile index 019e724..168b18e 100644 --- a/hostside/Makefile +++ b/hostside/Makefile @@ -71,13 +71,6 @@ safety: safety.o utils.o trackloc.o ../layout/ours.layout-data.o %: %.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 diff --git a/hostside/client.c b/hostside/client.c deleted file mode 100644 index 8b3a24a..0000000 --- a/hostside/client.c +++ /dev/null @@ -1,38 +0,0 @@ -/**/ - -#include -#include -#include -#include - -#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); -} diff --git a/hostside/dummy-trains.c b/hostside/dummy-trains.c deleted file mode 100644 index f03295a..0000000 --- a/hostside/dummy-trains.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - */ - -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 } -}; diff --git a/hostside/multiplex.c b/hostside/multiplex.c deleted file mode 100644 index 1d30794..0000000 --- a/hostside/multiplex.c +++ /dev/null @@ -1,4 +0,0 @@ -void vbadcmd(ParseState *ps, const char *fmt, va_list al) { - voerror(&ps->ci->out,fmt,al); -} - diff --git a/hostside/output.c b/hostside/output.c deleted file mode 100644 index e69de29..0000000 diff --git a/hostside/selectout.c b/hostside/selectout.c deleted file mode 100644 index 4f470d0..0000000 --- a/hostside/selectout.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - * mulitplexer daemon - * transmissions to clients of their selected messages - */ - -#include -#include - -#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) ); -}