github.com/goplus/llgo@v0.8.3/py/long.go (about) 1 /* 2 * Copyright (c) 2024 The GoPlus Authors (goplus.org). All rights reserved. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package py 18 19 import ( 20 _ "unsafe" 21 22 "github.com/goplus/llgo/c" 23 ) 24 25 // https://docs.python.org/3/c-api/long.html 26 27 //go:linkname Long C.PyLong_FromLong 28 func Long(v c.Long) *Object 29 30 //go:linkname LongLong C.PyLong_FromLongLong 31 func LongLong(v c.LongLong) *Object 32 33 //go:linkname Ulong C.PyLong_FromUnsignedLong 34 func Ulong(v c.Ulong) *Object 35 36 //go:linkname UlongLong C.PyLong_FromUnsignedLongLong 37 func UlongLong(v c.UlongLong) *Object 38 39 //go:linkname Uintptr C.PyLong_FromSize_t 40 func Uintptr(v uintptr) *Object 41 42 //go:linkname LongFromFloat64 C.PyLong_FromDouble 43 func LongFromFloat64(v float64) *Object 44 45 //go:linkname LongFromVoidPtr C.PyLong_FromVoidPtr 46 func LongFromVoidPtr(v c.Pointer) *Object 47 48 //go:linkname LongFromCStr C.PyLong_FromString 49 func LongFromCStr(v *c.Char, pend **c.Char, base c.Int) *Object 50 51 //go:linkname LongFromUnicode C.PyLong_FromUnicodeObject 52 func LongFromUnicode(v *Object, base c.Int) *Object 53 54 // llgo:link (*Object).Long C.PyLong_AsLong 55 func (l *Object) Long() c.Long { return 0 } 56 57 // llgo:link (*Object).LongLong C.PyLong_AsLongLong 58 func (l *Object) LongLong() c.LongLong { return 0 } 59 60 // llgo:link (*Object).Ulong C.PyLong_AsUnsignedLong 61 func (l *Object) Ulong() c.Ulong { return 0 } 62 63 // llgo:link (*Object).UlongLong C.PyLong_AsUnsignedLongLong 64 func (l *Object) UlongLong() c.UlongLong { return 0 } 65 66 // llgo:link (*Object).Uintptr C.PyLong_AsSize_t 67 func (l *Object) Uintptr() uintptr { return 0 } 68 69 // llgo:link (*Object).LongAsFloat64 C.PyLong_AsDouble 70 func (l *Object) LongAsFloat64() float64 { return 0 } 71 72 // llgo:link (*Object).LongAsVoidPtr C.PyLong_AsVoidPtr 73 func (l *Object) LongAsVoidPtr() c.Pointer { return nil }