Remove csync_misc: The code no longer use fnmatch

This commit is contained in:
Olivier Goffart 2018-11-07 11:09:41 +01:00 committed by Kevin Ottens
parent 3c3619f99a
commit f0c24cb6f9
No known key found for this signature in database
GPG Key ID: 074BBBCB8DECC9E2
7 changed files with 0 additions and 162 deletions

View File

@ -32,7 +32,6 @@ endif()
set(csync_SRCS
csync_exclude.cpp
csync_util.cpp
csync_misc.cpp
std/c_alloc.c
std/c_string.c

View File

@ -27,12 +27,6 @@ endif (NOT LINUX)
check_function_exists(asprintf HAVE_ASPRINTF)
check_function_exists(fnmatch HAVE_FNMATCH)
if(NOT HAVE_FNMATCH AND WIN32)
find_library(SHLWAPI_LIBRARY shlwapi)
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} shlwapi)
endif()
if(WIN32)
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} psapi kernel32)
endif()

View File

@ -12,7 +12,6 @@
#cmakedefine HAVE_STRERROR_R 1
#cmakedefine HAVE_UTIMES 1
#cmakedefine HAVE_LSTAT 1
#cmakedefine HAVE_FNMATCH 1
#cmakedefine HAVE___MINGW_ASPRINTF 1
#cmakedefine HAVE_ASPRINTF 1

View File

@ -29,7 +29,6 @@
#include "c_utf8.h"
#include "csync_exclude.h"
#include "csync_misc.h"
#include "common/utility.h"
#include "../version.h"

View File

@ -1,41 +0,0 @@
/*
* cynapses libc functions
*
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
* Copyright (c) 2012-2013 by Klaas Freitag <freitag@owncloud.com>
*
* 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.1 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, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _CSYNC_MACROS_H
#define _CSYNC_MACROS_H
#include <cstdlib>
#include <cstring>
/* How many elements there are in a static array */
#define ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0]))
/* Some special custom errno values to report bugs properly. The BASE value
* should always be larger than the highest system errno. */
#define CSYNC_CUSTOM_ERRNO_BASE 10000
#define ERRNO_WRONG_CONTENT (CSYNC_CUSTOM_ERRNO_BASE+11)
#define ERRNO_SERVICE_UNAVAILABLE (CSYNC_CUSTOM_ERRNO_BASE+14)
#define ERRNO_STORAGE_UNAVAILABLE (CSYNC_CUSTOM_ERRNO_BASE+17)
#define ERRNO_FORBIDDEN (CSYNC_CUSTOM_ERRNO_BASE+18)
#endif /* _CSYNC_MACROS_H */
/* vim: set ft=c.doxygen ts=8 sw=2 et cindent: */

View File

@ -1,71 +0,0 @@
/*
* libcsync -- a library to sync a directory with another
*
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
* Copyright (c) 2012-2013 by Klaas Freitag <freitag@owncloud.com>
*
* 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.1 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, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "config_csync.h"
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <climits>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <sys/types.h>
#include <cerrno>
#if _WIN32
# ifndef _WIN32_IE
# define _WIN32_IE 0x0501 // SHGetSpecialFolderPath
# endif
# include <shlobj.h>
#else /* _WIN32 */
# include <pwd.h>
#endif /* _WIN32 */
#include "c_lib.h"
#include "csync_misc.h"
#include "csync_macros.h"
#ifdef HAVE_FNMATCH
#include <fnmatch.h>
int csync_fnmatch(__const char *__pattern, __const char *__name, int __flags) {
return fnmatch(__pattern, __name, __flags);
}
#else /* HAVE_FNMATCH */
#include <shlwapi.h>
int csync_fnmatch(const char *pattern, const char *name, int flags) {
BOOL match;
(void) flags;
match = PathMatchSpecA(name, pattern);
if(match)
return 0;
else
return 1;
}
#endif /* HAVE_FNMATCH */

View File

@ -1,41 +0,0 @@
/*
* libcsync -- a library to sync a directory with another
*
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
* Copyright (c) 2012-2013 by Klaas Freitag <freitag@owncloud.com>
*
* 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.1 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, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _CSYNC_MISC_H
#define _CSYNC_MISC_H
#include <config_csync.h>
#include <csync.h>
#ifdef HAVE_FNMATCH
#include <fnmatch.h>
#else
/* Steal this define to make csync_exclude compile. Note that if fnmatch
* is not defined it's probably Win32 which uses a different implementation
* than fmmatch anyway, which does not care for flags.
**/
#define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */
#define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
#endif
int csync_fnmatch(const char *pattern, const char *name, int flags);
#endif /* _CSYNC_MISC_H */