2012-01-03 21:08:28 +01:00
|
|
|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
|
|
|
|
|
2012-07-18 19:07:51 +02:00
|
|
|
#pragma once
|
2012-01-03 21:08:28 +01:00
|
|
|
|
|
|
|
/***
|
|
|
|
This file is part of systemd.
|
|
|
|
|
|
|
|
Copyright 2012 Lennart Poettering
|
|
|
|
|
|
|
|
systemd is free software; you can redistribute it and/or modify it
|
2012-04-12 00:20:58 +02:00
|
|
|
under the terms of the GNU Lesser General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2.1 of the License, or
|
2012-01-03 21:08:28 +01:00
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
systemd is distributed in the hope that it will be useful, but
|
|
|
|
WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2012-04-12 00:20:58 +02:00
|
|
|
Lesser General Public License for more details.
|
2012-01-03 21:08:28 +01:00
|
|
|
|
2012-04-12 00:20:58 +02:00
|
|
|
You should have received a copy of the GNU Lesser General Public License
|
2012-01-03 21:08:28 +01:00
|
|
|
along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
***/
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
2013-01-17 18:55:07 +01:00
|
|
|
#include <sys/types.h>
|
2012-01-03 21:08:28 +01:00
|
|
|
|
2015-01-08 14:38:52 +01:00
|
|
|
#include "sd-journal.h"
|
2012-01-05 16:01:58 +01:00
|
|
|
|
2012-01-03 21:08:28 +01:00
|
|
|
#include "util.h"
|
2013-01-14 18:16:50 +01:00
|
|
|
#include "output-mode.h"
|
2012-07-17 07:35:06 +02:00
|
|
|
|
2012-09-27 23:27:10 +02:00
|
|
|
int output_journal(
|
|
|
|
FILE *f,
|
|
|
|
sd_journal *j,
|
|
|
|
OutputMode mode,
|
|
|
|
unsigned n_columns,
|
2013-08-04 01:38:13 +02:00
|
|
|
OutputFlags flags,
|
|
|
|
bool *ellipsized);
|
2012-01-03 21:08:28 +01:00
|
|
|
|
2013-12-11 22:04:03 +01:00
|
|
|
int add_match_this_boot(sd_journal *j, const char *machine);
|
2013-06-04 00:28:12 +02:00
|
|
|
|
2013-03-14 00:30:05 +01:00
|
|
|
int add_matches_for_unit(
|
|
|
|
sd_journal *j,
|
|
|
|
const char *unit);
|
|
|
|
|
|
|
|
int add_matches_for_user_unit(
|
|
|
|
sd_journal *j,
|
2012-01-04 18:33:36 +01:00
|
|
|
const char *unit,
|
2013-03-14 00:30:05 +01:00
|
|
|
uid_t uid);
|
2012-01-04 18:33:36 +01:00
|
|
|
|
2013-03-14 00:30:05 +01:00
|
|
|
int show_journal_by_unit(
|
2013-01-17 18:55:07 +01:00
|
|
|
FILE *f,
|
|
|
|
const char *unit,
|
|
|
|
OutputMode mode,
|
|
|
|
unsigned n_columns,
|
|
|
|
usec_t not_before,
|
|
|
|
unsigned how_many,
|
|
|
|
uid_t uid,
|
2013-03-14 00:30:05 +01:00
|
|
|
OutputFlags flags,
|
2015-01-08 14:38:52 +01:00
|
|
|
int journal_open_flags,
|
|
|
|
bool system_unit,
|
2013-08-04 01:38:13 +02:00
|
|
|
bool *ellipsized);
|
2013-01-17 18:55:07 +01:00
|
|
|
|
2012-10-18 22:31:27 +02:00
|
|
|
void json_escape(
|
|
|
|
FILE *f,
|
|
|
|
const char* p,
|
|
|
|
size_t l,
|
|
|
|
OutputFlags flags);
|
|
|
|
|
2013-05-03 04:51:50 +02:00
|
|
|
const char* output_mode_to_string(OutputMode m) _const_;
|
|
|
|
OutputMode output_mode_from_string(const char *s) _pure_;
|