Skip to content

Commit 80e2b82

Browse files
committed
use gdbus-codegen for source
1 parent b137b09 commit 80e2b82

18 files changed

+542
-314
lines changed

Makefile

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
VERSION = 0.0.1a
2+
VERSION = 0.0.2
33

44
SOFILE = libdbus2vdr.so
55

@@ -9,20 +9,30 @@ CFLAGS ?= -g -O3 -Wall
99
DEFINES = -D_GNU_SOURCE
1010
DEFINES += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
1111

12-
CFLAGS += -fPIC $(shell pkg-config --cflags glib-2.0 gio-2.0)
13-
LDADD += $(shell pkg-config --libs glib-2.0 gio-2.0)
12+
CFLAGS += -fPIC $(shell pkg-config --cflags glib-2.0 gio-unix-2.0)
13+
LDADD += $(shell pkg-config --libs glib-2.0 gio-unix-2.0)
14+
15+
XMLS = $(wildcard *.xml)
16+
HEADERS = $(patsubst %.xml,%.h,$(XMLS))
17+
CODES = $(patsubst %.xml,%.c,$(XMLS))
18+
OBJS = $(patsubst %.xml,%.o,$(XMLS))
1419

15-
OBJS = $(patsubst %.c,%.o,$(wildcard *.c))
1620

1721
all: $(SOFILE)
1822

1923
%.o: %.c
2024
$(CC) $(CFLAGS) -c $(DEFINES) -o $@ $<
2125

22-
MAKEDEP = $(CXX) -MM -MG
26+
%.h: %.xml
27+
gdbus-codegen --generate-c-code `basename $< .xml` --interface-prefix de.tvdr.vdr --c-namespace DBus2vdr $<
28+
29+
30+
MAKEDEP = $(CC) -MM -MG
2331
DEPFILE = .dependencies
24-
$(DEPFILE): Makefile
25-
@$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
32+
$(DEPFILE): Makefile $(HEADERS)
33+
@-rm -f $(DEPFILE)
34+
for x in $(XMLS); do echo "`basename $$x .xml`.h: $$x" >> $@; done
35+
@$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) >> $@
2636

2737
-include $(DEPFILE)
2838

@@ -39,7 +49,7 @@ install-lib: $(SOFILE)
3949
install: install-includes install-lib
4050

4151
clean:
42-
@-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~
52+
@-rm -f $(OBJS) $(DEPFILE) $(HEADERS) $(CODES) *.so *.tgz core* *~
4353

4454
orig:
4555
if [ -d .git ]; then git archive --format=tar.gz --prefix=libdbus2vdr-$(VERSION)/ -o ../libdbus2vdr_$(VERSION).orig.tar.gz master; fi

channel.xml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
2+
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
3+
<!-- GDBus 2.32.3 -->
4+
<node>
5+
<interface name="de.tvdr.vdr.channel">
6+
<method name="Count">
7+
<arg type="i" name="count" direction="out">
8+
</arg>
9+
</method>
10+
<method name="GetFromTo">
11+
<arg type="i" name="from_index" direction="in">
12+
</arg>
13+
<arg type="i" name="to_index" direction="in">
14+
</arg>
15+
<arg type="a(is)" name="channel" direction="out">
16+
</arg>
17+
</method>
18+
<method name="List">
19+
<arg type="s" name="option" direction="in">
20+
</arg>
21+
<arg type="a(is)" name="channel" direction="out">
22+
</arg>
23+
<arg type="i" name="replycode" direction="out">
24+
</arg>
25+
<arg type="s" name="replymessage" direction="out">
26+
</arg>
27+
</method>
28+
</interface>
29+
</node>

connection.c

Lines changed: 0 additions & 89 deletions
This file was deleted.

connection.h

Lines changed: 0 additions & 15 deletions
This file was deleted.

dbus2vdr.h

Lines changed: 0 additions & 45 deletions
This file was deleted.

epg.xml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
2+
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
3+
<!-- GDBus 2.32.3 -->
4+
<node>
5+
<interface name="de.tvdr.vdr.epg">
6+
<method name="DisableScanner">
7+
<arg type="i" name="eitdisabletime" direction="in">
8+
</arg>
9+
<arg type="i" name="replycode" direction="out">
10+
</arg>
11+
<arg type="s" name="replymessage" direction="out">
12+
</arg>
13+
</method>
14+
<method name="EnableScanner">
15+
<arg type="i" name="replycode" direction="out">
16+
</arg>
17+
<arg type="s" name="replymessage" direction="out">
18+
</arg>
19+
</method>
20+
<method name="ClearEPG">
21+
<arg type="s" name="channel" direction="in">
22+
</arg>
23+
<arg type="i" name="eitdisabletime" direction="in">
24+
</arg>
25+
<arg type="i" name="replycode" direction="out">
26+
</arg>
27+
<arg type="s" name="replymessage" direction="out">
28+
</arg>
29+
</method>
30+
<method name="PutEntry">
31+
<arg type="as" name="entryline" direction="in">
32+
</arg>
33+
<arg type="i" name="replycode" direction="out">
34+
</arg>
35+
<arg type="s" name="replymessage" direction="out">
36+
</arg>
37+
</method>
38+
<method name="PutFile">
39+
<arg type="s" name="filename" direction="in">
40+
</arg>
41+
<arg type="i" name="replycode" direction="out">
42+
</arg>
43+
<arg type="s" name="replymessage" direction="out">
44+
</arg>
45+
</method>
46+
<method name="Now">
47+
<arg type="s" name="channel" direction="in">
48+
</arg>
49+
<arg type="i" name="replycode" direction="out">
50+
</arg>
51+
<arg type="s" name="replymessage" direction="out">
52+
</arg>
53+
<arg type="aa(sv)" name="event_list" direction="out">
54+
</arg>
55+
</method>
56+
<method name="Next">
57+
<arg type="s" name="channel" direction="in">
58+
</arg>
59+
<arg type="i" name="replycode" direction="out">
60+
</arg>
61+
<arg type="s" name="replymessage" direction="out">
62+
</arg>
63+
<arg type="aa(sv)" name="event_list" direction="out">
64+
</arg>
65+
</method>
66+
<method name="At">
67+
<arg type="s" name="channel" direction="in">
68+
</arg>
69+
<arg type="t" name="time" direction="in">
70+
</arg>
71+
<arg type="i" name="replycode" direction="out">
72+
</arg>
73+
<arg type="s" name="replymessage" direction="out">
74+
</arg>
75+
<arg type="aa(sv)" name="event_list" direction="out">
76+
</arg>
77+
</method>
78+
</interface>
79+
</node>

plugin.xml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
2+
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
3+
<!-- GDBus 2.32.3 -->
4+
<node>
5+
<interface name="de.tvdr.vdr.plugin">
6+
<method name="SVDRPCommand">
7+
<arg type="s" name="command" direction="in">
8+
</arg>
9+
<arg type="s" name="option" direction="in">
10+
</arg>
11+
<arg type="i" name="replycode" direction="out">
12+
</arg>
13+
<arg type="s" name="replymessage" direction="out">
14+
</arg>
15+
</method>
16+
<method name="Service">
17+
<arg type="s" name="id" direction="in">
18+
</arg>
19+
<arg type="s" name="data" direction="in">
20+
</arg>
21+
<arg type="b" name="handled" direction="out">
22+
</arg>
23+
</method>
24+
</interface>
25+
</node>

pluginmanager.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
2+
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
3+
<!-- GDBus 2.32.3 -->
4+
<node>
5+
<interface name="de.tvdr.vdr.pluginmanager">
6+
<method name="List">
7+
<arg type="a(ss)" name="pluginlist" direction="out">
8+
</arg>
9+
</method>
10+
</interface>
11+
</node>

0 commit comments

Comments
 (0)