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