Initial commit
[mkdir_p.git] / mkdir_p.h
1 /*
2  * mkdir_p, a very simple `mkdir -p` implementation in C
3  * Copyright (C) 2016  Rafał Długołęcki
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; version 2 of the License.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  */
14
15 #ifndef __MKDIR_P_H
16 #define __MKDIR_P_H
17
18 #include <sys/types.h>
19
20 #define MKDIR_P_VERSION "0.1"
21 #define MKDIR_P_SEPARATOR '/'
22
23 /**
24  * Creates directory, when parent directories are missing, creates them too
25  *
26  * @param pathname NULL terminated string containing directory path
27  * @param mode specifies permissions for created directories (parameter is
28  *             passed directly to the mkdir)
29  */
30 int mkdir_p(const char *pathname, mode_t mode);
31
32 #endif /* __MKDIR_P_H */