]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/sd_journal_get_catalog.xml
tree-wide: remove Lennart's copyright lines
[thirdparty/systemd.git] / man / sd_journal_get_catalog.xml
1 <?xml version='1.0'?> <!--*-nxml-*-->
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4
5 <!--
6 SPDX-License-Identifier: LGPL-2.1+
7 -->
8
9 <refentry id="sd_journal_get_catalog" xmlns:xi="http://www.w3.org/2001/XInclude">
10
11 <refentryinfo>
12 <title>sd_journal_get_catalog</title>
13 <productname>systemd</productname>
14
15 <authorgroup>
16 <author>
17 <contrib>Developer</contrib>
18 <firstname>Lennart</firstname>
19 <surname>Poettering</surname>
20 <email>lennart@poettering.net</email>
21 </author>
22 </authorgroup>
23 </refentryinfo>
24
25 <refmeta>
26 <refentrytitle>sd_journal_get_catalog</refentrytitle>
27 <manvolnum>3</manvolnum>
28 </refmeta>
29
30 <refnamediv>
31 <refname>sd_journal_get_catalog</refname>
32 <refname>sd_journal_get_catalog_for_message_id</refname>
33 <refpurpose>Retrieve message catalog entry</refpurpose>
34 </refnamediv>
35
36 <refsynopsisdiv>
37 <funcsynopsis>
38 <funcsynopsisinfo>#include &lt;systemd/sd-journal.h&gt;</funcsynopsisinfo>
39
40 <funcprototype>
41 <funcdef>int <function>sd_journal_get_catalog</function></funcdef>
42 <paramdef>sd_journal *<parameter>j</parameter></paramdef>
43 <paramdef>char **<parameter>ret</parameter></paramdef>
44 </funcprototype>
45
46 <funcprototype>
47 <funcdef>int <function>sd_journal_get_catalog_for_message_id</function></funcdef>
48 <paramdef>sd_id128_t <parameter>id</parameter></paramdef>
49 <paramdef>char **<parameter>ret</parameter></paramdef>
50 </funcprototype>
51
52 </funcsynopsis>
53 </refsynopsisdiv>
54
55 <refsect1>
56 <title>Description</title>
57
58 <para><function>sd_journal_get_catalog()</function> retrieves a
59 message catalog entry for the current journal entry. This will
60 look up an entry in the message catalog by using the
61 <literal>MESSAGE_ID=</literal> field of the current journal entry.
62 Before returning the entry all journal field names in the catalog
63 entry text enclosed in "@" will be replaced by the respective
64 field values of the current entry. If a field name referenced in
65 the message catalog entry does not exist, in the current journal
66 entry, the "@" will be removed, but the field name otherwise left
67 untouched.</para>
68
69 <para><function>sd_journal_get_catalog_for_message_id()</function>
70 works similar to <function>sd_journal_get_catalog()</function> but
71 the entry is looked up by the specified message ID (no open
72 journal context is necessary for this), and no field substitution
73 is performed.</para>
74
75 <para>For more information about the journal message catalog
76 please refer to the <ulink
77 url="https://www.freedesktop.org/wiki/Software/systemd/catalog">Journal
78 Message Catalogs</ulink> documentation page.</para>
79 </refsect1>
80
81 <refsect1>
82 <title>Return Value</title>
83
84 <para><function>sd_journal_get_catalog()</function> and
85 <function>sd_journal_get_catalog_for_message_id()</function>
86 return 0 on success or a negative errno-style error code. If no
87 matching message catalog entry is found, -ENOENT is
88 returned.</para>
89
90 <para>On successful return, <parameter>ret</parameter> points to a
91 new string, which must be freed with
92 <citerefentry project='man-pages'><refentrytitle>free</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
93 </para>
94 </refsect1>
95
96 <refsect1>
97 <title>Notes</title>
98
99 <para>Function <function>sd_journal_get_catalog()</function> is thread-agnostic and only a
100 single thread may operate on a given <structname>sd_journal</structname> object. Function
101 <function>sd_journal_get_catalog_for_message_id()</function> is thread-safe.</para>
102
103 <xi:include href="libsystemd-pkgconfig.xml" xpointer="pkgconfig-text"/>
104 </refsect1>
105
106 <refsect1>
107 <title>See Also</title>
108
109 <para>
110 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
111 <citerefentry><refentrytitle>systemd.journal-fields</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
112 <citerefentry><refentrytitle>sd-journal</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
113 <citerefentry><refentrytitle>sd_journal_open</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
114 <citerefentry><refentrytitle>sd_journal_next</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
115 <citerefentry><refentrytitle>sd_journal_get_data</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
116 <citerefentry project='man-pages'><refentrytitle>malloc</refentrytitle><manvolnum>3</manvolnum></citerefentry>
117 </para>
118 </refsect1>
119
120 </refentry>