2013-01-03 05:49:33 -05:00
|
|
|
/*
|
|
|
|
* util-common.h
|
|
|
|
*
|
2016-01-02 22:48:43 -05:00
|
|
|
* Copyright (c) 2006-2016 Pacman Development Team <pacman-dev@archlinux.org>
|
2013-01-03 05:49:33 -05:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program 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 General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _PM_UTIL_COMMON_H
|
|
|
|
#define _PM_UTIL_COMMON_H
|
|
|
|
|
2014-08-06 16:36:00 -04:00
|
|
|
#include <stdio.h>
|
2014-06-26 11:50:34 -04:00
|
|
|
#include <sys/stat.h> /* struct stat */
|
|
|
|
|
2013-01-03 05:49:33 -05:00
|
|
|
const char *mbasename(const char *path);
|
|
|
|
char *mdirname(const char *path);
|
|
|
|
|
2014-06-26 11:52:05 -04:00
|
|
|
int llstat(char *path, struct stat *buf);
|
2014-06-26 11:50:34 -04:00
|
|
|
|
2014-08-06 16:36:00 -04:00
|
|
|
char *safe_fgets(char *s, int size, FILE *stream);
|
|
|
|
|
2015-09-14 18:37:38 -04:00
|
|
|
size_t strtrim(char *str);
|
|
|
|
|
2013-01-03 05:49:33 -05:00
|
|
|
#ifndef HAVE_STRNDUP
|
|
|
|
char *strndup(const char *s, size_t n);
|
|
|
|
#endif
|
|
|
|
|
2015-10-21 05:11:17 -04:00
|
|
|
#define ARRAYSIZE(a) (sizeof (a) / sizeof (a[0]))
|
|
|
|
|
2013-01-03 05:49:33 -05:00
|
|
|
#endif /* _PM_UTIL_COMMON_H */
|
|
|
|
|
2014-01-22 18:06:11 -05:00
|
|
|
/* vim: set noet: */
|