Sophie

Sophie

distrib > Mageia > 6 > armv7hl > by-pkgid > 302473efd5d8804d45197576e257a9ed > files > 159

libappstream-devel-0.11.8-1.mga6.armv7hl.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>as-spdx: AppStream Library Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="index.html" title="AppStream Library Reference Manual">
<link rel="up" href="ch01.html" title="AppStream API Reference">
<link rel="prev" href="appstream-AsValidatorIssue.html" title="AsValidatorIssue">
<link rel="next" href="appstream-as-utils.html" title="as-utils">
<meta name="generator" content="GTK-Doc V1.25 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
                  <a href="#appstream-as-spdx.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="appstream-AsValidatorIssue.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="appstream-as-utils.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="appstream-as-spdx"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="appstream-as-spdx.top_of_page"></a>as-spdx</span></h2>
<p>as-spdx — Helper functions to work with SPDX license descriptions.</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="appstream-as-spdx.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="appstream-as-spdx.html#as-is-spdx-license-id" title="as_is_spdx_license_id ()">as_is_spdx_license_id</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="appstream-as-spdx.html#as-is-spdx-license-expression" title="as_is_spdx_license_expression ()">as_is_spdx_license_expression</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> **
</td>
<td class="function_name">
<a class="link" href="appstream-as-spdx.html#as-spdx-license-tokenize" title="as_spdx_license_tokenize ()">as_spdx_license_tokenize</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="appstream-as-spdx.html#as-spdx-license-detokenize" title="as_spdx_license_detokenize ()">as_spdx_license_detokenize</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="appstream-as-spdx.html#as-license-to-spdx-id" title="as_license_to_spdx_id ()">as_license_to_spdx_id</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="appstream-as-spdx.html#as-license-is-metadata-license" title="as_license_is_metadata_license ()">as_license_is_metadata_license</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="appstream-as-spdx.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include &lt;appstream.h&gt;
</pre>
</div>
<div class="refsect1">
<a name="appstream-as-spdx.description"></a><h2>Description</h2>
</div>
<div class="refsect1">
<a name="appstream-as-spdx.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="as-is-spdx-license-id"></a><h3>as_is_spdx_license_id ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
as_is_spdx_license_id (<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *license_id</code></em>);</pre>
<p>Searches the known list of SPDX license IDs.</p>
<div class="refsect3">
<a name="as-is-spdx-license-id.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>license_id</p></td>
<td class="parameter_description"><p>a single SPDX license ID, e.g. "GPL-3.0"</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="as-is-spdx-license-id.returns"></a><h4>Returns</h4>
<p> <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the icon is a valid "SPDX license ID"</p>
</div>
<p class="since">Since: 0.9.8</p>
</div>
<hr>
<div class="refsect2">
<a name="as-is-spdx-license-expression"></a><h3>as_is_spdx_license_expression ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
as_is_spdx_license_expression (<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *license</code></em>);</pre>
<p>Checks the licence string to check it being a valid licence.
NOTE: SPDX licences can't typically contain brackets.</p>
<div class="refsect3">
<a name="as-is-spdx-license-expression.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>license</p></td>
<td class="parameter_description"><p>a SPDX license string, e.g. "CC-BY-3.0 and GFDL-1.3"</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="as-is-spdx-license-expression.returns"></a><h4>Returns</h4>
<p> <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the icon is a valid "SPDX license"</p>
</div>
<p class="since">Since: 0.9.8</p>
</div>
<hr>
<div class="refsect2">
<a name="as-spdx-license-tokenize"></a><h3>as_spdx_license_tokenize ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> **
as_spdx_license_tokenize (<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *license</code></em>);</pre>
<p>Tokenizes the SPDX license string (or any simarly formatted string)
into parts. Any licence parts of the string e.g. "LGPL-2.0+" are prefexed
with "@", the conjunctive replaced with "&amp;" and the disjunctive replaced
with "|". Brackets are added as indervidual tokens and other strings are
appended into single tokens where possible.</p>
<div class="refsect3">
<a name="as-spdx-license-tokenize.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>license</p></td>
<td class="parameter_description"><p>a license string, e.g. "LGPLv2+ and (QPL or GPLv2) and MIT"</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="as-spdx-license-tokenize.returns"></a><h4>Returns</h4>
<p> array of strings, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> for invalid. </p>
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
<p class="since">Since: 0.9.8</p>
</div>
<hr>
<div class="refsect2">
<a name="as-spdx-license-detokenize"></a><h3>as_spdx_license_detokenize ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
as_spdx_license_detokenize (<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> **license_tokens</code></em>);</pre>
<p>De-tokenizes the SPDX licenses into a string.</p>
<div class="refsect3">
<a name="as-spdx-license-detokenize.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>license_tokens</p></td>
<td class="parameter_description"><p>license tokens, typically from <a class="link" href="appstream-as-spdx.html#as-spdx-license-tokenize" title="as_spdx_license_tokenize ()"><code class="function">as_spdx_license_tokenize()</code></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="as-spdx-license-detokenize.returns"></a><h4>Returns</h4>
<p> string, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> for invalid. </p>
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
<p class="since">Since: 0.9.8</p>
</div>
<hr>
<div class="refsect2">
<a name="as-license-to-spdx-id"></a><h3>as_license_to_spdx_id ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
as_license_to_spdx_id (<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *license</code></em>);</pre>
<p>Converts a non-SPDX license into an SPDX format string where possible.</p>
<div class="refsect3">
<a name="as-license-to-spdx-id.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>license</p></td>
<td class="parameter_description"><p>a not-quite SPDX license string, e.g. "GPLv3+"</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="as-license-to-spdx-id.returns"></a><h4>Returns</h4>
<p> the best-effort SPDX license string</p>
</div>
<p class="since">Since: 0.9.8</p>
</div>
<hr>
<div class="refsect2">
<a name="as-license-is-metadata-license"></a><h3>as_license_is_metadata_license ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
as_license_is_metadata_license (<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *license</code></em>);</pre>
<p>Check if the metadata license is suitable for mixing with other
metadata and redistributing the bundled result (this means we
prefer permissive licenses here, to not require people shipping
catalog metadata to perform a full license review).</p>
<p>This method checks against a hardcoded list of permissive licenses
commonly used to license metadata under.</p>
<p>Retrurns: <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the license contains only permissive licenses suitable
as metadata license.</p>
<div class="refsect3">
<a name="as-license-is-metadata-license.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>license</p></td>
<td class="parameter_description"><p>The SPDX license string to test.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
</div>
<div class="refsect1">
<a name="appstream-as-spdx.other_details"></a><h2>Types and Values</h2>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.25</div>
</body>
</html>