]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/shared/logs-show.h
tty-ask-password: Split out password sending
[thirdparty/systemd.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 <stddef.h>
26 #include <stdio.h>
27 #include <sys/types.h>
28
29 #include "sd-journal.h"
30
31 #include "macro.h"
32 #include "output-mode.h"
33 #include "time-util.h"
34 #include "util.h"
35
36 int output_journal(
37 FILE *f,
38 sd_journal *j,
39 OutputMode mode,
40 unsigned n_columns,
41 OutputFlags flags,
42 bool *ellipsized);
43
44 int add_match_this_boot(sd_journal *j, const char *machine);
45
46 int add_matches_for_unit(
47 sd_journal *j,
48 const char *unit);
49
50 int add_matches_for_user_unit(
51 sd_journal *j,
52 const char *unit,
53 uid_t uid);
54
55 int show_journal_by_unit(
56 FILE *f,
57 const char *unit,
58 OutputMode mode,
59 unsigned n_columns,
60 usec_t not_before,
61 unsigned how_many,
62 uid_t uid,
63 OutputFlags flags,
64 int journal_open_flags,
65 bool system_unit,
66 bool *ellipsized);
67
68 void json_escape(
69 FILE *f,
70 const char* p,
71 size_t l,
72 OutputFlags flags);
73
74 const char* output_mode_to_string(OutputMode m) _const_;
75 OutputMode output_mode_from_string(const char *s) _pure_;