##// END OF EJS Templates
setup: move cffi stuff to mercurial/cffi...
setup: move cffi stuff to mercurial/cffi This patch moves all setup*cffi stuff to mercurial/cffi to make the root directory cleaner. The idea was from mpm [1]: > It seems like we could have a fair amount of cffi definitions, and > cluttering the root directory (or mercurial/) with them is probably not > a great long-term solution. We could probably add a cffi/ directory > under mercurial/ to parallel pure/. [1]: https://www.mercurial-scm.org/pipermail/mercurial-devel/2016-July/086442.html

File last commit:

r30112:9b6ff0f9 default
r30346:9cc438bf default
Show More
util.h
45 lines | 981 B | text/x-c | CLexer
/*
util.h - utility functions for interfacing with the various python APIs.
This software may be used and distributed according to the terms of
the GNU General Public License, incorporated herein by reference.
*/
#ifndef _HG_UTIL_H_
#define _HG_UTIL_H_
#include "compat.h"
#if PY_MAJOR_VERSION >= 3
#define IS_PY3K
#endif
typedef struct {
PyObject_HEAD
char state;
int mode;
int size;
int mtime;
} dirstateTupleObject;
extern PyTypeObject dirstateTupleType;
#define dirstate_tuple_check(op) (Py_TYPE(op) == &dirstateTupleType)
/* This should be kept in sync with normcasespecs in encoding.py. */
enum normcase_spec {
NORMCASE_LOWER = -1,
NORMCASE_UPPER = 1,
NORMCASE_OTHER = 0
};
#define MIN(a, b) (((a)<(b))?(a):(b))
/* VC9 doesn't include bool and lacks stdbool.h based on my searching */
#if defined(_MSC_VER) || __STDC_VERSION__ < 199901L
#define true 1
#define false 0
typedef unsigned char bool;
#else
#include <stdbool.h>
#endif
#endif /* _HG_UTIL_H_ */