edelib  2.1.0
Missing.h
1 /*
2  * $Id: Missing.h 2944 2009-11-17 13:20:31Z karijes $
3  *
4  * Provides the missing functions
5  * Copyright (c) 2005-2007 edelib authors
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with this library. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef __EDELIB_MISSING_H__
22 #define __EDELIB_MISSING_H__
23 
24 #include "edelib-global.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 /* include dirent intentionally so we can emulate it if missing */
31 #include <dirent.h>
32 
42 EDELIB_API int edelib_setenv(const char* name, const char* value, int overwrite);
43 
48 EDELIB_API int edelib_unsetenv(const char* name);
49 
53 EDELIB_API unsigned int edelib_strnlen(const char* str, unsigned int maxlen);
54 
59 EDELIB_API char* edelib_strndup(const char* str, unsigned int maxlen);
60 
67 EDELIB_API unsigned long edelib_strlcpy(char* dst, const char* src, unsigned long sz);
68 
75 EDELIB_API unsigned long edelib_strlcat(char* dst, const char* src, unsigned long sz);
76 
81 EDELIB_API int edelib_scandir(const char* dir, struct dirent*** namelist,
82  int (*filter)(const struct dirent* name),
83  int (*compar)(struct dirent** n1, struct dirent** n2));
84 
89 EDELIB_API int edelib_alphasort(struct dirent **n1, struct dirent **n2);
90 
95 EDELIB_API int edelib_daemon(int nochdir, int noclose);
96 
97 #ifdef __cplusplus
98 }
99 #endif
100 
101 #endif
int edelib_scandir(const char *dir, struct dirent ***namelist, int(*filter)(const struct dirent *name), int(*compar)(struct dirent **n1, struct dirent **n2))
unsigned long edelib_strlcat(char *dst, const char *src, unsigned long sz)
unsigned long edelib_strlcpy(char *dst, const char *src, unsigned long sz)
int edelib_alphasort(struct dirent **n1, struct dirent **n2)
int edelib_setenv(const char *name, const char *value, int overwrite)
int edelib_daemon(int nochdir, int noclose)
int edelib_unsetenv(const char *name)
unsigned int filter(const F &func, const T &container, T &ret)
Definition: Functional.h:38
char * edelib_strndup(const char *str, unsigned int maxlen)