pacemaker  1.1.15-e174ec8
Scalable High-Availability cluster resource manager
io.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015
3  * Andrew Beekhof <andrew@beekhof.net>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU Lesser General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19 
26 /* public APIs from io.c are declared in util.h */
27 
28 #ifndef CRM_COMMON_IO__H
29 #define CRM_COMMON_IO__H
30 
31 #include <glib.h> /* for gboolean */
32 
33 char *generate_series_filename(const char *directory, const char *series, int sequence,
34  gboolean bzip);
35 int get_last_sequence(const char *directory, const char *series);
36 void write_last_sequence(const char *directory, const char *series, int sequence, int max);
37 int crm_chown_last_sequence(const char *directory, const char *series, uid_t uid, gid_t gid);
38 
39 gboolean crm_is_writable(const char *dir, const char *file, const char *user, const char *group,
40  gboolean need_both);
41 
42 void crm_sync_directory(const char *name);
43 
44 char *crm_read_contents(const char *filename);
45 int crm_write_sync(int fd, const char *contents);
46 
47 #endif /* CRM_COMMON_IO__H */
char * generate_series_filename(const char *directory, const char *series, int sequence, gboolean bzip)
Definition: io.c:85
int crm_chown_last_sequence(const char *directory, const char *series, uid_t uid, gid_t gid)
Definition: io.c:250
int get_last_sequence(const char *directory, const char *series)
Definition: io.c:121
gboolean crm_is_writable(const char *dir, const char *file, const char *user, const char *group, gboolean need_both)
Definition: io.c:278
void crm_sync_directory(const char *name)
Definition: io.c:357
int crm_write_sync(int fd, const char *contents)
Definition: io.c:440
char * crm_read_contents(const char *filename)
Definition: io.c:394
void write_last_sequence(const char *directory, const char *series, int sequence, int max)
Definition: io.c:193