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
c90acb95
Kaydet (Commit)
c90acb95
authored
Tem 04, 2001
tarafından
unknown
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Do conversion of CFStrings to/from unicode.
üst
d1054ef3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
0 deletions
+27
-0
CFmodule.c
Mac/Modules/cf/CFmodule.c
+0
-0
cfsupport.py
Mac/Modules/cf/cfsupport.py
+27
-0
No files found.
Mac/Modules/cf/CFmodule.c
Dosyayı görüntüle @
c90acb95
This diff is collapsed.
Click to expand it.
Mac/Modules/cf/cfsupport.py
Dosyayı görüntüle @
c90acb95
...
@@ -250,6 +250,15 @@ class CFStringRefObjectDefinition(MyGlobalObjectDefinition):
...
@@ -250,6 +250,15 @@ class CFStringRefObjectDefinition(MyGlobalObjectDefinition):
*p_itself = CFStringCreateWithCString((CFAllocatorRef)NULL, cStr, 0);
*p_itself = CFStringCreateWithCString((CFAllocatorRef)NULL, cStr, 0);
return 1;
return 1;
}
}
if (PyUnicode_Check(v)) {
/* We use the CF types here, if Python was configured differently that will give an error */
CFIndex size = PyUnicode_GetSize(v);
UniChar *unichars = PyUnicode_AsUnicode(v);
if (!unichars) return 0;
*p_itself = CFStringCreateWithCharacters((CFAllocatorRef)NULL, unichars, size);
return 1;
}
"""
)
"""
)
def
outputRepr
(
self
):
def
outputRepr
(
self
):
...
@@ -377,6 +386,24 @@ f = ManualGenerator("CFStringGetString", getasstring_body);
...
@@ -377,6 +386,24 @@ f = ManualGenerator("CFStringGetString", getasstring_body);
f
.
docstring
=
lambda
:
"() -> (string _rv)"
f
.
docstring
=
lambda
:
"() -> (string _rv)"
CFStringRef_object
.
add
(
f
)
CFStringRef_object
.
add
(
f
)
getasunicode_body
=
"""
int size = CFStringGetLength(_self->ob_itself)+1;
Py_UNICODE *data = malloc(size*sizeof(Py_UNICODE));
CFRange range;
range.location = 0;
range.length = size;
if( data == NULL ) return PyErr_NoMemory();
CFStringGetCharacters(_self->ob_itself, range, data);
_res = (PyObject *)PyUnicode_FromUnicode(data, size);
free(data);
return _res;
"""
f
=
ManualGenerator
(
"CFStringGetUnicode"
,
getasunicode_body
);
f
.
docstring
=
lambda
:
"() -> (unicode _rv)"
CFStringRef_object
.
add
(
f
)
# ADD add forloop here
# ADD add forloop here
# generate output (open the output file as late as possible)
# generate output (open the output file as late as possible)
...
...
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