⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xdelta3_wrap.c

📁 Linux下一个可以比较二进制文件的工具xdelta3.0u的源码。
💻 C
📖 第 1 页 / 共 5 页
字号:
SWIGRUNTIME const char *SWIG_TypePrettyName(const swig_type_info *type) {  /* The "str" field contains the equivalent pretty names of the     type, separated by vertical-bar characters.  We choose     to print the last name, as it is often (?) the most     specific. */  if (!type) return NULL;  if (type->str != NULL) {    const char *last_name = type->str;    const char *s;    for (s = type->str; *s; s++)      if (*s == '|') last_name = s+1;    return last_name;  }  else    return type->name;}/*    Set the clientdata field for a type*/SWIGRUNTIME voidSWIG_TypeClientData(swig_type_info *ti, void *clientdata) {  swig_cast_info *cast = ti->cast;  /* if (ti->clientdata == clientdata) return; */  ti->clientdata = clientdata;    while (cast) {    if (!cast->converter) {      swig_type_info *tc = cast->type;      if (!tc->clientdata) {	SWIG_TypeClientData(tc, clientdata);      }    }        cast = cast->next;  }}SWIGRUNTIME voidSWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {  SWIG_TypeClientData(ti, clientdata);  ti->owndata = 1;}  /*  Search for a swig_type_info structure only by mangled name  Search is a O(log #types)    We start searching at module start, and finish searching when start == end.    Note: if start == end at the beginning of the function, we go all the way around  the circular list.*/SWIGRUNTIME swig_type_info *SWIG_MangledTypeQueryModule(swig_module_info *start,                             swig_module_info *end, 		            const char *name) {  swig_module_info *iter = start;  do {    if (iter->size) {      register size_t l = 0;      register size_t r = iter->size - 1;      do {	/* since l+r >= 0, we can (>> 1) instead (/ 2) */	register size_t i = (l + r) >> 1; 	const char *iname = iter->types[i]->name;	if (iname) {	  register int compare = strcmp(name, iname);	  if (compare == 0) {	    	    return iter->types[i];	  } else if (compare < 0) {	    if (i) {	      r = i - 1;	    } else {	      break;	    }	  } else if (compare > 0) {	    l = i + 1;	  }	} else {	  break; /* should never happen */	}      } while (l <= r);    }    iter = iter->next;  } while (iter != end);  return 0;}/*  Search for a swig_type_info structure for either a mangled name or a human readable name.  It first searches the mangled names of the types, which is a O(log #types)  If a type is not found it then searches the human readable names, which is O(#types).    We start searching at module start, and finish searching when start == end.    Note: if start == end at the beginning of the function, we go all the way around  the circular list.*/SWIGRUNTIME swig_type_info *SWIG_TypeQueryModule(swig_module_info *start,                      swig_module_info *end, 		     const char *name) {  /* STEP 1: Search the name field using binary search */  swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);  if (ret) {    return ret;  } else {    /* STEP 2: If the type hasn't been found, do a complete search       of the str field (the human readable name) */    swig_module_info *iter = start;    do {      register size_t i = 0;      for (; i < iter->size; ++i) {	if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))	  return iter->types[i];      }      iter = iter->next;    } while (iter != end);  }    /* neither found a match */  return 0;}/*    Pack binary data into a string*/SWIGRUNTIME char *SWIG_PackData(char *c, void *ptr, size_t sz) {  static const char hex[17] = "0123456789abcdef";  register const unsigned char *u = (unsigned char *) ptr;  register const unsigned char *eu =  u + sz;  for (; u != eu; ++u) {    register unsigned char uu = *u;    *(c++) = hex[(uu & 0xf0) >> 4];    *(c++) = hex[uu & 0xf];  }  return c;}/*    Unpack binary data from a string*/SWIGRUNTIME const char *SWIG_UnpackData(const char *c, void *ptr, size_t sz) {  register unsigned char *u = (unsigned char *) ptr;  register const unsigned char *eu = u + sz;  for (; u != eu; ++u) {    register char d = *(c++);    register unsigned char uu;    if ((d >= '0') && (d <= '9'))      uu = ((d - '0') << 4);    else if ((d >= 'a') && (d <= 'f'))      uu = ((d - ('a'-10)) << 4);    else       return (char *) 0;    d = *(c++);    if ((d >= '0') && (d <= '9'))      uu |= (d - '0');    else if ((d >= 'a') && (d <= 'f'))      uu |= (d - ('a'-10));    else       return (char *) 0;    *u = uu;  }  return c;}/*    Pack 'void *' into a string buffer.*/SWIGRUNTIME char *SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {  char *r = buff;  if ((2*sizeof(void *) + 2) > bsz) return 0;  *(r++) = '_';  r = SWIG_PackData(r,&ptr,sizeof(void *));  if (strlen(name) + 1 > (bsz - (r - buff))) return 0;  strcpy(r,name);  return buff;}SWIGRUNTIME const char *SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {  if (*c != '_') {    if (strcmp(c,"NULL") == 0) {      *ptr = (void *) 0;      return name;    } else {      return 0;    }  }  return SWIG_UnpackData(++c,ptr,sizeof(void *));}SWIGRUNTIME char *SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {  char *r = buff;  size_t lname = (name ? strlen(name) : 0);  if ((2*sz + 2 + lname) > bsz) return 0;  *(r++) = '_';  r = SWIG_PackData(r,ptr,sz);  if (lname) {    strncpy(r,name,lname+1);  } else {    *r = 0;  }  return buff;}SWIGRUNTIME const char *SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {  if (*c != '_') {    if (strcmp(c,"NULL") == 0) {      memset(ptr,0,sz);      return name;    } else {      return 0;    }  }  return SWIG_UnpackData(++c,ptr,sz);}#ifdef __cplusplus}#endif/*  Errors in SWIG */#define  SWIG_UnknownError    	   -1 #define  SWIG_IOError        	   -2 #define  SWIG_RuntimeError   	   -3 #define  SWIG_IndexError     	   -4 #define  SWIG_TypeError      	   -5 #define  SWIG_DivisionByZero 	   -6 #define  SWIG_OverflowError  	   -7 #define  SWIG_SyntaxError    	   -8 #define  SWIG_ValueError     	   -9 #define  SWIG_SystemError    	   -10#define  SWIG_AttributeError 	   -11#define  SWIG_MemoryError    	   -12 #define  SWIG_NullReferenceError   -13/* Add PyOS_snprintf for old Pythons */#if PY_VERSION_HEX < 0x02020000# if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM)#  define PyOS_snprintf _snprintf# else#  define PyOS_snprintf snprintf# endif#endif/* A crude PyString_FromFormat implementation for old Pythons */#if PY_VERSION_HEX < 0x02020000#ifndef SWIG_PYBUFFER_SIZE# define SWIG_PYBUFFER_SIZE 1024#endifstatic PyObject *PyString_FromFormat(const char *fmt, ...) {  va_list ap;  char buf[SWIG_PYBUFFER_SIZE * 2];  int res;  va_start(ap, fmt);  res = vsnprintf(buf, sizeof(buf), fmt, ap);  va_end(ap);  return (res < 0 || res >= (int)sizeof(buf)) ? 0 : PyString_FromString(buf);}#endif/* Add PyObject_Del for old Pythons */#if PY_VERSION_HEX < 0x01060000# define PyObject_Del(op) PyMem_DEL((op))#endif#ifndef PyObject_DEL# define PyObject_DEL PyObject_Del#endif/* A crude PyExc_StopIteration exception for old Pythons */#if PY_VERSION_HEX < 0x02020000# ifndef PyExc_StopIteration#  define PyExc_StopIteration PyExc_RuntimeError# endif# ifndef PyObject_GenericGetAttr#  define PyObject_GenericGetAttr 0# endif#endif/* Py_NotImplemented is defined in 2.1 and up. */#if PY_VERSION_HEX < 0x02010000# ifndef Py_NotImplemented#  define Py_NotImplemented PyExc_RuntimeError# endif#endif/* A crude PyString_AsStringAndSize implementation for old Pythons */#if PY_VERSION_HEX < 0x02010000# ifndef PyString_AsStringAndSize#  define PyString_AsStringAndSize(obj, s, len) {*s = PyString_AsString(obj); *len = *s ? strlen(*s) : 0;}# endif#endif/* PySequence_Size for old Pythons */#if PY_VERSION_HEX < 0x02000000# ifndef PySequence_Size#  define PySequence_Size PySequence_Length# endif#endif/* PyBool_FromLong for old Pythons */#if PY_VERSION_HEX < 0x02030000staticPyObject *PyBool_FromLong(long ok){  PyObject *result = ok ? Py_True : Py_False;  Py_INCREF(result);  return result;}#endif/* Py_ssize_t for old Pythons *//* This code is as recommended by: *//* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)typedef int Py_ssize_t;# define PY_SSIZE_T_MAX INT_MAX# define PY_SSIZE_T_MIN INT_MIN#endif/* ----------------------------------------------------------------------------- * error manipulation * ----------------------------------------------------------------------------- */SWIGRUNTIME PyObject*SWIG_Python_ErrorType(int code) {  PyObject* type = 0;  switch(code) {  case SWIG_MemoryError:    type = PyExc_MemoryError;    break;  case SWIG_IOError:    type = PyExc_IOError;    break;  case SWIG_RuntimeError:    type = PyExc_RuntimeError;    break;  case SWIG_IndexError:    type = PyExc_IndexError;    break;  case SWIG_TypeError:    type = PyExc_TypeError;    break;  case SWIG_DivisionByZero:    type = PyExc_ZeroDivisionError;    break;  case SWIG_OverflowError:    type = PyExc_OverflowError;    break;  case SWIG_SyntaxError:    type = PyExc_SyntaxError;    break;  case SWIG_ValueError:    type = PyExc_ValueError;    break;  case SWIG_SystemError:    type = PyExc_SystemError;    break;  case SWIG_AttributeError:    type = PyExc_AttributeError;    break;  default:    type = PyExc_RuntimeError;  }  return type;}SWIGRUNTIME voidSWIG_Python_AddErrorMsg(const char* mesg){  PyObject *type = 0;  PyObject *value = 0;  PyObject *traceback = 0;  if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback);  if (value) {    PyObject *old_str = PyObject_Str(value);    PyErr_Clear();    Py_XINCREF(type);    PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg);    Py_DECREF(old_str);    Py_DECREF(value);  } else {    PyErr_Format(PyExc_RuntimeError, mesg);  }}#if defined(SWIG_PYTHON_NO_THREADS)#  if defined(SWIG_PYTHON_THREADS)#    undef SWIG_PYTHON_THREADS#  endif#endif#if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */#  if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL)#    if (PY_VERSION_HEX >= 0x02030000) /* For 2.3 or later, use the PyGILState calls */#      define SWIG_PYTHON_USE_GIL#    endif#  endif#  if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */#    ifndef SWIG_PYTHON_INITIALIZE_THREADS#     define SWIG_PYTHON_INITIALIZE_THREADS  PyEval_InitThreads() #    endif#    ifdef __cplusplus /* C++ code */       class SWIG_Python_Thread_Block {         bool status;         PyGILState_STATE state;       public:         void end() { if (status) { PyGILState_Release(state); status = false;} }         SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {}         ~SWIG_Python_Thread_Block() { end(); }       };       class SWIG_Python_Thread_Allow {         bool status;         PyThreadState *save;       public:         void end() { if (status) { PyEval_RestoreThread(save); status = false; }}         SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {}         ~SWIG_Python_Thread_Allow() { end(); }       };#      define SWIG_PYTHON_THREAD_BEGIN_BLOCK   SWIG_Python_Thread_Block _swig_thread_block#      define SWIG_PYTHON_THREAD_END_BLOCK     _swig_thread_block.end()#      define SWIG_PYTHON_THREAD_BEGIN_ALLOW   SWIG_Python_Thread_Allow _swig_thread_allow#      define SWIG_PYTHON_THREAD_END_ALLOW     _swig_thread_allow.end()#    else /* C code */#      define SWIG_PYTHON_THREAD_BEGIN_BLOCK   PyGILState_STATE _swig_thread_block = PyGILState_Ensure()#      define SWIG_PYTHON_THREAD_END_BLOCK     PyGILState_Release(_swig_thread_block)#      define SWIG_PYTHON_THREAD_BEGIN_ALLOW   PyThreadState *_swig_thread_allow = PyEval_SaveThread()#      define SWIG_PYTHON_THREAD_END_ALLOW     PyEval_RestoreThread(_swig_thread_allow)#    endif#  else /* Old thread way, not implemented, user must provide it */#    if !defined(SWIG_PYTHON_INITIALIZE_THREADS)#      define SWIG_PYTHON_INITIALIZE_THREADS#    endif#    if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK)#      define SWIG_PYTHON_THREAD_BEGIN_BLOCK#    endif#    if !defined(SWIG_PYTHON_THREAD_END_BLOCK)#      define SWIG_PYTHON_THREAD_END_BLOCK#    endif#    if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW)#      define SWIG_PYTHON_THREAD_BEGIN_ALLOW#    endif#    if !defined(SWIG_PYTHON_THREAD_END_ALLOW)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -