Automatically generating Probe.h
This commit is contained in:
parent
c3b9648cc8
commit
e4cea62828
2
Makefile
2
Makefile
|
@ -23,11 +23,11 @@ dist:
|
||||||
@$(TAR) $(PACKAGE)-$(VERSION).tar.gz \
|
@$(TAR) $(PACKAGE)-$(VERSION).tar.gz \
|
||||||
$(PACKAGE)-$(VERSION)/data/Makefile \
|
$(PACKAGE)-$(VERSION)/data/Makefile \
|
||||||
$(PACKAGE)-$(VERSION)/data/Probe.interface \
|
$(PACKAGE)-$(VERSION)/data/Probe.interface \
|
||||||
$(PACKAGE)-$(VERSION)/data/Probe.h \
|
|
||||||
$(PACKAGE)-$(VERSION)/data/project.conf \
|
$(PACKAGE)-$(VERSION)/data/project.conf \
|
||||||
$(PACKAGE)-$(VERSION)/src/probe.c \
|
$(PACKAGE)-$(VERSION)/src/probe.c \
|
||||||
$(PACKAGE)-$(VERSION)/src/damon.c \
|
$(PACKAGE)-$(VERSION)/src/damon.c \
|
||||||
$(PACKAGE)-$(VERSION)/src/Makefile \
|
$(PACKAGE)-$(VERSION)/src/Makefile \
|
||||||
|
$(PACKAGE)-$(VERSION)/src/appbroker.sh \
|
||||||
$(PACKAGE)-$(VERSION)/src/project.conf \
|
$(PACKAGE)-$(VERSION)/src/project.conf \
|
||||||
$(PACKAGE)-$(VERSION)/tools/Makefile \
|
$(PACKAGE)-$(VERSION)/tools/Makefile \
|
||||||
$(PACKAGE)-$(VERSION)/tools/create.sh \
|
$(PACKAGE)-$(VERSION)/tools/create.sh \
|
||||||
|
|
48
data/Probe.h
48
data/Probe.h
|
@ -1,48 +0,0 @@
|
||||||
/* $Id$ */
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef Probe_H
|
|
||||||
# define Probe_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 */
|
|
||||||
UINT32 Probe_uptime();
|
|
||||||
INT32 Probe_load(UINT32_OUT load_1, UINT32_OUT load_5, UINT32_OUT load_15);
|
|
||||||
INT32 Probe_ram(UINT32_OUT total, UINT32_OUT free, UINT32_OUT shared, UINT32_OUT buffer);
|
|
||||||
INT32 Probe_swap(UINT32_OUT total, UINT32_OUT free);
|
|
||||||
UINT32 Probe_users();
|
|
||||||
UINT32 Probe_procs();
|
|
||||||
UINT32 Probe_ifrxbytes(STRING interface);
|
|
||||||
UINT32 Probe_iftxbytes(STRING interface);
|
|
||||||
UINT32 Probe_voltotal(STRING volume);
|
|
||||||
UINT32 Probe_volfree(STRING volume);
|
|
||||||
|
|
||||||
#endif /* !Probe_H */
|
|
|
@ -1,4 +1,4 @@
|
||||||
dist=Makefile,Probe.interface,Probe.h
|
dist=Makefile,Probe.interface
|
||||||
|
|
||||||
[Probe.interface]
|
[Probe.interface]
|
||||||
install=$(PREFIX)/etc/AppInterface
|
install=$(PREFIX)/etc/AppInterface
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
TARGETS = Probe DaMon
|
TARGETS = ../data/Probe.h Probe DaMon
|
||||||
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
|
CFLAGSF = -W
|
||||||
CFLAGS = -Wall -g -O2 -pedantic
|
CFLAGS = -Wall -g -O2 -pedantic
|
||||||
|
@ -17,6 +17,9 @@ INSTALL = install
|
||||||
|
|
||||||
all: $(TARGETS)
|
all: $(TARGETS)
|
||||||
|
|
||||||
|
../data/Probe.h:
|
||||||
|
./appbroker.sh "../data/Probe.h"
|
||||||
|
|
||||||
Probe_OBJS = probe.o
|
Probe_OBJS = probe.o
|
||||||
Probe_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS)
|
Probe_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS)
|
||||||
Probe_LDFLAGS = $(LDFLAGSF) $(LDFLAGS) -Wl,--export-dynamic
|
Probe_LDFLAGS = $(LDFLAGSF) $(LDFLAGS) -Wl,--export-dynamic
|
||||||
|
@ -38,7 +41,7 @@ damon.o: damon.c ../config.h
|
||||||
$(CC) $(DaMon_CFLAGS) -c damon.c
|
$(CC) $(DaMon_CFLAGS) -c damon.c
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) $(Probe_OBJS) $(DaMon_OBJS)
|
$(RM) $(../data/Probe.h_OBJS) $(Probe_OBJS) $(DaMon_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"
|
|
@ -25,7 +25,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <System.h>
|
#include <System.h>
|
||||||
#include "Probe.h"
|
#include "../data/Probe.h"
|
||||||
#include "../config.h"
|
#include "../config.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,14 @@
|
||||||
targets=Probe,DaMon
|
targets=../data/Probe.h,Probe,DaMon
|
||||||
cppflags_force=-I ../data -I $(PREFIX)/include
|
cppflags_force=-I $(PREFIX)/include
|
||||||
cflags_force=-W
|
cflags_force=-W
|
||||||
cflags=-Wall -g -O2 -pedantic
|
cflags=-Wall -g -O2 -pedantic
|
||||||
ldflags_force=-lSystem -ldl
|
ldflags_force=-lSystem
|
||||||
ldflags=-L $(PREFIX)/lib -Wl,-rpath,$(PREFIX)/lib
|
ldflags=-L $(PREFIX)/lib -Wl,-rpath,$(PREFIX)/lib
|
||||||
dist=Makefile
|
dist=Makefile,appbroker.sh
|
||||||
|
|
||||||
|
[../data/Probe.h]
|
||||||
|
type=script
|
||||||
|
script=./appbroker.sh
|
||||||
|
|
||||||
[Probe]
|
[Probe]
|
||||||
type=binary
|
type=binary
|
||||||
|
|
Loading…
Reference in New Issue
Block a user