fileio.h revision d390f8ef2dc0cd041914d3c2fd3e1081605cbfc8
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
#pragma once
/***
This file is part of systemd.
Copyright 2010 Lennart Poettering
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
(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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include <dirent.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdio.h>
#include "macro.h"
#include "time-util.h"
typedef enum {
int write_env_file(const char *fname, char **l);
int get_proc_field(const char *filename, const char *pattern, const char *terminator, char **field);
int search_and_fopen(const char *path, const char *mode, const char *root, const char **search, FILE **_f);
int search_and_fopen_nulstr(const char *path, const char *mode, const char *root, const char *search, FILE **_f);
for (;;) \
if (ferror(f)) { \
on_error; \
} \
break; \
} else
int fflush_and_check(FILE *f);