diff options
author | Philip Withnall <withnall@endlessm.com> | 2018-08-13 14:36:23 +0100 |
---|---|---|
committer | Philip Withnall <withnall@endlessm.com> | 2018-08-13 14:36:23 +0100 |
commit | 4f9b4345eb36098bb10627fc3c32cbc7d6f6ff78 (patch) | |
tree | f9023881356ceaf0bee9bb446afae8f76a7b77bb | |
parent | da6fdbfc3962fd04cf0cbd20e2b60c56d8f69f36 (diff) | |
parent | 57962aac85a41f554e14da14906a3ba0bd8f9156 (diff) | |
download | dconf-4f9b4345eb36098bb10627fc3c32cbc7d6f6ff78.tar.gz |
Merge remote-tracking branch 'gvdb/master'
-rw-r--r-- | gvdb/gvdb-builder.c | 5 | ||||
-rw-r--r-- | gvdb/gvdb-builder.h | 2 | ||||
-rw-r--r-- | gvdb/gvdb-format.h | 2 | ||||
-rw-r--r-- | gvdb/gvdb-reader.c | 35 | ||||
-rw-r--r-- | gvdb/gvdb-reader.h | 2 | ||||
-rw-r--r-- | gvdb/gvdb.doap | 31 |
6 files changed, 59 insertions, 18 deletions
diff --git a/gvdb/gvdb-builder.c b/gvdb/gvdb-builder.c index 90ea50b..2383e60 100644 --- a/gvdb/gvdb-builder.c +++ b/gvdb/gvdb-builder.c @@ -4,7 +4,7 @@ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the licence, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -291,7 +291,8 @@ file_builder_add_string (FileBuilder *fb, chunk->offset = fb->offset; chunk->size = length; chunk->data = g_malloc (length); - memcpy (chunk->data, string, length); + if (length != 0) + memcpy (chunk->data, string, length); *start = guint32_to_le (fb->offset); *size = guint16_to_le (length); diff --git a/gvdb/gvdb-builder.h b/gvdb/gvdb-builder.h index 8ec05c8..b4815f0 100644 --- a/gvdb/gvdb-builder.h +++ b/gvdb/gvdb-builder.h @@ -4,7 +4,7 @@ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the licence, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/gvdb/gvdb-format.h b/gvdb/gvdb-format.h index 486e854..ed6adab 100644 --- a/gvdb/gvdb-format.h +++ b/gvdb/gvdb-format.h @@ -4,7 +4,7 @@ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the licence, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/gvdb/gvdb-reader.c b/gvdb/gvdb-reader.c index 08b5bc8..aa3154f 100644 --- a/gvdb/gvdb-reader.c +++ b/gvdb/gvdb-reader.c @@ -4,7 +4,7 @@ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the licence, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -125,14 +125,16 @@ gvdb_table_setup_root (GvdbTable *file, * @bytes: the #GBytes with the data * @trusted: if the contents of @bytes are trusted * @error: %NULL, or a pointer to a %NULL #GError - * @returns: a new #GvdbTable * * Creates a new #GvdbTable from the contents of @bytes. * - * This call can fail if the header contained in @bytes is invalid. + * This call can fail if the header contained in @bytes is invalid or if @bytes + * is empty; if so, %G_FILE_ERROR_INVAL will be returned. * * You should call gvdb_table_free() on the return result when you no * longer require it. + * + * Returns: a new #GvdbTable **/ GvdbTable * gvdb_table_new_from_bytes (GBytes *bytes, @@ -184,10 +186,17 @@ invalid: * @filename: a filename * @trusted: if the contents of @bytes are trusted * @error: %NULL, or a pointer to a %NULL #GError - * @returns: a new #GvdbTable * * Creates a new #GvdbTable using the #GMappedFile for @filename as the * #GBytes. + * + * This function will fail if the file cannot be opened. + * In that case, the #GError that is returned will be an error from + * g_mapped_file_new(). + * + * An empty or corrupt file will result in %G_FILE_ERROR_INVAL. + * + * Returns: a new #GvdbTable **/ GvdbTable * gvdb_table_new (const gchar *filename, @@ -474,7 +483,6 @@ gvdb_table_get_names (GvdbTable *table, * gvdb_table_list: * @file: a #GvdbTable * @key: a string - * @returns: a %NULL-terminated string array * * List all of the keys that appear below @key. The nesting of keys * within the hash file is defined by the program that created the hash @@ -487,6 +495,8 @@ gvdb_table_get_names (GvdbTable *table, * * You should call g_strfreev() on the return result when you no longer * require it. + * + * Returns: a %NULL-terminated string array **/ gchar ** gvdb_table_list (GvdbTable *file, @@ -537,12 +547,13 @@ gvdb_table_list (GvdbTable *file, * gvdb_table_has_value: * @file: a #GvdbTable * @key: a string - * @returns: %TRUE if @key is in the table * * Checks for a value named @key in @file. * * Note: this function does not consider non-value nodes (other hash * tables, for example). + * + * Returns: %TRUE if @key is in the table **/ gboolean gvdb_table_has_value (GvdbTable *file, @@ -586,7 +597,6 @@ gvdb_table_value_from_item (GvdbTable *table, * gvdb_table_get_value: * @file: a #GvdbTable * @key: a string - * @returns: a #GVariant, or %NULL * * Looks up a value named @key in @file. * @@ -596,6 +606,8 @@ gvdb_table_value_from_item (GvdbTable *table, * * You should call g_variant_unref() on the return result when you no * longer require it. + * + * Returns: a #GVariant, or %NULL **/ GVariant * gvdb_table_get_value (GvdbTable *file, @@ -625,12 +637,13 @@ gvdb_table_get_value (GvdbTable *file, * gvdb_table_get_raw_value: * @table: a #GvdbTable * @key: a string - * @returns: a #GVariant, or %NULL * * Looks up a value named @key in @file. * * This call is equivalent to gvdb_table_get_value() except that it * never byteswaps the value. + * + * Returns: a #GVariant, or %NULL **/ GVariant * gvdb_table_get_raw_value (GvdbTable *table, @@ -648,7 +661,6 @@ gvdb_table_get_raw_value (GvdbTable *table, * gvdb_table_get_table: * @file: a #GvdbTable * @key: a string - * @returns: a new #GvdbTable, or %NULL * * Looks up the hash table named @key in @file. * @@ -662,6 +674,8 @@ gvdb_table_get_raw_value (GvdbTable *table, * * You should call gvdb_table_free() on the return result when you no * longer require it. + * + * Returns: a new #GvdbTable, or %NULL **/ GvdbTable * gvdb_table_get_table (GvdbTable *file, @@ -703,13 +717,14 @@ gvdb_table_free (GvdbTable *file) /** * gvdb_table_is_valid: * @table: a #GvdbTable - * @returns: %TRUE if @table is still valid * * Checks if the table is still valid. * * An on-disk GVDB can be marked as invalid. This happens when the file * has been replaced. The appropriate action is typically to reopen the * file. + * + * Returns: %TRUE if @table is still valid **/ gboolean gvdb_table_is_valid (GvdbTable *table) diff --git a/gvdb/gvdb-reader.h b/gvdb/gvdb-reader.h index 241b41a..3982773 100644 --- a/gvdb/gvdb-reader.h +++ b/gvdb/gvdb-reader.h @@ -4,7 +4,7 @@ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the licence, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/gvdb/gvdb.doap b/gvdb/gvdb.doap index b4ae60c..8c5f3e8 100644 --- a/gvdb/gvdb.doap +++ b/gvdb/gvdb.doap @@ -23,9 +23,34 @@ <maintainer> <foaf:Person> - <foaf:name>Ryan Lortie</foaf:name> - <foaf:mbox rdf:resource='mailto:desrt@desrt.ca'/> - <gnome:userid>ryanl</gnome:userid> + <foaf:name>Matthias Clasen</foaf:name> + <foaf:mbox rdf:resource="mailto:mclasen@redhat.com"/> + <gnome:userid>matthiasc</gnome:userid> + </foaf:Person> + </maintainer> + + <maintainer> + <foaf:Person> + <foaf:name>Allison Ryan Lortie</foaf:name> + <foaf:mbox rdf:resource="mailto:desrt@desrt.ca"/> + <gnome:userid>desrt</gnome:userid> + </foaf:Person> + </maintainer> + + <maintainer> + <foaf:Person> + <foaf:name>Philip Withnall</foaf:name> + <foaf:mbox rdf:resource="mailto:philip@tecnocode.co.uk"/> + <foaf:mbox rdf:resource="mailto:withnall@endlessm.com"/> + <gnome:userid>pwithnall</gnome:userid> + </foaf:Person> + </maintainer> + + <maintainer> + <foaf:Person> + <foaf:name>Emmanuele Bassi</foaf:name> + <foaf:mbox rdf:resource="mailto:ebassi@gnome.org"/> + <gnome:userid>ebassi</gnome:userid> </foaf:Person> </maintainer> |