Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
b95896b2
Kaydet (Commit)
b95896b2
authored
Şub 18, 2001
tarafından
Fredrik Lundh
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
renamed internal functions to avoid name clashes under OpenVMS
(fixes bug #132815)
üst
c0c7ee3a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
17 deletions
+18
-17
unicodedata.c
Modules/unicodedata.c
+18
-17
No files found.
Modules/unicodedata.c
Dosyayı görüntüle @
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