From 3d0532862ce14cbf9fb8f11a2ca1485be46e3fd6 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Mon, 28 Apr 2014 06:18:31 +0800 Subject: [PATCH] Added a specification for the "Session" interface --- Makefile | 1 + data/Init.interface | 1 - data/Makefile | 3 +++ data/Session.interface | 25 +++++++++++++++++++++++++ data/project.conf | 5 ++++- src/Makefile | 7 +++++-- src/project.conf | 7 ++++++- 7 files changed, 44 insertions(+), 5 deletions(-) create mode 100644 data/Session.interface diff --git a/Makefile b/Makefile index 7387c4a..5fc6e96 100644 --- a/Makefile +++ b/Makefile @@ -23,6 +23,7 @@ dist: @$(TAR) $(PACKAGE)-$(VERSION).tar.gz -- \ $(PACKAGE)-$(VERSION)/data/Makefile \ $(PACKAGE)-$(VERSION)/data/Init.interface \ + $(PACKAGE)-$(VERSION)/data/Session.interface \ $(PACKAGE)-$(VERSION)/data/appbroker.sh \ $(PACKAGE)-$(VERSION)/data/project.conf \ $(PACKAGE)-$(VERSION)/include/Makefile \ diff --git a/data/Init.interface b/data/Init.interface index ea77d85..3861776 100644 --- a/data/Init.interface +++ b/data/Init.interface @@ -1,6 +1,5 @@ #$Id$ service=Init -port=4241 [call::login] ret=UINT16 diff --git a/data/Makefile b/data/Makefile index f5838af..74fa5d3 100644 --- a/data/Makefile +++ b/data/Makefile @@ -14,8 +14,11 @@ distclean: clean install: $(MKDIR) $(DESTDIR)$(PREFIX)/etc/AppInterface $(INSTALL) -m 0644 Init.interface $(DESTDIR)$(PREFIX)/etc/AppInterface/Init.interface + $(MKDIR) $(DESTDIR)$(PREFIX)/etc/AppInterface + $(INSTALL) -m 0644 Session.interface $(DESTDIR)$(PREFIX)/etc/AppInterface/Session.interface uninstall: $(RM) -- $(DESTDIR)$(PREFIX)/etc/AppInterface/Init.interface + $(RM) -- $(DESTDIR)$(PREFIX)/etc/AppInterface/Session.interface .PHONY: all clean distclean install uninstall diff --git a/data/Session.interface b/data/Session.interface new file mode 100644 index 0000000..5f3a1fe --- /dev/null +++ b/data/Session.interface @@ -0,0 +1,25 @@ +#$Id$ +service=Session + +#Session::list +# returns an array of the AppServers registered +#[call::list] +#FIXME arrays are not implemented yet +#ret=STRING[] + +#Session::lookup +# arg1 the name of an AppServer to reach +# returns the AppProtocol name where to locate the AppServer +[call::lookup] +ret=STRING +arg1=STRING + +#Session::register +# arg1 the name of an AppServer to register +# arg2 the AppProtocol name where to locate the AppServer +# returns TRUE if successful, FALSE otherwise +[call::register] +#XXX return a STRING containing the error instead? +ret=BOOL +arg1=STRING +arg2=STRING diff --git a/data/project.conf b/data/project.conf index dcfdd26..409f770 100644 --- a/data/project.conf +++ b/data/project.conf @@ -1,4 +1,7 @@ -dist=Makefile,Init.interface,appbroker.sh +dist=Makefile,Init.interface,Session.interface,appbroker.sh [Init.interface] install=$(PREFIX)/etc/AppInterface + +[Session.interface] +install=$(PREFIX)/etc/AppInterface diff --git a/src/Makefile b/src/Makefile index fb1de31..20967ae 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,4 +1,4 @@ -TARGETS = ../include/Init.h Init +TARGETS = ../include/Init.h ../include/Session.h Init PREFIX = /usr/local DESTDIR = BINDIR = $(PREFIX)/bin @@ -21,6 +21,9 @@ all: $(TARGETS) ../include/Init.h: ../data/Init.interface ../data/appbroker.sh -P "$(PREFIX)" -- "../include/Init.h" +../include/Session.h: ../data/Session.interface + ../data/appbroker.sh -P "$(PREFIX)" -- "../include/Session.h" + Init_OBJS = init.o main.o service.o session.o Init_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS) Init_LDFLAGS = $(LDFLAGSF) $(LDFLAGS) @@ -41,7 +44,7 @@ session.o: session.c $(CC) $(Init_CFLAGS) -c session.c clean: - $(RM) -- $(../include/Init.h_OBJS) $(Init_OBJS) + $(RM) -- $(../include/Init.h_OBJS) $(../include/Session.h_OBJS) $(Init_OBJS) distclean: clean $(RM) -- $(TARGETS) diff --git a/src/project.conf b/src/project.conf index cfd3f23..622180f 100644 --- a/src/project.conf +++ b/src/project.conf @@ -1,4 +1,4 @@ -targets=../include/Init.h,Init +targets=../include/Init.h,../include/Session.h,Init cflags_force=-W `pkg-config --cflags libApp` cflags=-Wall -g -O2 -pedantic ldflags_force=`pkg-config --libs libApp` -Wl,--export-dynamic @@ -10,6 +10,11 @@ type=script script=../data/appbroker.sh depends=../data/Init.interface +[../include/Session.h] +type=script +script=../data/appbroker.sh +depends=../data/Session.interface + [Init] type=binary sources=init.c,main.c,service.c,session.c