2012-01-04 00:08:28 +04:00
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
2012-07-18 21:07:51 +04:00
# pragma once
2012-01-04 00:08:28 +04: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 02:20:58 +04: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-04 00:08:28 +04: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 02:20:58 +04:00
Lesser General Public License for more details .
2012-01-04 00:08:28 +04:00
2012-04-12 02:20:58 +04:00
You should have received a copy of the GNU Lesser General Public License
2012-01-04 00:08:28 +04:00
along with systemd ; If not , see < http : //www.gnu.org/licenses/>.
* * */
# include <stdbool.h>
2013-01-17 21:55:07 +04:00
# include <sys/types.h>
2012-01-04 00:08:28 +04:00
2015-01-08 16:38:52 +03:00
# include "sd-journal.h"
2012-01-05 19:01:58 +04:00
2012-01-04 00:08:28 +04:00
# include "util.h"
2013-01-14 21:16:50 +04:00
# include "output-mode.h"
2012-07-17 09:35:06 +04:00
2012-09-28 01:27:10 +04:00
int output_journal (
FILE * f ,
sd_journal * j ,
OutputMode mode ,
unsigned n_columns ,
2013-08-04 03:38:13 +04:00
OutputFlags flags ,
bool * ellipsized ) ;
2012-01-04 00:08:28 +04:00
2013-12-12 01:04:03 +04:00
int add_match_this_boot ( sd_journal * j , const char * machine ) ;
2013-06-04 02:28:12 +04:00
2013-03-14 03:30:05 +04:00
int add_matches_for_unit (
sd_journal * j ,
const char * unit ) ;
int add_matches_for_user_unit (
sd_journal * j ,
2012-01-04 21:33:36 +04:00
const char * unit ,
2013-03-14 03:30:05 +04:00
uid_t uid ) ;
2012-01-04 21:33:36 +04:00
2013-03-14 03:30:05 +04:00
int show_journal_by_unit (
2013-01-17 21:55:07 +04:00
FILE * f ,
const char * unit ,
OutputMode mode ,
unsigned n_columns ,
usec_t not_before ,
unsigned how_many ,
uid_t uid ,
2013-03-14 03:30:05 +04:00
OutputFlags flags ,
2015-01-08 16:38:52 +03:00
int journal_open_flags ,
bool system_unit ,
2013-08-04 03:38:13 +04:00
bool * ellipsized ) ;
2013-01-17 21:55:07 +04:00
2012-10-19 00:31:27 +04:00
void json_escape (
FILE * f ,
const char * p ,
size_t l ,
OutputFlags flags ) ;
2013-05-03 06:51:50 +04:00
const char * output_mode_to_string ( OutputMode m ) _const_ ;
OutputMode output_mode_from_string ( const char * s ) _pure_ ;