@@ -253,11 +253,27 @@ TPythonVersionProp = record
253
253
TPFLAGS_DEFAULT = [tpfBaseType, tpHaveVersionTag];
254
254
255
255
// ------- Python opcodes ----------//
256
- Const
256
+ const
257
257
single_input = 256 ;
258
258
file_input = 257 ;
259
259
eval_input = 258 ;
260
260
261
+ // UnicodeObject.h
262
+ const
263
+ // Return values of the PyUnicode_KIND() macro
264
+
265
+ {
266
+ PyUnicode_WCHAR_KIND is deprecated. Will be removed in Python 12.
267
+ String contains only wstr byte characters. This is only possible
268
+ when the string was created with a legacy API and _PyUnicode_Ready()
269
+ has not been called yet.
270
+ }
271
+ PyUnicode_WCHAR_KIND = 0 ;
272
+
273
+ PyUnicode_1BYTE_KIND = 1 ;
274
+ PyUnicode_2BYTE_KIND = 2 ;
275
+ PyUnicode_4BYTE_KIND = 4 ;
276
+
261
277
// structmember.h
262
278
const
263
279
// * Types */
@@ -1521,9 +1537,12 @@ TPythonInterface=class(TDynamicDll)
1521
1537
PyUnicode_FromWideChar:function (const w:PWideChar; size:NativeInt):PPyObject; cdecl;
1522
1538
PyUnicode_FromString:function (s:PAnsiChar):PPyObject; cdecl;
1523
1539
PyUnicode_FromStringAndSize:function (s:PAnsiChar;i:NativeInt):PPyObject; cdecl;
1540
+ PyUnicode_FromKindAndData:function (kind:integer;const buffer:pointer;size:NativeInt):PPyObject; cdecl;
1524
1541
PyUnicode_AsWideChar:function (unicode: PPyObject; w:PWideChar; size:NativeInt):integer; cdecl;
1525
1542
PyUnicode_AsUTF8:function (unicode: PPyObject):PAnsiChar; cdecl;
1543
+ PyUnicode_AsUTF8AndSize:function (unicode: PPyObject; size: PNativeInt):PAnsiChar; cdecl;
1526
1544
PyUnicode_Decode:function (const s:PAnsiChar; size: NativeInt; const encoding : PAnsiChar; const errors: PAnsiChar):PPyObject; cdecl;
1545
+ PyUnicode_DecodeUTF16:function (const s:PAnsiChar; size: NativeInt; const errors: PAnsiChar; byteoder: PInteger):PPyObject; cdecl;
1527
1546
PyUnicode_AsEncodedString:function (unicode:PPyObject; const encoding:PAnsiChar; const errors:PAnsiChar):PPyObject; cdecl;
1528
1547
PyUnicode_FromOrdinal:function (ordinal:integer):PPyObject; cdecl;
1529
1548
PyUnicode_GetSize:function (unicode:PPyObject):NativeInt; cdecl;
@@ -1554,7 +1573,7 @@ TPythonInterface=class(TDynamicDll)
1554
1573
PyParser_SimpleParseStringFlags : function ( str : PAnsiChar; start, flags : Integer) : PNode; cdecl;
1555
1574
PyNode_Free : procedure( n : PNode ); cdecl;
1556
1575
PyErr_NewException : function ( name : PAnsiChar; base, dict : PPyObject ) : PPyObject; cdecl;
1557
- PyMem_Malloc : function ( size : NativeInt ) : Pointer;
1576
+ PyMem_Malloc : function ( size : NativeUInt ) : Pointer;
1558
1577
1559
1578
Py_SetProgramName : procedure( name : PWideChar); cdecl;
1560
1579
Py_IsInitialized : function : integer; cdecl;
@@ -3470,9 +3489,12 @@ procedure TPythonInterface.MapDll;
3470
3489
PyUnicode_FromWideChar := Import (AnsiString(Format(' PyUnicode%s_FromWideChar' ,[UnicodeSuffix])));
3471
3490
PyUnicode_FromString := Import (AnsiString(Format(' PyUnicode%s_FromString' ,[UnicodeSuffix])));
3472
3491
PyUnicode_FromStringAndSize := Import (AnsiString(Format(' PyUnicode%s_FromStringAndSize' ,[UnicodeSuffix])));
3492
+ PyUnicode_FromKindAndData := Import (AnsiString(Format(' PyUnicode%s_FromKindAndData' ,[UnicodeSuffix])));
3473
3493
PyUnicode_AsWideChar := Import (AnsiString(Format(' PyUnicode%s_AsWideChar' ,[UnicodeSuffix])));
3474
3494
PyUnicode_AsUTF8 := Import (AnsiString(Format(' PyUnicode%s_AsUTF8' ,[UnicodeSuffix])));
3495
+ PyUnicode_AsUTF8AndSize := Import (AnsiString(Format(' PyUnicode%s_AsUTF8AndSize' ,[UnicodeSuffix])));
3475
3496
PyUnicode_Decode := Import (AnsiString(Format(' PyUnicode%s_Decode' ,[UnicodeSuffix])));
3497
+ PyUnicode_DecodeUTF16 := Import (AnsiString(Format(' PyUnicode%s_DecodeUTF16' ,[UnicodeSuffix])));
3476
3498
PyUnicode_AsEncodedString := Import (AnsiString(Format(' PyUnicode%s_AsEncodedString' ,[UnicodeSuffix])));
3477
3499
PyUnicode_FromOrdinal := Import (AnsiString(Format(' PyUnicode%s_FromOrdinal' ,[UnicodeSuffix])));
3478
3500
PyUnicode_GetSize := Import (AnsiString(Format(' PyUnicode%s_GetSize' ,[UnicodeSuffix])));
0 commit comments