FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
pythonnet/src/runtime/monosupport.cs at v2.2.0-dev1 · attackgithub/pythonnet · GitHub
attackgithub
pythonnet
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
pythonnet
/
src
/
runtime
/
monosupport.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
53 lines (45 loc) · 1.2 KB
Breadcrumbs
pythonnet
/
src
/
runtime
/
monosupport.cs
Copy path
File metadata and controls
53 lines (45 loc) · 1.2 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#if
(
UCS4
)
using
System
;
using
System
.
Runtime
.
InteropServices
;
using
System
.
Text
;
using
Mono
.
Unix
;
namespace
Python
.
Runtime
{
// The Utf32Marshaler was written Jonathan Pryor and has been placed
// in the PUBLIC DOMAIN.
public
class
Utf32Marshaler
:
ICustomMarshaler
{
private
static
Utf32Marshaler
instance
=
new
Utf32Marshaler
(
)
;
public
static
ICustomMarshaler
GetInstance
(
string
s
)
{
return
instance
;
}
public
void
CleanUpManagedData
(
object
o
)
{
}
public
void
CleanUpNativeData
(
IntPtr
pNativeData
)
{
UnixMarshal
.
FreeHeap
(
pNativeData
)
;
}
public
int
GetNativeDataSize
(
)
{
return
IntPtr
.
Size
;
}
public
IntPtr
MarshalManagedToNative
(
object
obj
)
{
string
s
=
obj
as
string
;
if
(
s
==
null
)
return
IntPtr
.
Zero
;
return
UnixMarshal
.
StringToHeap
(
s
,
Encoding
.
UTF32
)
;
}
public
object
MarshalNativeToManaged
(
IntPtr
pNativeData
)
{
return
UnixMarshal
.
PtrToString
(
pNativeData
,
Encoding
.
UTF32
)
;
}
}
}
#endif
Back
|
FazBrowse Home
|
New Git URL