Missing.h
/*
* $Id: Missing.h 2944 2009-11-17 13:20:31Z karijes $
*
* Provides the missing functions
* Copyright (c) 2005-2007 edelib authors
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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 this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __EDELIB_MISSING_H__
#define __EDELIB_MISSING_H__
#include "edelib-global.h"
#ifdef __cplusplus
extern "C" {
#endif
/* include dirent intentionally so we can emulate it if missing */
#include <dirent.h>
EDELIB_API int edelib_setenv(const char* name, const char* value, int overwrite);
EDELIB_API int edelib_unsetenv(const char* name);
EDELIB_API unsigned int edelib_strnlen(const char* str, unsigned int maxlen);
EDELIB_API char* edelib_strndup(const char* str, unsigned int maxlen);
EDELIB_API unsigned long edelib_strlcpy(char* dst, const char* src, unsigned long sz);
EDELIB_API unsigned long edelib_strlcat(char* dst, const char* src, unsigned long sz);
EDELIB_API int edelib_scandir(const char* dir, struct dirent*** namelist,
int (*filter)(const struct dirent* name),
int (*compar)(struct dirent** n1, struct dirent** n2));
EDELIB_API int edelib_alphasort(struct dirent **n1, struct dirent **n2);
EDELIB_API int edelib_daemon(int nochdir, int noclose);
#ifdef __cplusplus
}
#endif
#endif
edelib_scandir
int edelib_scandir(const char *dir, struct dirent ***namelist, int(*filter)(const struct dirent *name), int(*compar)(struct dirent **n1, struct dirent **n2))
edelib_strlcat
unsigned long edelib_strlcat(char *dst, const char *src, unsigned long sz)
edelib_strlcpy
unsigned long edelib_strlcpy(char *dst, const char *src, unsigned long sz)
edelib_alphasort
int edelib_alphasort(struct dirent **n1, struct dirent **n2)
edelib_setenv
int edelib_setenv(const char *name, const char *value, int overwrite)
edelib_daemon
int edelib_daemon(int nochdir, int noclose)
edelib_unsetenv
int edelib_unsetenv(const char *name)
edelib::filter
unsigned int filter(const F &func, const T &container, T &ret)
Definition: Functional.h:38
edelib_strndup
char * edelib_strndup(const char *str, unsigned int maxlen)