]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/sd_journal_get_catalog.xml
Update Brazilian Portuguese translation (#5694)
[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<!--
6 This file is part of systemd.
7
8 Copyright 2012 Lennart Poettering
9
10 systemd is free software; you can redistribute it and/or modify it
11 under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
14
15 systemd is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
19
20 You should have received a copy of the GNU Lesser General Public License
21 along with systemd; If not, see <http://www.gnu.org/licenses/>.
22-->
23
24<refentry id="sd_journal_get_catalog">
25
798d3a52
ZJS
26 <refentryinfo>
27 <title>sd_journal_get_catalog</title>
28 <productname>systemd</productname>
29
30 <authorgroup>
31 <author>
32 <contrib>Developer</contrib>
33 <firstname>Lennart</firstname>
34 <surname>Poettering</surname>
35 <email>lennart@poettering.net</email>
36 </author>
37 </authorgroup>
38 </refentryinfo>
39
40 <refmeta>
41 <refentrytitle>sd_journal_get_catalog</refentrytitle>
42 <manvolnum>3</manvolnum>
43 </refmeta>
44
45 <refnamediv>
46 <refname>sd_journal_get_catalog</refname>
47 <refname>sd_journal_get_catalog_for_message_id</refname>
48 <refpurpose>Retrieve message catalog entry</refpurpose>
49 </refnamediv>
50
51 <refsynopsisdiv>
52 <funcsynopsis>
53 <funcsynopsisinfo>#include &lt;systemd/sd-journal.h&gt;</funcsynopsisinfo>
54
55 <funcprototype>
56 <funcdef>int <function>sd_journal_get_catalog</function></funcdef>
57 <paramdef>sd_journal *<parameter>j</parameter></paramdef>
58 <paramdef>char **<parameter>ret</parameter></paramdef>
59 </funcprototype>
60
61 <funcprototype>
62 <funcdef>int <function>sd_journal_get_catalog_for_message_id</function></funcdef>
63 <paramdef>sd_id128_t <parameter>id</parameter></paramdef>
64 <paramdef>char **<parameter>ret</parameter></paramdef>
65 </funcprototype>
66
67
68 </funcsynopsis>
69 </refsynopsisdiv>
70
71 <refsect1>
72 <title>Description</title>
73
74 <para><function>sd_journal_get_catalog()</function> retrieves a
75 message catalog entry for the current journal entry. This will
76 look up an entry in the message catalog by using the
77 <literal>MESSAGE_ID=</literal> field of the current journal entry.
78 Before returning the entry all journal field names in the catalog
79 entry text enclosed in "@" will be replaced by the respective
80 field values of the current entry. If a field name referenced in
81 the message catalog entry does not exist, in the current journal
82 entry, the "@" will be removed, but the field name otherwise left
83 untouched.</para>
84
85 <para><function>sd_journal_get_catalog_for_message_id()</function>
86 works similar to <function>sd_journal_get_catalog()</function> but
87 the entry is looked up by the specified message ID (no open
88 journal context is necessary for this), and no field substitution
89 is performed.</para>
90
91 <para>For more information about the journal message catalog
92 please refer to the <ulink
28a0ad81 93 url="https://www.freedesktop.org/wiki/Software/systemd/catalog">Journal
798d3a52
ZJS
94 Message Catalogs</ulink> documentation page.</para>
95 </refsect1>
96
97 <refsect1>
98 <title>Return Value</title>
99
100 <para><function>sd_journal_get_catalog()</function> and
101 <function>sd_journal_get_catalog_for_message_id()</function>
102 return 0 on success or a negative errno-style error code. If no
103 matching message catalog entry is found, -ENOENT is
104 returned.</para>
105
106 <para>On successful return, <parameter>ret</parameter> points to a
107 new string, which must be freed with
108 <citerefentry project='man-pages'><refentrytitle>free</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
109 </para>
110 </refsect1>
111
112 <refsect1>
113 <title>Notes</title>
114
a8d46a16
ZJS
115 <para>Function <function>sd_journal_get_catalog()</function> is thread-agnostic and only a
116 single thread may operate on a given <structname>sd_journal</structname> object. Function
117 <function>sd_journal_get_catalog_for_message_id() is thread-safe.</function></para>
118
798d3a52
ZJS
119 <para>The <function>sd_journal_get_catalog()</function> and
120 <function>sd_journal_get_catalog_for_message_id()</function>
121 interfaces are available as a shared library, which can be
122 compiled and linked to with the
123 <constant>libsystemd</constant> <citerefentry project='die-net'><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry>
124 file.</para>
125 </refsect1>
126
127 <refsect1>
128 <title>See Also</title>
129
130 <para>
131 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
132 <citerefentry><refentrytitle>systemd.journal-fields</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
133 <citerefentry><refentrytitle>sd-journal</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
134 <citerefentry><refentrytitle>sd_journal_open</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
135 <citerefentry><refentrytitle>sd_journal_next</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
136 <citerefentry><refentrytitle>sd_journal_get_data</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
3ba3a79d 137 <citerefentry project='man-pages'><refentrytitle>malloc</refentrytitle><manvolnum>3</manvolnum></citerefentry>
798d3a52
ZJS
138 </para>
139 </refsect1>
f2cf0403
LP
140
141</refentry>