ctdb-common: Add path support for datadir
[vlendec/samba-autobuild/.git] / ctdb / common / path.h
1 /*
2    Construct runtime paths
3
4    Copyright (C) Amitay Isaacs  2018
5
6    This program is free software; you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 3 of the License, or
9    (at your option) any later version.
10
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with this program; if not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #ifndef __CTDB_PATH_H__
21 #define __CTDB_PATH_H__
22
23 #include <talloc.h>
24
25 const char *path_datadir(void);
26 const char *path_etcdir(void);
27 const char *path_rundir(void);
28 const char *path_vardir(void);
29
30 char *path_datadir_append(TALLOC_CTX *mem_ctx, const char *path);
31 char *path_etcdir_append(TALLOC_CTX *mem_ctx, const char *path);
32 char *path_rundir_append(TALLOC_CTX *mem_ctx, const char *path);
33 char *path_vardir_append(TALLOC_CTX *mem_ctx, const char *path);
34
35 char *path_config(TALLOC_CTX *mem_ctx);
36 char *path_socket(TALLOC_CTX *mem_ctx, const char *daemon);
37 char *path_pidfile(TALLOC_CTX *mem_ctx, const char *daemon);
38
39 #endif /* __CTDB_PATH_H__ */