]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/shared/logs-show.h
Merge pull request #2495 from heftig/master
[thirdparty/systemd.git] / src / shared / logs-show.h
1 #pragma once
2
3 /***
4 This file is part of systemd.
5
6 Copyright 2012 Lennart Poettering
7
8 systemd is free software; you can redistribute it and/or modify it
9 under the terms of the GNU Lesser General Public License as published by
10 the Free Software Foundation; either version 2.1 of the License, or
11 (at your option) any later version.
12
13 systemd is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public License
19 along with systemd; If not, see <http://www.gnu.org/licenses/>.
20 ***/
21
22 #include <stdbool.h>
23 #include <stddef.h>
24 #include <stdio.h>
25 #include <sys/types.h>
26
27 #include "sd-journal.h"
28
29 #include "macro.h"
30 #include "output-mode.h"
31 #include "time-util.h"
32 #include "util.h"
33
34 int output_journal(
35 FILE *f,
36 sd_journal *j,
37 OutputMode mode,
38 unsigned n_columns,
39 OutputFlags flags,
40 bool *ellipsized);
41
42 int add_match_this_boot(sd_journal *j, const char *machine);
43
44 int add_matches_for_unit(
45 sd_journal *j,
46 const char *unit);
47
48 int add_matches_for_user_unit(
49 sd_journal *j,
50 const char *unit,
51 uid_t uid);
52
53 int show_journal_by_unit(
54 FILE *f,
55 const char *unit,
56 OutputMode mode,
57 unsigned n_columns,
58 usec_t not_before,
59 unsigned how_many,
60 uid_t uid,
61 OutputFlags flags,
62 int journal_open_flags,
63 bool system_unit,
64 bool *ellipsized);
65
66 void json_escape(
67 FILE *f,
68 const char* p,
69 size_t l,
70 OutputFlags flags);
71
72 const char* output_mode_to_string(OutputMode m) _const_;
73 OutputMode output_mode_from_string(const char *s) _pure_;