chiark / gitweb /
Add set_consume which always takes ownership
[elogind.git] / src / shared / logs-show.h
1 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
2
3 #pragma once
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 #include <stdbool.h>
25 #include <unistd.h>
26 #include <sys/types.h>
27
28 #include <systemd/sd-journal.h>
29
30 #include "util.h"
31 #include "output-mode.h"
32
33 int output_journal(
34                 FILE *f,
35                 sd_journal *j,
36                 OutputMode mode,
37                 unsigned n_columns,
38                 OutputFlags flags);
39
40 int add_matches_for_unit(
41                 sd_journal *j,
42                 const char *unit);
43
44 int add_matches_for_user_unit(
45                 sd_journal *j,
46                 const char *unit,
47                 uid_t uid);
48
49 int show_journal_by_unit(
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,
57                 OutputFlags flags,
58                 bool system);
59
60 void json_escape(
61                 FILE *f,
62                 const char* p,
63                 size_t l,
64                 OutputFlags flags);
65
66 const char* output_mode_to_string(OutputMode m);
67 OutputMode output_mode_from_string(const char *s);