summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJussi Kukkonen <jku@openedhand.com>2008-10-22 08:43:46 +0000
committerJussi Kukkonen <jku@openedhand.com>2008-10-22 08:43:46 +0000
commit0291a4a70dbd793b1c16b5eaab83b332580b3c8b (patch)
tree9ab69deb1525c482ead6911322967c025a82952b /tools
parent45ea3f3ca08d1a1868e58f9c1704f2fe622f5ba0 (diff)
downloadgupnp-0291a4a70dbd793b1c16b5eaab83b332580b3c8b.tar.gz
2008-10-22 Jussi Kukkonen <jku@linux.intel.com>
* tools/gupnp-binding-tool: Use inline functions. Fix generated code indent, remove trailing whitespace. git-svn-id: https://svn.o-hand.com/repos/gupnp/trunk/gupnp@1310 d8cb91d7-bff9-0310-92b9-80b65e4482b2
Diffstat (limited to 'tools')
-rwxr-xr-xtools/gupnp-binding-tool16
1 files changed, 10 insertions, 6 deletions
diff --git a/tools/gupnp-binding-tool b/tools/gupnp-binding-tool
index 012305c..91111b4 100755
--- a/tools/gupnp-binding-tool
+++ b/tools/gupnp-binding-tool
@@ -18,6 +18,10 @@
# TODO:
# - finish code cleanup
+# - currently allowedValueList is not used: could use it to turn
+# current char* value to an enum
+# - could warn if values outside allowedValueRange are used in *_action_set()
+# - add option to generate skeleton source code that uses the bindings?
import sys, os.path, re, xml.etree.ElementTree as ET
from optparse import OptionParser
@@ -183,11 +187,11 @@ def printClientSyncActionBinding(a):
print "{"
print " return gupnp_service_proxy_send_action"
- print " (proxy, \"%s\", error, " % a.name
+ print " (proxy, \"%s\", error," % a.name
for arg in a.in_args:
print " \"%s\", %s, in_%s," % (arg.name, arg.related_var.gtype, arg.c_name)
- print " NULL, "
+ print " NULL,"
for arg in a.out_args:
print " \"%s\", %s, out_%s," % (arg.name, arg.related_var.gtype, arg.c_name)
@@ -374,7 +378,7 @@ def printServerActionBinding(a):
# getter and setter func for GUPnPServiceAction
indent = (13 + len (a.c_prefixed_name)) * " "
if len (a.in_args) > 0:
- print "void"
+ print "static inline void"
print "%s_action_get (GUPnPServiceAction *action," % (a.c_prefixed_name)
for arg in a.in_args[:-1]:
print "%s%s*in_%s," % (indent, arg.related_var.ctype, arg.c_name)
@@ -387,10 +391,10 @@ def printServerActionBinding(a):
print "}"
print
if len (a.out_args) > 0:
- print "void"
+ print "static inline void"
print "%s_action_set (GUPnPServiceAction *action," % (a.c_prefixed_name)
for arg in a.out_args[:-1]:
- print "const %s%sout_%s," % (indent, arg.related_var.ctype, arg.c_name)
+ print "%sconst %sout_%s," % (indent, arg.related_var.ctype, arg.c_name)
print "%sconst %sout_%s)" % (indent, a.out_args[-1].related_var.ctype, a.out_args[-1].c_name)
print "{"
print " gupnp_service_action_set (action,"
@@ -401,7 +405,7 @@ def printServerActionBinding(a):
print
indent = (17 + len (a.c_prefixed_name)) * " "
- print "gulong"
+ print "static inline gulong"
print "%s_action_connect (GUPnPService *service," % a.c_prefixed_name
print "%sGCallback callback," % indent
print "%sgpointer userdata)" % indent