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
5bd7c022
Kaydet (Commit)
5bd7c022
authored
Mar 10, 2006
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Avoid forward-declaring the methods array.
Rename unicodedata.db* to unicodedata.ucd*
üst
f6694361
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
57 additions
and
56 deletions
+57
-56
libunicodedata.tex
Doc/lib/libunicodedata.tex
+1
-1
ucnhash.h
Include/ucnhash.h
+1
-1
idna.py
Lib/encodings/idna.py
+1
-1
stringprep.py
Lib/stringprep.py
+1
-1
unicodedata.c
Modules/unicodedata.c
+53
-52
No files found.
Doc/lib/libunicodedata.tex
Dosyayı görüntüle @
5bd7c022
...
...
@@ -131,7 +131,7 @@ The version of the Unicode database used in this module.
\versionadded
{
2.3
}
\end{datadesc}
\begin{datadesc}
{
db
_
3
_
2
_
0
}
\begin{datadesc}
{
ucd
_
3
_
2
_
0
}
This is an object that has the same methods as the entire
module, but uses the Unicode database version 3.2 instead,
for applications that require this specific version of
...
...
Include/ucnhash.h
Dosyayı görüntüle @
5bd7c022
...
...
@@ -16,7 +16,7 @@ typedef struct {
/* Get name for a given character code. Returns non-zero if
success, zero if not. Does not set Python exceptions.
If self is NULL, data come from the default version of the database.
If it is not NULL, it should be a unicodedata.
db
_X_Y_Z object */
If it is not NULL, it should be a unicodedata.
ucd
_X_Y_Z object */
int
(
*
getname
)(
PyObject
*
self
,
Py_UCS4
code
,
char
*
buffer
,
int
buflen
);
/* Get character code for a given name. Same error handling
...
...
Lib/encodings/idna.py
Dosyayı görüntüle @
5bd7c022
# This module implements the RFCs 3490 (IDNA) and 3491 (Nameprep)
import
stringprep
,
re
,
codecs
from
unicodedata
import
db
_3_2_0
as
unicodedata
from
unicodedata
import
ucd
_3_2_0
as
unicodedata
# IDNA section 3.1
dots
=
re
.
compile
(
u"[
\u002E\u3002\uFF0E\uFF61
]"
)
...
...
Lib/stringprep.py
Dosyayı görüntüle @
5bd7c022
...
...
@@ -5,7 +5,7 @@ There are two kinds of tables: sets, for which a member test is provided,
and mappings, for which a mapping function is provided.
"""
from
unicodedata
import
db
_3_2_0
as
unicodedata
from
unicodedata
import
ucd
_3_2_0
as
unicodedata
assert
unicodedata
.
unidata_version
==
'3.2.0'
...
...
Modules/unicodedata.c
Dosyayı görüntüle @
5bd7c022
...
...
@@ -70,67 +70,20 @@ typedef struct previous_version {
#define get_old_record(self, v) ((((PreviousDBVersion*)self)->getrecord)(v))
/* Forward declaration */
static
PyMethodDef
unicodedata_functions
[];
static
PyMemberDef
DB_members
[]
=
{
{
"unidata_version"
,
T_STRING
,
offsetof
(
PreviousDBVersion
,
name
),
READONLY
},
{
NULL
}
};
static
PyTypeObject
Xxo_Type
=
{
/* The ob_type field must be initialized in the module init function
* to be portable to Windows without using C++. */
PyObject_HEAD_INIT
(
NULL
)
0
,
/*ob_size*/
"unicodedata.DB"
,
/*tp_name*/
sizeof
(
PreviousDBVersion
),
/*tp_basicsize*/
0
,
/*tp_itemsize*/
/* methods */
(
destructor
)
PyObject_Del
,
/*tp_dealloc*/
0
,
/*tp_print*/
0
,
/*tp_getattr*/
0
,
/*tp_setattr*/
0
,
/*tp_compare*/
0
,
/*tp_repr*/
0
,
/*tp_as_number*/
0
,
/*tp_as_sequence*/
0
,
/*tp_as_mapping*/
0
,
/*tp_hash*/
0
,
/*tp_call*/
0
,
/*tp_str*/
PyObject_GenericGetAttr
,
/*tp_getattro*/
0
,
/*tp_setattro*/
0
,
/*tp_as_buffer*/
Py_TPFLAGS_DEFAULT
,
/*tp_flags*/
0
,
/*tp_doc*/
0
,
/*tp_traverse*/
0
,
/*tp_clear*/
0
,
/*tp_richcompare*/
0
,
/*tp_weaklistoffset*/
0
,
/*tp_iter*/
0
,
/*tp_iternext*/
unicodedata_functions
,
/*tp_methods*/
DB_members
,
/*tp_members*/
0
,
/*tp_getset*/
0
,
/*tp_base*/
0
,
/*tp_dict*/
0
,
/*tp_descr_get*/
0
,
/*tp_descr_set*/
0
,
/*tp_dictoffset*/
0
,
/*tp_init*/
0
,
/*tp_alloc*/
0
,
/*tp_new*/
0
,
/*tp_free*/
0
,
/*tp_is_gc*/
};
// forward declaration
static
PyTypeObject
UCD_Type
;
static
PyObject
*
new_previous_version
(
const
char
*
name
,
const
change_record
*
(
*
getrecord
)(
Py_UCS4
),
Py_UCS4
(
*
normalization
)(
Py_UCS4
))
{
PreviousDBVersion
*
self
;
self
=
PyObject_New
(
PreviousDBVersion
,
&
Xxo
_Type
);
self
=
PyObject_New
(
PreviousDBVersion
,
&
UCD
_Type
);
if
(
self
==
NULL
)
return
NULL
;
self
->
name
=
name
;
...
...
@@ -1163,7 +1116,52 @@ static PyMethodDef unicodedata_functions[] = {
{
NULL
,
NULL
}
/* sentinel */
};
static
PyTypeObject
UCD_Type
=
{
/* The ob_type field must be initialized in the module init function
* to be portable to Windows without using C++. */
PyObject_HEAD_INIT
(
NULL
)
0
,
/*ob_size*/
"unicodedata.UCD"
,
/*tp_name*/
sizeof
(
PreviousDBVersion
),
/*tp_basicsize*/
0
,
/*tp_itemsize*/
/* methods */
(
destructor
)
PyObject_Del
,
/*tp_dealloc*/
0
,
/*tp_print*/
0
,
/*tp_getattr*/
0
,
/*tp_setattr*/
0
,
/*tp_compare*/
0
,
/*tp_repr*/
0
,
/*tp_as_number*/
0
,
/*tp_as_sequence*/
0
,
/*tp_as_mapping*/
0
,
/*tp_hash*/
0
,
/*tp_call*/
0
,
/*tp_str*/
PyObject_GenericGetAttr
,
/*tp_getattro*/
0
,
/*tp_setattro*/
0
,
/*tp_as_buffer*/
Py_TPFLAGS_DEFAULT
,
/*tp_flags*/
0
,
/*tp_doc*/
0
,
/*tp_traverse*/
0
,
/*tp_clear*/
0
,
/*tp_richcompare*/
0
,
/*tp_weaklistoffset*/
0
,
/*tp_iter*/
0
,
/*tp_iternext*/
unicodedata_functions
,
/*tp_methods*/
DB_members
,
/*tp_members*/
0
,
/*tp_getset*/
0
,
/*tp_base*/
0
,
/*tp_dict*/
0
,
/*tp_descr_get*/
0
,
/*tp_descr_set*/
0
,
/*tp_dictoffset*/
0
,
/*tp_init*/
0
,
/*tp_alloc*/
0
,
/*tp_new*/
0
,
/*tp_free*/
0
,
/*tp_is_gc*/
};
PyDoc_STRVAR
(
unicodedata_docstring
,
"This module provides access to the Unicode Character Database which
\n
\
...
...
@@ -1180,17 +1178,20 @@ initunicodedata(void)
{
PyObject
*
m
,
*
v
;
UCD_Type
.
ob_type
=
&
PyType_Type
;
m
=
Py_InitModule3
(
"unicodedata"
,
unicodedata_functions
,
unicodedata_docstring
);
if
(
!
m
)
return
;
PyModule_AddStringConstant
(
m
,
"unidata_version"
,
UNIDATA_VERSION
);
PyModule_AddObject
(
m
,
"UCD"
,
(
PyObject
*
)
&
UCD_Type
);
/* Previous versions */
v
=
new_previous_version
(
"3.2.0"
,
get_change_3_2_0
,
normalization_3_2_0
);
if
(
v
!=
NULL
)
PyModule_AddObject
(
m
,
"
db
_3_2_0"
,
v
);
PyModule_AddObject
(
m
,
"
ucd
_3_2_0"
,
v
);
/* Export C API */
v
=
PyCObject_FromVoidPtr
((
void
*
)
&
hashAPI
,
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