diff --git a/Makefile b/Makefile index 6a9a97c..5a1266d 100644 --- a/Makefile +++ b/Makefile @@ -23,13 +23,13 @@ dist: @$(TAR) $(PACKAGE)-$(VERSION).tar.gz \ $(PACKAGE)-$(VERSION)/data/Makefile \ $(PACKAGE)-$(VERSION)/data/Init.interface \ - $(PACKAGE)-$(VERSION)/data/Init.h \ $(PACKAGE)-$(VERSION)/data/project.conf \ $(PACKAGE)-$(VERSION)/src/init.c \ $(PACKAGE)-$(VERSION)/src/main.c \ $(PACKAGE)-$(VERSION)/src/service.c \ $(PACKAGE)-$(VERSION)/src/session.c \ $(PACKAGE)-$(VERSION)/src/Makefile \ + $(PACKAGE)-$(VERSION)/src/appbroker.sh \ $(PACKAGE)-$(VERSION)/src/common.h \ $(PACKAGE)-$(VERSION)/src/init.h \ $(PACKAGE)-$(VERSION)/src/service.h \ diff --git a/data/Init.h b/data/Init.h deleted file mode 100644 index a05f784..0000000 --- a/data/Init.h +++ /dev/null @@ -1,44 +0,0 @@ -/* $Id$ */ - - - -#ifndef Init_H -# define Init_H - -# include -# include - - -/* types */ -typedef Buffer * BUFFER; -typedef int16_t INT16; -typedef int32_t INT32; -typedef uint16_t UINT16; -typedef uint32_t UINT32; -typedef String const * STRING; - -typedef BUFFER BUFFER_IN; -typedef INT32 INT32_IN; -typedef UINT32 UINT32_IN; -typedef STRING STRING_IN; - -typedef Buffer * BUFFER_OUT; -typedef int32_t * INT32_OUT; -typedef uint32_t * UINT32_OUT; -typedef String ** STRING_OUT; - -typedef Buffer * BUFFER_INOUT; -typedef int32_t * INT32_INOUT; -typedef uint32_t * UINT32_INOUT; -typedef String ** STRING_INOUT; - - -/* functions */ -UINT16 Init_login(STRING username); -UINT16 Init_logout(); -UINT16 Init_register(STRING, UINT16); -UINT16 Init_get_session(STRING); -INT32 Init_get_profile(STRING_OUT profile); -INT32 Init_set_profile(STRING profile); - -#endif /* !Init_H */ diff --git a/data/project.conf b/data/project.conf index 970e8c3..02df9ad 100644 --- a/data/project.conf +++ b/data/project.conf @@ -1,4 +1,4 @@ -dist=Makefile,Init.interface,Init.h +dist=Makefile,Init.interface [Init.interface] install=$(PREFIX)/etc/AppInterface diff --git a/src/Makefile b/src/Makefile index 45891f8..2e3d0e6 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,9 +1,9 @@ -TARGETS = Init +TARGETS = ../data/Init.h Init PREFIX = /usr/local DESTDIR = BINDIR = $(PREFIX)/bin CC = cc -CPPFLAGSF= -I ../data -I $(PREFIX)/include +CPPFLAGSF= -I $(PREFIX)/include CPPFLAGS= CFLAGSF = -W -Wall -pedantic CFLAGS = -g -O2 @@ -16,6 +16,9 @@ INSTALL = install all: $(TARGETS) +../data/Init.h: + ./appbroker.sh "../data/Init.h" + Init_OBJS = init.o main.o service.o session.o Init_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS) Init_LDFLAGS = $(LDFLAGSF) $(LDFLAGS) @@ -36,7 +39,7 @@ session.o: session.c $(CC) $(Init_CFLAGS) -c session.c clean: - $(RM) $(Init_OBJS) + $(RM) $(../data/Init.h_OBJS) $(Init_OBJS) distclean: clean $(RM) $(TARGETS) diff --git a/src/appbroker.sh b/src/appbroker.sh new file mode 100755 index 0000000..fc375f4 --- /dev/null +++ b/src/appbroker.sh @@ -0,0 +1,20 @@ +#!/bin/sh +#$Id$ + + + +#usage +usage() +{ + echo "Usage: ./appbroker.sh target" 1>&2 + return 1 +} + + +#main +if [ $# -ne 1 ]; then + usage + exit $? +fi +APPINTERFACE="${1%%.h}.interface" +AppBroker -o "$1" "$APPINTERFACE" diff --git a/src/init.c b/src/init.c index 6ad38aa..5994ee8 100644 --- a/src/init.c +++ b/src/init.c @@ -21,8 +21,8 @@ # include #endif #include "session.h" +#include "../data/Init.h" #include "init.h" -#include "Init.h" /* Init */ diff --git a/src/main.c b/src/main.c index 0bfd8a3..fc11a02 100644 --- a/src/main.c +++ b/src/main.c @@ -1,5 +1,5 @@ /* $Id$ */ -/* Copyright (c) 2008 Pierre Pronchery */ +/* Copyright (c) 2009 Pierre Pronchery */ /* This file is part of DeforaOS System Init */ /* This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -59,7 +59,7 @@ static int _init(char const * profile) /* usage */ static int _usage(void) { - fputs("Usage: Init -s [-P profile]\n" + fputs("Usage: " PACKAGE " -s [-P profile]\n" " -P Profile to load\n" " -s Force the single-user profile\n", stderr); return 1; diff --git a/src/project.conf b/src/project.conf index d00ec35..51d88a4 100644 --- a/src/project.conf +++ b/src/project.conf @@ -1,9 +1,13 @@ -targets=Init -cppflags_force=-I ../data -I $(PREFIX)/include +targets=../data/Init.h,Init +cppflags_force=-I $(PREFIX)/include cflags_force=-W -Wall -pedantic cflags=-g -O2 ldflags_force=-L $(PREFIX)/lib -Wl,-rpath,$(PREFIX)/lib -lSystem -Wl,--export-dynamic -dist=Makefile,common.h,init.h,service.h,session.h +dist=Makefile,appbroker.sh,common.h,init.h,service.h,session.h + +[../data/Init.h] +type=script +script=./appbroker.sh [Init] type=binary