summaryrefslogtreecommitdiffstats
path: root/dbus
diff options
context:
space:
mode:
Diffstat (limited to 'dbus')
-rw-r--r--dbus/dbus-marshal-validate.c40
-rw-r--r--dbus/dbus-types.h2
2 files changed, 20 insertions, 22 deletions
diff --git a/dbus/dbus-marshal-validate.c b/dbus/dbus-marshal-validate.c
index 285f1efb..ced5e1ea 100644
--- a/dbus/dbus-marshal-validate.c
+++ b/dbus/dbus-marshal-validate.c
@@ -482,6 +482,25 @@ _dbus_validate_body_with_reason (const DBusString *expected_signature,
}
/**
+ * Determine wether the given charater is valid as the first charater
+ * in a name.
+ */
+#define VALID_INITIAL_NAME_CHARACTER(c) \
+ ( ((c) >= 'A' && (c) <= 'Z') || \
+ ((c) >= 'a' && (c) <= 'z') || \
+ ((c) == '_') )
+
+/**
+ * Determine wether the given charater is valid as a second or later
+ * character in a name
+ */
+#define VALID_NAME_CHARACTER(c) \
+ ( ((c) >= '0' && (c) <= '9') || \
+ ((c) >= 'A' && (c) <= 'Z') || \
+ ((c) >= 'a' && (c) <= 'z') || \
+ ((c) == '_') )
+
+/**
* Checks that the given range of the string is a valid object path
* name in the D-BUS protocol. Part of the validation ensures that
* the object path contains only ASCII.
@@ -535,7 +554,7 @@ _dbus_validate_path (const DBusString *str,
}
else
{
- if (_DBUS_UNLIKELY (!_DBUS_ISASCII (*s)))
+ if (_DBUS_UNLIKELY (!VALID_NAME_CHARACTER (*s)))
return FALSE;
}
@@ -550,25 +569,6 @@ _dbus_validate_path (const DBusString *str,
}
/**
- * Determine wether the given charater is valid as the first charater
- * in a name.
- */
-#define VALID_INITIAL_NAME_CHARACTER(c) \
- ( ((c) >= 'A' && (c) <= 'Z') || \
- ((c) >= 'a' && (c) <= 'z') || \
- ((c) == '_') )
-
-/**
- * Determine wether the given charater is valid as a second or later
- * character in a name
- */
-#define VALID_NAME_CHARACTER(c) \
- ( ((c) >= '0' && (c) <= '9') || \
- ((c) >= 'A' && (c) <= 'Z') || \
- ((c) >= 'a' && (c) <= 'z') || \
- ((c) == '_') )
-
-/**
* Checks that the given range of the string is a valid interface name
* in the D-BUS protocol. This includes a length restriction and an
* ASCII subset, see the specification.
diff --git a/dbus/dbus-types.h b/dbus/dbus-types.h
index 0bbc9295..55ddf434 100644
--- a/dbus/dbus-types.h
+++ b/dbus/dbus-types.h
@@ -29,8 +29,6 @@
#include <stddef.h>
-typedef unsigned short dbus_uint16_t;
-typedef short dbus_int16_t;
typedef unsigned int dbus_uint32_t;
typedef int dbus_int32_t;
typedef dbus_uint32_t dbus_unichar_t;