Automatically generating Init.h
This commit is contained in:
parent
568b2dcf50
commit
215471a8fa
2
Makefile
2
Makefile
|
@ -23,13 +23,13 @@ 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/Init.h \
|
|
||||||
$(PACKAGE)-$(VERSION)/data/project.conf \
|
$(PACKAGE)-$(VERSION)/data/project.conf \
|
||||||
$(PACKAGE)-$(VERSION)/src/init.c \
|
$(PACKAGE)-$(VERSION)/src/init.c \
|
||||||
$(PACKAGE)-$(VERSION)/src/main.c \
|
$(PACKAGE)-$(VERSION)/src/main.c \
|
||||||
$(PACKAGE)-$(VERSION)/src/service.c \
|
$(PACKAGE)-$(VERSION)/src/service.c \
|
||||||
$(PACKAGE)-$(VERSION)/src/session.c \
|
$(PACKAGE)-$(VERSION)/src/session.c \
|
||||||
$(PACKAGE)-$(VERSION)/src/Makefile \
|
$(PACKAGE)-$(VERSION)/src/Makefile \
|
||||||
|
$(PACKAGE)-$(VERSION)/src/appbroker.sh \
|
||||||
$(PACKAGE)-$(VERSION)/src/common.h \
|
$(PACKAGE)-$(VERSION)/src/common.h \
|
||||||
$(PACKAGE)-$(VERSION)/src/init.h \
|
$(PACKAGE)-$(VERSION)/src/init.h \
|
||||||
$(PACKAGE)-$(VERSION)/src/service.h \
|
$(PACKAGE)-$(VERSION)/src/service.h \
|
||||||
|
|
44
data/Init.h
44
data/Init.h
|
@ -1,44 +0,0 @@
|
||||||
/* $Id$ */
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef Init_H
|
|
||||||
# define Init_H
|
|
||||||
|
|
||||||
# include <stdint.h>
|
|
||||||
# include <System.h>
|
|
||||||
|
|
||||||
|
|
||||||
/* 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 */
|
|
|
@ -1,4 +1,4 @@
|
||||||
dist=Makefile,Init.interface,Init.h
|
dist=Makefile,Init.interface
|
||||||
|
|
||||||
[Init.interface]
|
[Init.interface]
|
||||||
install=$(PREFIX)/etc/AppInterface
|
install=$(PREFIX)/etc/AppInterface
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
TARGETS = Init
|
TARGETS = ../data/Init.h Init
|
||||||
PREFIX = /usr/local
|
PREFIX = /usr/local
|
||||||
DESTDIR =
|
DESTDIR =
|
||||||
BINDIR = $(PREFIX)/bin
|
BINDIR = $(PREFIX)/bin
|
||||||
CC = cc
|
CC = cc
|
||||||
CPPFLAGSF= -I ../data -I $(PREFIX)/include
|
CPPFLAGSF= -I $(PREFIX)/include
|
||||||
CPPFLAGS=
|
CPPFLAGS=
|
||||||
CFLAGSF = -W -Wall -pedantic
|
CFLAGSF = -W -Wall -pedantic
|
||||||
CFLAGS = -g -O2
|
CFLAGS = -g -O2
|
||||||
|
@ -16,6 +16,9 @@ INSTALL = install
|
||||||
|
|
||||||
all: $(TARGETS)
|
all: $(TARGETS)
|
||||||
|
|
||||||
|
../data/Init.h:
|
||||||
|
./appbroker.sh "../data/Init.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)
|
||||||
|
@ -36,7 +39,7 @@ session.o: session.c
|
||||||
$(CC) $(Init_CFLAGS) -c session.c
|
$(CC) $(Init_CFLAGS) -c session.c
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) $(Init_OBJS)
|
$(RM) $(../data/Init.h_OBJS) $(Init_OBJS)
|
||||||
|
|
||||||
distclean: clean
|
distclean: clean
|
||||||
$(RM) $(TARGETS)
|
$(RM) $(TARGETS)
|
||||||
|
|
20
src/appbroker.sh
Executable file
20
src/appbroker.sh
Executable file
|
@ -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"
|
|
@ -21,8 +21,8 @@
|
||||||
# include <stdio.h>
|
# include <stdio.h>
|
||||||
#endif
|
#endif
|
||||||
#include "session.h"
|
#include "session.h"
|
||||||
|
#include "../data/Init.h"
|
||||||
#include "init.h"
|
#include "init.h"
|
||||||
#include "Init.h"
|
|
||||||
|
|
||||||
|
|
||||||
/* Init */
|
/* Init */
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* $Id$ */
|
/* $Id$ */
|
||||||
/* Copyright (c) 2008 Pierre Pronchery <khorben@defora.org> */
|
/* Copyright (c) 2009 Pierre Pronchery <khorben@defora.org> */
|
||||||
/* This file is part of DeforaOS System Init */
|
/* This file is part of DeforaOS System Init */
|
||||||
/* This program is free software: you can redistribute it and/or modify
|
/* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -59,7 +59,7 @@ static int _init(char const * profile)
|
||||||
/* usage */
|
/* usage */
|
||||||
static int _usage(void)
|
static int _usage(void)
|
||||||
{
|
{
|
||||||
fputs("Usage: Init -s [-P profile]\n"
|
fputs("Usage: " PACKAGE " -s [-P profile]\n"
|
||||||
" -P Profile to load\n"
|
" -P Profile to load\n"
|
||||||
" -s Force the single-user profile\n", stderr);
|
" -s Force the single-user profile\n", stderr);
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
targets=Init
|
targets=../data/Init.h,Init
|
||||||
cppflags_force=-I ../data -I $(PREFIX)/include
|
cppflags_force=-I $(PREFIX)/include
|
||||||
cflags_force=-W -Wall -pedantic
|
cflags_force=-W -Wall -pedantic
|
||||||
cflags=-g -O2
|
cflags=-g -O2
|
||||||
ldflags_force=-L $(PREFIX)/lib -Wl,-rpath,$(PREFIX)/lib -lSystem -Wl,--export-dynamic
|
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]
|
[Init]
|
||||||
type=binary
|
type=binary
|
||||||
|
|
Loading…
Reference in New Issue
Block a user