summaryrefslogtreecommitdiff
path: root/libappstream-glib/as-node.h
Commit message (Collapse)AuthorAgeFilesLines
* Fix build of libappstream-glib clientsJürg Billeter2019-02-101-1/+1
| | | | | | | | | | | With '#pragma once', __APPSTREAM_GLIB_H is never defined. In file included from /usr/include/libappstream-glib/appstream-glib.h:35: /usr/include/libappstream-glib/as-utils.h:11:2: error: #error "Only <appstream-glib.h> can be included directly." #error "Only <appstream-glib.h> can be included directly." ^~~~~ Fixes: 87b7483e ("Use '#pragma once' to avoid a lot of boilerplate")
* Use '#pragma once' to avoid a lot of boilerplateRichard Hughes2019-02-091-6/+2
|
* Use the SPDX-License-Identifier in all source filesRichard Hughes2019-02-091-15/+1
|
* Fix an invalid read when using as_app_parse_data() from PythonRichard Hughes2018-01-241-0/+4
| | | | | | | | Using GObject Introspection we were creating an object using GLib.Bytes.new(buf) where buf was a python str object. This created a GBytes object with no trailing NUL char but we were expecting a NUL-terminated string when both doing fnmatch() and also processing the XML. Support this by guarding fnmatch and also by using the string length when using the GMarkupParseContext.
* Only load native languages when parsing AppStream dataRichard Hughes2016-11-031-3/+5
| | | | | | | This adds an optional flag that allows the node parser to ignore any nodes that do not match the native languages of the user. This increases startup speed of gnome-software by ~40ms but also drops the RSS by a massive 12Mb for the Fedora AppStream file.
* Add two new GCC warnings and fix up signed/unsigned issuesRichard Hughes2016-07-251-0/+5
|
* Use specific types to remove the last _cleanup_free usageRichard Hughes2015-09-141-0/+4
|
* Remove another length argumentRichard Hughes2015-08-031-1/+0
| | | | As ebassi pointed out, gchar* is NUL-terminated by definition...
* Drop the unused _len arguments on many functionsRichard Hughes2015-08-031-5/+2
| | | | | | Using the length of -1 for 'unknown' breaks the GIR-generated bindings. This breaks API and ABI and the soname has been updated to reflect this.
* Add as_node_add_attribute_as_int()Richard Hughes2014-10-011-0/+3
|
* Break Base64 encoded data up into block of 76 columnsRichard Hughes2014-10-011-0/+2
|
* Use libyaml to read DEP-11 metadataRichard Hughes2014-08-201-0/+2
| | | | | This is optional, but enabled by default. Use --disable-dep11 to remove the libyaml dependancy.
* trivial: Add AS_NODE_ERROR_INVALID_MARKUP for a less fatal errorRichard Hughes2014-08-051-0/+2
|
* Add AS_NODE_TO_XML_FLAG_SORT_CHILDRENRichard Hughes2014-06-241-0/+2
| | | | We may wish to sort the tags in the file when outputting human-readable XML.
* Add as_node_find_with_attribute()Richard Hughes2014-06-241-0/+5
| | | | This allows us to find a tag with a specific attribute.
* Add AS_NODE_INSERT_FLAG_MARK_TRANSLATABLERichard Hughes2014-06-241-0/+2
| | | | | This simply adds an understore to the tag name which marks it as translatable for intltool.
* Add as_node_remove_attribute()Richard Hughes2014-06-181-0/+2
|
* trivial: Export some more useful API from AsNodeRichard Hughes2014-06-181-0/+16
|
* Add as_node_to_file()Richard Hughes2014-06-181-0/+6
|
* Add as_node_get_comment()Richard Hughes2014-05-231-0/+3
| | | | | | | | | | Comments are stored as internal attributes to avoid growing the size of AsNodeData beyond 32 bits, although there is a performance penalty for this. As comments are not often encountered in documents (and not at all in the AppStream metadata fast path) this is probably okay. By default comments are not loaded from the document, use %AS_NODE_FROM_XML_FLAG_KEEP_COMMENTS when loading to enable this.
* Add a flag to as_node_to_xml() so it can process all childrenRichard Hughes2014-04-201-0/+2
| | | | This allows us to process all paragraphs in the AppStream description.
* Do not write xml:lang key versions when the same as the 'C' versionRichard Hughes2014-04-101-0/+2
|
* Load AppStream files assuming literal text stringsRichard Hughes2014-04-081-0/+2
| | | | | | | AppStream is a 'destination' format, so we don't want to try to parse the text data and reassemble strings and strip leading whitespace. However, as AsNode is used by AppData too (a source format) we just need to add a new flag to make this configurable.
* Add as_node_get_tag() and only store the name when the tag is unknownRichard Hughes2014-03-261-0/+3
| | | | | | | | | | | This has a drawback that we have to convert from string->enum quite a lot, but it turns out that the enum direct integer compare (compared to a strcmp) more than makes up for this. It also reduces the amount of small malloc()s when parsing metadata This speeds up parsing by ~7% and reduces the amount of memory required by ~5%. NOTE: the AsNodeData struct was re-ordered so it packs again into 32 bytes.
* Add an 'api-version' property to AsStore to generate old-style metadataRichard Hughes2014-03-201-0/+2
| | | | | This allows us to keep up with the latest API and still write metadata compatible with old applications not using libappstream-glib or libappstream.
* Add gtk-doc file headers and flesh out the documentationRichard Hughes2014-03-181-8/+37
|
* Add a AsNodeFromXmlFlags bitfield to allow future API additionsRichard Hughes2014-03-181-0/+8
|
* Unexport things we don't want to keep stableRichard Hughes2014-03-181-3/+0
|
* Add a lot of Gtk-Doc markup and generate a valid GIR fileRichard Hughes2014-03-171-0/+3
|
* Add as_node_from_file()Richard Hughes2014-03-171-0/+5
|
* Reduce the amount of string copying when parsing a GNode treeRichard Hughes2014-03-171-0/+1
| | | | | | By introducing as_node_take_data() we can take ownership of the string data, and avoid an extra g_strdup/g_free for each tag processed. This speeds up reading the sample data by ~5%.
* trivial: Add the single inclusion header guards in as-node.hRichard Hughes2014-03-171-3/+3
|
* Add as_node_get_localized_best() to get the best locale from a nodeRichard Hughes2014-03-131-0/+2
|
* Make as_app_add_language() more friendly for expat-style parsersRichard Hughes2014-03-131-0/+2
| | | | | We use <lang percentage=100>en_GB</lang> so the language itself has to be the text with the length, although used internally as the key.
* Add AsNodeRichard Hughes2014-03-131-0/+99