]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/shared/logs-show.h
Add __attribute__((const, pure, format)) in various places
[thirdparty/systemd.git] / src / shared / logs-show.h
CommitLineData
86aa7ba4
LP
1/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
2
c2f1db8f 3#pragma once
86aa7ba4
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
5430f7f2
LP
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
86aa7ba4
LP
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
5430f7f2 18 Lesser General Public License for more details.
86aa7ba4 19
5430f7f2 20 You should have received a copy of the GNU Lesser General Public License
86aa7ba4
LP
21 along with systemd; If not, see <http://www.gnu.org/licenses/>.
22***/
23
24#include <stdbool.h>
1a6c43e9
MT
25#include <unistd.h>
26#include <sys/types.h>
86aa7ba4 27
81527be1
LP
28#include <systemd/sd-journal.h>
29
86aa7ba4 30#include "util.h"
9bdbc2e2 31#include "output-mode.h"
25277cd7 32
08ace05b
LP
33int output_journal(
34 FILE *f,
35 sd_journal *j,
36 OutputMode mode,
37 unsigned n_columns,
38 OutputFlags flags);
86aa7ba4 39
886a64fe
ZJS
40int add_matches_for_unit(
41 sd_journal *j,
42 const char *unit);
43
44int add_matches_for_user_unit(
45 sd_journal *j,
df50185b 46 const char *unit,
886a64fe 47 uid_t uid);
df50185b 48
886a64fe 49int show_journal_by_unit(
1a6c43e9
MT
50 FILE *f,
51 const char *unit,
52 OutputMode mode,
53 unsigned n_columns,
54 usec_t not_before,
55 unsigned how_many,
56 uid_t uid,
886a64fe
ZJS
57 OutputFlags flags,
58 bool system);
1a6c43e9 59
240a5fe8
LP
60void json_escape(
61 FILE *f,
62 const char* p,
63 size_t l,
64 OutputFlags flags);
65
44a6b1b6
ZJS
66const char* output_mode_to_string(OutputMode m) _const_;
67OutputMode output_mode_from_string(const char *s) _pure_;