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
0d3072e9
Kaydet (Commit)
0d3072e9
authored
Eki 31, 2011
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Drop Py_UCS4_ functions. Closes #13246.
üst
a72e78b3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
90 additions
and
138 deletions
+90
-138
unicodeobject.h
Include/unicodeobject.h
+0
-37
unicodeobject.c
Objects/unicodeobject.c
+90
-10
uniops.h
Objects/uniops.h
+0
-91
No files found.
Include/unicodeobject.h
Dosyayı görüntüle @
0d3072e9
...
...
@@ -1984,43 +1984,6 @@ PyAPI_FUNC(Py_UNICODE*) Py_UNICODE_strrchr(
Py_UNICODE
c
);
PyAPI_FUNC
(
size_t
)
Py_UCS4_strlen
(
const
Py_UCS4
*
u
);
PyAPI_FUNC
(
Py_UCS4
*
)
Py_UCS4_strcpy
(
Py_UCS4
*
s1
,
const
Py_UCS4
*
s2
);
PyAPI_FUNC
(
Py_UCS4
*
)
Py_UCS4_strcat
(
Py_UCS4
*
s1
,
const
Py_UCS4
*
s2
);
PyAPI_FUNC
(
Py_UCS4
*
)
Py_UCS4_strncpy
(
Py_UCS4
*
s1
,
const
Py_UCS4
*
s2
,
size_t
n
);
PyAPI_FUNC
(
int
)
Py_UCS4_strcmp
(
const
Py_UCS4
*
s1
,
const
Py_UCS4
*
s2
);
PyAPI_FUNC
(
int
)
Py_UCS4_strncmp
(
const
Py_UCS4
*
s1
,
const
Py_UCS4
*
s2
,
size_t
n
);
PyAPI_FUNC
(
Py_UCS4
*
)
Py_UCS4_strchr
(
const
Py_UCS4
*
s
,
Py_UCS4
c
);
PyAPI_FUNC
(
Py_UCS4
*
)
Py_UCS4_strrchr
(
const
Py_UCS4
*
s
,
Py_UCS4
c
);
/* Create a copy of a unicode string ending with a nul character. Return NULL
and raise a MemoryError exception on memory allocation failure, otherwise
return a new allocated buffer (use PyMem_Free() to free the buffer). */
...
...
Objects/unicodeobject.c
Dosyayı görüntüle @
0d3072e9
...
...
@@ -14195,16 +14195,96 @@ unicode_iter(PyObject *seq)
return (PyObject *)it;
}
#define UNIOP(x) Py_UNICODE_##x
#define UNIOP_t Py_UNICODE
#include "uniops.h"
#undef UNIOP
#undef UNIOP_t
#define UNIOP(x) Py_UCS4_##x
#define UNIOP_t Py_UCS4
#include "uniops.h"
#undef UNIOP
#undef UNIOP_t
size_t
Py_UNICODE_strlen(const Py_UNICODE *u)
{
int res = 0;
while(*u++)
res++;
return res;
}
Py_UNICODE*
Py_UNICODE_strcpy(Py_UNICODE *s1, const Py_UNICODE *s2)
{
Py_UNICODE *u = s1;
while ((*u++ = *s2++));
return s1;
}
Py_UNICODE*
Py_UNICODE_strncpy(Py_UNICODE *s1, const Py_UNICODE *s2, size_t n)
{
Py_UNICODE *u = s1;
while ((*u++ = *s2++))
if (n-- == 0)
break;
return s1;
}
Py_UNICODE*
Py_UNICODE_strcat(Py_UNICODE *s1, const Py_UNICODE *s2)
{
Py_UNICODE *u1 = s1;
u1 += Py_UNICODE_strlen(u1);
Py_UNICODE_strcpy(u1, s2);
return s1;
}
int
Py_UNICODE_strcmp(const Py_UNICODE *s1, const Py_UNICODE *s2)
{
while (*s1 && *s2 && *s1 == *s2)
s1++, s2++;
if (*s1 && *s2)
return (*s1 < *s2) ? -1 : +1;
if (*s1)
return 1;
if (*s2)
return -1;
return 0;
}
int
Py_UNICODE_strncmp(const Py_UNICODE *s1, const Py_UNICODE *s2, size_t n)
{
register Py_UNICODE u1, u2;
for (; n != 0; n--) {
u1 = *s1;
u2 = *s2;
if (u1 != u2)
return (u1 < u2) ? -1 : +1;
if (u1 == '\0')
return 0;
s1++;
s2++;
}
return 0;
}
Py_UNICODE*
Py_UNICODE_strchr(const Py_UNICODE *s, Py_UNICODE c)
{
const Py_UNICODE *p;
for (p = s; *p; p++)
if (*p == c)
return (Py_UNICODE*)p;
return NULL;
}
Py_UNICODE*
Py_UNICODE_strrchr(const Py_UNICODE *s, Py_UNICODE c)
{
const Py_UNICODE *p;
p = s + Py_UNICODE_strlen(s);
while (p != s) {
p--;
if (*p == c)
return (Py_UNICODE*)p;
}
return NULL;
}
Py_UNICODE*
PyUnicode_AsUnicodeCopy(PyObject *unicode)
...
...
Objects/uniops.h
deleted
100644 → 0
Dosyayı görüntüle @
a72e78b3
size_t
UNIOP
(
strlen
)(
const
UNIOP_t
*
u
)
{
int
res
=
0
;
while
(
*
u
++
)
res
++
;
return
res
;
}
UNIOP_t
*
UNIOP
(
strcpy
)(
UNIOP_t
*
s1
,
const
UNIOP_t
*
s2
)
{
UNIOP_t
*
u
=
s1
;
while
((
*
u
++
=
*
s2
++
));
return
s1
;
}
UNIOP_t
*
UNIOP
(
strncpy
)(
UNIOP_t
*
s1
,
const
UNIOP_t
*
s2
,
size_t
n
)
{
UNIOP_t
*
u
=
s1
;
while
((
*
u
++
=
*
s2
++
))
if
(
n
--
==
0
)
break
;
return
s1
;
}
UNIOP_t
*
UNIOP
(
strcat
)(
UNIOP_t
*
s1
,
const
UNIOP_t
*
s2
)
{
UNIOP_t
*
u1
=
s1
;
u1
+=
UNIOP
(
strlen
(
u1
));
UNIOP
(
strcpy
(
u1
,
s2
));
return
s1
;
}
int
UNIOP
(
strcmp
)(
const
UNIOP_t
*
s1
,
const
UNIOP_t
*
s2
)
{
while
(
*
s1
&&
*
s2
&&
*
s1
==
*
s2
)
s1
++
,
s2
++
;
if
(
*
s1
&&
*
s2
)
return
(
*
s1
<
*
s2
)
?
-
1
:
+
1
;
if
(
*
s1
)
return
1
;
if
(
*
s2
)
return
-
1
;
return
0
;
}
int
UNIOP
(
strncmp
)(
const
UNIOP_t
*
s1
,
const
UNIOP_t
*
s2
,
size_t
n
)
{
register
UNIOP_t
u1
,
u2
;
for
(;
n
!=
0
;
n
--
)
{
u1
=
*
s1
;
u2
=
*
s2
;
if
(
u1
!=
u2
)
return
(
u1
<
u2
)
?
-
1
:
+
1
;
if
(
u1
==
'\0'
)
return
0
;
s1
++
;
s2
++
;
}
return
0
;
}
UNIOP_t
*
UNIOP
(
strchr
)(
const
UNIOP_t
*
s
,
UNIOP_t
c
)
{
const
UNIOP_t
*
p
;
for
(
p
=
s
;
*
p
;
p
++
)
if
(
*
p
==
c
)
return
(
UNIOP_t
*
)
p
;
return
NULL
;
}
UNIOP_t
*
UNIOP
(
strrchr
)(
const
UNIOP_t
*
s
,
UNIOP_t
c
)
{
const
UNIOP_t
*
p
;
p
=
s
+
UNIOP
(
strlen
)(
s
);
while
(
p
!=
s
)
{
p
--
;
if
(
*
p
==
c
)
return
(
UNIOP_t
*
)
p
;
}
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