summaryrefslogtreecommitdiff
path: root/dbus/dbus-marshal-basic.c
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2011-03-03 17:35:14 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2011-03-10 19:14:55 +0000
commit09c9d6406b75f161429e16b2e45dcae3eb60cef9 (patch)
tree56d0f71974bdf50c14a0e97f0a44879d85e27d7d /dbus/dbus-marshal-basic.c
parent8299a41aa6808f020907b17bf3a66d9f360305be (diff)
downloaddbus-09c9d6406b75f161429e16b2e45dcae3eb60cef9.tar.gz
Make dbus_type_is_valid into public API
This is just as useful for bindings as dbus_signature_validate, and I think it's a good design principle to say that anything checked in a _dbus_return_if_fail should be something the caller could check for themselves. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=20496 Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Diffstat (limited to 'dbus/dbus-marshal-basic.c')
-rw-r--r--dbus/dbus-marshal-basic.c38
1 files changed, 0 insertions, 38 deletions
diff --git a/dbus/dbus-marshal-basic.c b/dbus/dbus-marshal-basic.c
index 3cbc7216..486f1c01 100644
--- a/dbus/dbus-marshal-basic.c
+++ b/dbus/dbus-marshal-basic.c
@@ -1231,44 +1231,6 @@ _dbus_type_get_alignment (int typecode)
}
}
-
-/**
- * Return #TRUE if the typecode is a valid typecode.
- * #DBUS_TYPE_INVALID surprisingly enough is not considered valid, and
- * random unknown bytes aren't either. This function is safe with
- * untrusted data.
- *
- * @returns #TRUE if valid
- */
-dbus_bool_t
-_dbus_type_is_valid (int typecode)
-{
- switch (typecode)
- {
- case DBUS_TYPE_BYTE:
- case DBUS_TYPE_BOOLEAN:
- case DBUS_TYPE_INT16:
- case DBUS_TYPE_UINT16:
- case DBUS_TYPE_INT32:
- case DBUS_TYPE_UINT32:
- case DBUS_TYPE_INT64:
- case DBUS_TYPE_UINT64:
- case DBUS_TYPE_DOUBLE:
- case DBUS_TYPE_STRING:
- case DBUS_TYPE_OBJECT_PATH:
- case DBUS_TYPE_SIGNATURE:
- case DBUS_TYPE_ARRAY:
- case DBUS_TYPE_STRUCT:
- case DBUS_TYPE_DICT_ENTRY:
- case DBUS_TYPE_VARIANT:
- case DBUS_TYPE_UNIX_FD:
- return TRUE;
-
- default:
- return FALSE;
- }
-}
-
/**
* Returns a string describing the given type.
*