git-xdiff.h 1.34 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
/*
 * Copyright (C) the libgit2 contributors. All rights reserved.
 *
 * This file is part of libgit2, distributed under the GNU GPL v2 with
 * a Linking Exception. For full terms see the included COPYING file.
 */

/*
 * This file provides the necessary indirection between xdiff and
 * libgit2.  libgit2-specific functionality should live here, so
 * that git and libgit2 can share a common xdiff implementation.
 */

#ifndef INCLUDE_git_xdiff_h__
#define INCLUDE_git_xdiff_h__

#include "regexp.h"

19 20 21 22 23 24 25 26 27 28 29
/* Work around C90-conformance issues */
#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L)
# if defined(_MSC_VER)
#  define inline __inline
# elif defined(__GNUC__)
#  define inline __inline__
# else
#  define inline
# endif
#endif

30 31
#define XDL_UNUSED GIT_UNUSED_ARG

32
#define xdl_malloc(x) git__malloc(x)
33
#define xdl_calloc(n, sz) git__calloc(n, sz)
34 35 36
#define xdl_free(ptr) git__free(ptr)
#define xdl_realloc(ptr, x) git__realloc(ptr, x)

37
#define XDL_BUG(msg) GIT_ASSERT(!msg)
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56

#define xdl_regex_t git_regexp
#define xdl_regmatch_t git_regmatch

GIT_INLINE(int) xdl_regexec_buf(
	const xdl_regex_t *preg, const char *buf, size_t size,
	size_t nmatch, xdl_regmatch_t pmatch[], int eflags)
{
	GIT_UNUSED(preg);
	GIT_UNUSED(buf);
	GIT_UNUSED(size);
	GIT_UNUSED(nmatch);
	GIT_UNUSED(pmatch);
	GIT_UNUSED(eflags);
	GIT_ASSERT("not implemented");
	return -1;
}

#endif