Added a specification for the "Session" interface

This commit is contained in:
Pierre Pronchery 2014-04-28 06:18:31 +08:00
parent c1ec36ae7a
commit 3d0532862c
7 changed files with 44 additions and 5 deletions

View File

@ -23,6 +23,7 @@ dist:
@$(TAR) $(PACKAGE)-$(VERSION).tar.gz -- \ @$(TAR) $(PACKAGE)-$(VERSION).tar.gz -- \
$(PACKAGE)-$(VERSION)/data/Makefile \ $(PACKAGE)-$(VERSION)/data/Makefile \
$(PACKAGE)-$(VERSION)/data/Init.interface \ $(PACKAGE)-$(VERSION)/data/Init.interface \
$(PACKAGE)-$(VERSION)/data/Session.interface \
$(PACKAGE)-$(VERSION)/data/appbroker.sh \ $(PACKAGE)-$(VERSION)/data/appbroker.sh \
$(PACKAGE)-$(VERSION)/data/project.conf \ $(PACKAGE)-$(VERSION)/data/project.conf \
$(PACKAGE)-$(VERSION)/include/Makefile \ $(PACKAGE)-$(VERSION)/include/Makefile \

View File

@ -1,6 +1,5 @@
#$Id$ #$Id$
service=Init service=Init
port=4241
[call::login] [call::login]
ret=UINT16 ret=UINT16

View File

@ -14,8 +14,11 @@ distclean: clean
install: install:
$(MKDIR) $(DESTDIR)$(PREFIX)/etc/AppInterface $(MKDIR) $(DESTDIR)$(PREFIX)/etc/AppInterface
$(INSTALL) -m 0644 Init.interface $(DESTDIR)$(PREFIX)/etc/AppInterface/Init.interface $(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: uninstall:
$(RM) -- $(DESTDIR)$(PREFIX)/etc/AppInterface/Init.interface $(RM) -- $(DESTDIR)$(PREFIX)/etc/AppInterface/Init.interface
$(RM) -- $(DESTDIR)$(PREFIX)/etc/AppInterface/Session.interface
.PHONY: all clean distclean install uninstall .PHONY: all clean distclean install uninstall

25
data/Session.interface Normal file
View File

@ -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

View File

@ -1,4 +1,7 @@
dist=Makefile,Init.interface,appbroker.sh dist=Makefile,Init.interface,Session.interface,appbroker.sh
[Init.interface] [Init.interface]
install=$(PREFIX)/etc/AppInterface install=$(PREFIX)/etc/AppInterface
[Session.interface]
install=$(PREFIX)/etc/AppInterface

View File

@ -1,4 +1,4 @@
TARGETS = ../include/Init.h Init TARGETS = ../include/Init.h ../include/Session.h Init
PREFIX = /usr/local PREFIX = /usr/local
DESTDIR = DESTDIR =
BINDIR = $(PREFIX)/bin BINDIR = $(PREFIX)/bin
@ -21,6 +21,9 @@ all: $(TARGETS)
../include/Init.h: ../data/Init.interface ../include/Init.h: ../data/Init.interface
../data/appbroker.sh -P "$(PREFIX)" -- "../include/Init.h" ../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_OBJS = init.o main.o service.o session.o
Init_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS) Init_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS)
Init_LDFLAGS = $(LDFLAGSF) $(LDFLAGS) Init_LDFLAGS = $(LDFLAGSF) $(LDFLAGS)
@ -41,7 +44,7 @@ session.o: session.c
$(CC) $(Init_CFLAGS) -c session.c $(CC) $(Init_CFLAGS) -c session.c
clean: clean:
$(RM) -- $(../include/Init.h_OBJS) $(Init_OBJS) $(RM) -- $(../include/Init.h_OBJS) $(../include/Session.h_OBJS) $(Init_OBJS)
distclean: clean distclean: clean
$(RM) -- $(TARGETS) $(RM) -- $(TARGETS)

View File

@ -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_force=-W `pkg-config --cflags libApp`
cflags=-Wall -g -O2 -pedantic cflags=-Wall -g -O2 -pedantic
ldflags_force=`pkg-config --libs libApp` -Wl,--export-dynamic ldflags_force=`pkg-config --libs libApp` -Wl,--export-dynamic
@ -10,6 +10,11 @@ type=script
script=../data/appbroker.sh script=../data/appbroker.sh
depends=../data/Init.interface depends=../data/Init.interface
[../include/Session.h]
type=script
script=../data/appbroker.sh
depends=../data/Session.interface
[Init] [Init]
type=binary type=binary
sources=init.c,main.c,service.c,session.c sources=init.c,main.c,service.c,session.c