Mercurial > pidgin.yaz
changeset 18138:c6ee57944335
Process unsigned ints for dbus.
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Sun, 17 Jun 2007 02:19:22 +0000 |
parents | 323272a9bb65 |
children | 12ab14848af4 |
files | libpurple/dbus-analyze-functions.py |
diffstat | 1 files changed, 20 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/dbus-analyze-functions.py Sun Jun 17 01:07:25 2007 +0000 +++ b/libpurple/dbus-analyze-functions.py Sun Jun 17 02:19:22 2007 +0000 @@ -119,14 +119,19 @@ def processinput(self, type, name): const = False + unsigned = False if type[0] == "const": type = type[1:] const = True + if type[0] == "unsigned": + type = type[1:] + unsigned = True + if len(type) == 1: # simple types (int, gboolean, etc.) and enums if (type[0] in simpletypes) or ((type[0].startswith("Purple") and not type[0].endswith("Callback"))): - return self.inputsimple(type, name) + return self.inputsimple(type, name, unsigned) # pointers ... if (len(type) == 2) and (type[1] == pointer): @@ -232,9 +237,12 @@ print "typedef struct _%s %s;" % (type[0], type[0]) self.knowntypes.append(type[0]) - def inputsimple(self, type, name): + def inputsimple(self, type, name, us): self.paramshdr.append("%s %s" % (type[0], name)) - self.inputparams.append(("G_TYPE_INT", name)) + if us: + self.inputparams.append(("G_TYPE_UINT", name)) + else: + self.inputparams.append(("G_TYPE_INT", name)) def inputstring(self, type, name): self.paramshdr.append("const char *%s" % name) @@ -348,10 +356,15 @@ # input parameters - def inputsimple(self, type, name): - self.cdecls.append("\tdbus_int32_t %s;" % name) - self.cparams.append(("INT32", name)) - self.addintype("i", name) + def inputsimple(self, type, name, us): + if us: + self.cdecls.append("\tdbus_int32_t %s;" % name) + self.cparams.append(("INT32", name)) + self.addintype("i", name) + else: + self.cdecls.append("\tdbus_uint32_t %s;" % name) + self.cparams.append(("UINT32", name)) + self.addintype("u", name) def inputstring(self, type, name): self.cdecls.append("\tconst char *%s;" % name)