Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
b95896b2
Commit
b95896b2
authored
Feb 18, 2001
by
Fredrik Lundh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
renamed internal functions to avoid name clashes under OpenVMS
(fixes bug #132815)
parent
c0c7ee3a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
17 deletions
+18
-17
Modules/unicodedata.c
Modules/unicodedata.c
+18
-17
No files found.
Modules/unicodedata.c
View file @
b95896b2
...
...
@@ -29,7 +29,7 @@ typedef struct {
#include "unicodedata_db.h"
static
const
_PyUnicode_DatabaseRecord
*
getrecord
(
PyUnicodeObject
*
v
)
_
getrecord
(
PyUnicodeObject
*
v
)
{
int
code
;
int
index
;
...
...
@@ -147,7 +147,7 @@ unicodedata_category(PyObject *self, PyObject *args)
"need a single Unicode character as parameter"
);
return
NULL
;
}
index
=
(
int
)
getrecord
(
v
)
->
category
;
index
=
(
int
)
_
getrecord
(
v
)
->
category
;
return
PyString_FromString
(
_PyUnicode_CategoryNames
[
index
]);
}
...
...
@@ -165,7 +165,7 @@ unicodedata_bidirectional(PyObject *self, PyObject *args)
"need a single Unicode character as parameter"
);
return
NULL
;
}
index
=
(
int
)
getrecord
(
v
)
->
bidirectional
;
index
=
(
int
)
_
getrecord
(
v
)
->
bidirectional
;
return
PyString_FromString
(
_PyUnicode_BidirectionalNames
[
index
]);
}
...
...
@@ -182,7 +182,7 @@ unicodedata_combining(PyObject *self, PyObject *args)
"need a single Unicode character as parameter"
);
return
NULL
;
}
return
PyInt_FromLong
((
int
)
getrecord
(
v
)
->
combining
);
return
PyInt_FromLong
((
int
)
_
getrecord
(
v
)
->
combining
);
}
static
PyObject
*
...
...
@@ -198,7 +198,7 @@ unicodedata_mirrored(PyObject *self, PyObject *args)
"need a single Unicode character as parameter"
);
return
NULL
;
}
return
PyInt_FromLong
((
int
)
getrecord
(
v
)
->
mirrored
);
return
PyInt_FromLong
((
int
)
_
getrecord
(
v
)
->
mirrored
);
}
static
PyObject
*
...
...
@@ -260,7 +260,7 @@ unicodedata_decomposition(PyObject *self, PyObject *args)
/* database code (cut and pasted from the unidb package) */
static
unsigned
long
gethash
(
const
char
*
s
,
int
len
,
int
scale
)
_
gethash
(
const
char
*
s
,
int
len
,
int
scale
)
{
int
i
;
unsigned
long
h
=
0
;
...
...
@@ -275,7 +275,7 @@ gethash(const char *s, int len, int scale)
}
static
int
getname
(
Py_UCS4
code
,
char
*
buffer
,
int
buflen
)
_
getname
(
Py_UCS4
code
,
char
*
buffer
,
int
buflen
)
{
int
offset
;
int
i
;
...
...
@@ -327,12 +327,12 @@ getname(Py_UCS4 code, char* buffer, int buflen)
}
static
int
cmpname
(
int
code
,
const
char
*
name
,
int
namelen
)
_
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
)))
if
(
!
_
getname
(
code
,
buffer
,
sizeof
(
buffer
)))
return
0
;
for
(
i
=
0
;
i
<
namelen
;
i
++
)
{
if
(
toupper
(
name
[
i
])
!=
buffer
[
i
])
...
...
@@ -342,7 +342,7 @@ cmpname(int code, const char* name, int namelen)
}
static
int
getcode
(
const
char
*
name
,
int
namelen
,
Py_UCS4
*
code
)
_
getcode
(
const
char
*
name
,
int
namelen
,
Py_UCS4
*
code
)
{
unsigned
int
h
,
v
;
unsigned
int
mask
=
code_size
-
1
;
...
...
@@ -352,12 +352,12 @@ getcode(const char* name, int namelen, Py_UCS4* code)
only minor changes. see the makeunicodedata script for more
details */
h
=
(
unsigned
int
)
gethash
(
name
,
namelen
,
code_magic
);
h
=
(
unsigned
int
)
_
gethash
(
name
,
namelen
,
code_magic
);
i
=
(
~
h
)
&
mask
;
v
=
code_hash
[
i
];
if
(
!
v
)
return
0
;
if
(
cmpname
(
v
,
name
,
namelen
))
{
if
(
_
cmpname
(
v
,
name
,
namelen
))
{
*
code
=
v
;
return
1
;
}
...
...
@@ -369,7 +369,7 @@ getcode(const char* name, int namelen, Py_UCS4* code)
v
=
code_hash
[
i
];
if
(
!
v
)
return
0
;
if
(
cmpname
(
v
,
name
,
namelen
))
{
if
(
_
cmpname
(
v
,
name
,
namelen
))
{
*
code
=
v
;
return
1
;
}
...
...
@@ -382,8 +382,8 @@ getcode(const char* name, int namelen, Py_UCS4* code)
static
const
_PyUnicode_Name_CAPI
hashAPI
=
{
sizeof
(
_PyUnicode_Name_CAPI
),
getname
,
getcode
_
getname
,
_
getcode
};
/* -------------------------------------------------------------------- */
...
...
@@ -405,7 +405,8 @@ unicodedata_name(PyObject* self, PyObject* args)
return
NULL
;
}
if
(
!
getname
((
Py_UCS4
)
*
PyUnicode_AS_UNICODE
(
v
),
name
,
sizeof
(
name
)))
{
if
(
!
_getname
((
Py_UCS4
)
*
PyUnicode_AS_UNICODE
(
v
),
name
,
sizeof
(
name
)))
{
if
(
defobj
==
NULL
)
{
PyErr_SetString
(
PyExc_ValueError
,
"no such name"
);
return
NULL
;
...
...
@@ -430,7 +431,7 @@ unicodedata_lookup(PyObject* self, PyObject* args)
if
(
!
PyArg_ParseTuple
(
args
,
"s#:lookup"
,
&
name
,
&
namelen
))
return
NULL
;
if
(
!
getcode
(
name
,
namelen
,
&
code
))
{
if
(
!
_
getcode
(
name
,
namelen
,
&
code
))
{
PyErr_SetString
(
PyExc_KeyError
,
"undefined character name"
);
return
NULL
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment