[Python-checkins] CVS: python/dist/src/Modules unicodedata.c,2.10,2.11

Fredrik Lundh effbot@users.sourceforge.net
Sun, 18 Feb 2001 14:06:20 -0800


Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv23542/Modules

Modified Files:
	unicodedata.c 
Log Message:


renamed internal functions to avoid name clashes under OpenVMS
(fixes bug #132815)


Index: unicodedata.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/unicodedata.c,v
retrieving revision 2.10
retrieving revision 2.11
diff -C2 -r2.10 -r2.11
*** unicodedata.c	2001/02/18 11:41:49	2.10
--- unicodedata.c	2001/02/18 22:06:17	2.11
***************
*** 30,34 ****
  
  static const _PyUnicode_DatabaseRecord*
! getrecord(PyUnicodeObject* v)
  {
      int code;
--- 30,34 ----
  
  static const _PyUnicode_DatabaseRecord*
! _getrecord(PyUnicodeObject* v)
  {
      int code;
***************
*** 148,152 ****
  	return NULL;
      }
!     index = (int) getrecord(v)->category;
      return PyString_FromString(_PyUnicode_CategoryNames[index]);
  }
--- 148,152 ----
  	return NULL;
      }
!     index = (int) _getrecord(v)->category;
      return PyString_FromString(_PyUnicode_CategoryNames[index]);
  }
***************
*** 166,170 ****
  	return NULL;
      }
!     index = (int) getrecord(v)->bidirectional;
      return PyString_FromString(_PyUnicode_BidirectionalNames[index]);
  }
--- 166,170 ----
  	return NULL;
      }
!     index = (int) _getrecord(v)->bidirectional;
      return PyString_FromString(_PyUnicode_BidirectionalNames[index]);
  }
***************
*** 183,187 ****
  	return NULL;
      }
!     return PyInt_FromLong((int) getrecord(v)->combining);
  }
  
--- 183,187 ----
  	return NULL;
      }
!     return PyInt_FromLong((int) _getrecord(v)->combining);
  }
  
***************
*** 199,203 ****
  	return NULL;
      }
!     return PyInt_FromLong((int) getrecord(v)->mirrored);
  }
  
--- 199,203 ----
  	return NULL;
      }
!     return PyInt_FromLong((int) _getrecord(v)->mirrored);
  }
  
***************
*** 261,265 ****
  
  static unsigned long
! gethash(const char *s, int len, int scale)
  {
      int i;
--- 261,265 ----
  
  static unsigned long
! _gethash(const char *s, int len, int scale)
  {
      int i;
***************
*** 276,280 ****
  
  static int
! getname(Py_UCS4 code, char* buffer, int buflen)
  {
      int offset;
--- 276,280 ----
  
  static int
! _getname(Py_UCS4 code, char* buffer, int buflen)
  {
      int offset;
***************
*** 328,337 ****
  
  static int
! cmpname(int code, const char* name, int namelen)
  {
      /* check if code corresponds to the given name */
      int i;
      char buffer[NAME_MAXLEN];
!     if (!getname(code, buffer, sizeof(buffer)))
          return 0;
      for (i = 0; i < namelen; i++) {
--- 328,337 ----
  
  static int
! _cmpname(int code, const char* name, int namelen)
  {
      /* check if code corresponds to the given name */
      int i;
      char buffer[NAME_MAXLEN];
!     if (!_getname(code, buffer, sizeof(buffer)))
          return 0;
      for (i = 0; i < namelen; i++) {
***************
*** 343,347 ****
  
  static int
! getcode(const char* name, int namelen, Py_UCS4* code)
  {
      unsigned int h, v;
--- 343,347 ----
  
  static int
! _getcode(const char* name, int namelen, Py_UCS4* code)
  {
      unsigned int h, v;
***************
*** 353,362 ****
         details */
  
!     h = (unsigned int) gethash(name, namelen, code_magic);
      i = (~h) & mask;
      v = code_hash[i];
      if (!v)
          return 0;
!     if (cmpname(v, name, namelen)) {
          *code = v;
          return 1;
--- 353,362 ----
         details */
  
!     h = (unsigned int) _gethash(name, namelen, code_magic);
      i = (~h) & mask;
      v = code_hash[i];
      if (!v)
          return 0;
!     if (_cmpname(v, name, namelen)) {
          *code = v;
          return 1;
***************
*** 370,374 ****
          if (!v)
              return 0;
!         if (cmpname(v, name, namelen)) {
              *code = v;
              return 1;
--- 370,374 ----
          if (!v)
              return 0;
!         if (_cmpname(v, name, namelen)) {
              *code = v;
              return 1;
***************
*** 383,388 ****
  {
      sizeof(_PyUnicode_Name_CAPI),
!     getname,
!     getcode
  };
  
--- 383,388 ----
  {
      sizeof(_PyUnicode_Name_CAPI),
!     _getname,
!     _getcode
  };
  
***************
*** 406,410 ****
      }
  
!     if (!getname((Py_UCS4) *PyUnicode_AS_UNICODE(v), name, sizeof(name))) {
  	if (defobj == NULL) {
  	    PyErr_SetString(PyExc_ValueError, "no such name");
--- 406,411 ----
      }
  
!     if (!_getname((Py_UCS4) *PyUnicode_AS_UNICODE(v),
!                              name, sizeof(name))) {
  	if (defobj == NULL) {
  	    PyErr_SetString(PyExc_ValueError, "no such name");
***************
*** 431,435 ****
          return NULL;
  
!     if (!getcode(name, namelen, &code)) {
          PyErr_SetString(PyExc_KeyError, "undefined character name");
          return NULL;
--- 432,436 ----
          return NULL;
  
!     if (!_getcode(name, namelen, &code)) {
          PyErr_SetString(PyExc_KeyError, "undefined character name");
          return NULL;