summaryrefslogtreecommitdiffstats
path: root/dbus/make-dbus-glib-error-enum.sh
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2004-06-20 15:28:15 +0000
committerHavoc Pennington <hp@redhat.com>2004-06-20 15:28:15 +0000
commit961e6ca41c1e9433055130569ce3492866e2126b (patch)
tree053a3e24565665462a498dee93762a83b5598004 /dbus/make-dbus-glib-error-enum.sh
parenteed3989ea35a62e5f58ee7fc3f50a23ad0821800 (diff)
2004-06-20 Havoc Pennington <hp@redhat.com>
* dbus/dbus-glib-error-enum.h: autogenerate the GError enum codes from the dbus error names * glib/dbus-glib.h: move to subdir dbus/ since it's included as dbus/dbus-glib.h and that breakage is now visible due to including dbus/dbus-glib.h in dbus-glib-lowlevel.h * glib/dbus-glib.h: s/gproxy/g_proxy/ * dbus/dbus-shared.h: new header to hold stuff shared with binding APIs * dbus/dbus-protocol.h (DBUS_ERROR_*): move errors here rather than dbus-errors.h * glib/dbus-glib.h (dbus_set_g_error): move to dbus-glib-lowlevel.h * glib/dbus-glib.h: remove dbus/dbus.h from here; change a bunch of stuff to enable this * dbus/dbus-glib-lowlevel.h: put dbus/dbus.h here * a bunch of other changes with the same basic "separate glib bindings from dbus.h" theme
Diffstat (limited to 'dbus/make-dbus-glib-error-enum.sh')
-rwxr-xr-xdbus/make-dbus-glib-error-enum.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/dbus/make-dbus-glib-error-enum.sh b/dbus/make-dbus-glib-error-enum.sh
new file mode 100755
index 00000000..5b0df6c9
--- /dev/null
+++ b/dbus/make-dbus-glib-error-enum.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+SRC=$1
+DEST=$2
+
+function die()
+{
+ echo $1 1>&2
+ /bin/rm $DEST.tmp
+ exit 1
+}
+
+cat $SRC | grep '#define DBUS_ERROR' | sed -e 's/#define //g' | \
+ sed -e 's/".*//g' | sed -e 's/_ERROR/_GERROR/g' | sed -e 's/ *$/,/g' > $DEST.tmp
+
+if ! test -s $DEST.tmp ; then
+ die "$DEST.tmp is empty, something went wrong, see any preceding error message"
+fi
+
+echo "#ifndef DBUS_INSIDE_DBUS_GLIB_H" >> $DEST.tmp
+echo '#error "' "$DEST" 'may only be included by dbus-glib.h"' >> $DEST.tmp
+echo "#endif" >> $DEST.tmp
+
+mv $DEST.tmp $DEST || die "could not move $DEST.tmp to $DEST"