If I were to have a schema.xml entry that looked something like this:
<method name="export" desc="Export a file system">
<arg name="directory" dir="I" type="sstr"
/>
<arg name="client" dir="I" type="sstr"
/>
<arg name="options" dir="I" type="list"
/>
<arg name="rc" dir="O" type="uint32"
/>
</method>
...and a matching dbus method defined like so:
gboolean
Storage_export(Matahari *matahari,
const char *directory,
const char *client,
const char **options,
DBusGMethodInvocation *context)
...and then converted the list argument to a GList thusly:
const char **i;
GList *list = NULL;
for (i = options; i != NULL; i++) {
list = g_list_prepend(list, strdup(*i));
}
Can I rely on "options" being NULL terminated?
- antoine
Show replies by date