mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-05-16 11:32:39 +00:00
move sqlite driver into separate package, make wasm sqlite3 build build-taggable
This commit is contained in:
parent
fdc9e8769c
commit
fbdc98a3e9
12
go.mod
12
go.mod
|
@ -44,7 +44,7 @@ require (
|
|||
github.com/miekg/dns v1.1.59
|
||||
github.com/minio/minio-go/v7 v7.0.69
|
||||
github.com/mitchellh/mapstructure v1.5.0
|
||||
github.com/ncruces/go-sqlite3 v0.14.0
|
||||
github.com/ncruces/go-sqlite3 v0.14.1-0.20240422130245-189fbc98ac32
|
||||
github.com/oklog/ulid v1.3.1
|
||||
github.com/prometheus/client_golang v1.18.0
|
||||
github.com/spf13/cobra v1.8.0
|
||||
|
@ -79,6 +79,7 @@ require (
|
|||
golang.org/x/text v0.14.0
|
||||
gopkg.in/mcuadros/go-syslog.v2 v2.3.0
|
||||
gopkg.in/yaml.v3 v3.0.1
|
||||
modernc.org/sqlite v0.0.0-00010101000000-000000000000
|
||||
mvdan.cc/xurls/v2 v2.5.0
|
||||
)
|
||||
|
||||
|
@ -145,6 +146,7 @@ require (
|
|||
github.com/gorilla/securecookie v1.1.2 // indirect
|
||||
github.com/gorilla/sessions v1.2.2 // indirect
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 // indirect
|
||||
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
|
||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||
github.com/huandu/xstrings v1.3.3 // indirect
|
||||
github.com/imdario/mergo v0.3.12 // indirect
|
||||
|
@ -171,6 +173,7 @@ require (
|
|||
github.com/mitchellh/reflectwalk v1.0.2 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
github.com/ncruces/go-strftime v0.1.9 // indirect
|
||||
github.com/ncruces/julianday v1.0.0 // indirect
|
||||
github.com/opencontainers/runtime-spec v1.0.2 // indirect
|
||||
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
|
||||
|
@ -181,6 +184,7 @@ require (
|
|||
github.com/prometheus/common v0.45.0 // indirect
|
||||
github.com/prometheus/procfs v0.12.0 // indirect
|
||||
github.com/quasoft/memstore v0.0.0-20191010062613-2bce066d2b0b // indirect
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
|
||||
github.com/rogpeppe/go-internal v1.10.0 // indirect
|
||||
github.com/rs/xid v1.5.0 // indirect
|
||||
github.com/sagikazarmark/locafero v0.4.0 // indirect
|
||||
|
@ -219,4 +223,10 @@ require (
|
|||
google.golang.org/protobuf v1.33.0 // indirect
|
||||
gopkg.in/ini.v1 v1.67.0 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6 // indirect
|
||||
modernc.org/libc v1.49.3 // indirect
|
||||
modernc.org/mathutil v1.6.0 // indirect
|
||||
modernc.org/memory v1.8.0 // indirect
|
||||
modernc.org/strutil v1.2.0 // indirect
|
||||
modernc.org/token v1.1.0 // indirect
|
||||
)
|
||||
|
|
40
go.sum
40
go.sum
|
@ -369,6 +369,8 @@ github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hf
|
|||
github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||
github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||
github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||
github.com/google/pprof v0.0.0-20240409012703-83162a5b38cd h1:gbpYu9NMq8jhDVbvlGkMFWCjLFlqqEZjEmObmhUy6Vo=
|
||||
github.com/google/pprof v0.0.0-20240409012703-83162a5b38cd/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw=
|
||||
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
|
||||
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
|
@ -399,6 +401,8 @@ github.com/h2non/filetype v1.1.3 h1:FKkx9QbD7HR/zjK1Ia5XiBsq9zdLi5Kf3zGyFTAFkGg=
|
|||
github.com/h2non/filetype v1.1.3/go.mod h1:319b3zT68BvV+WRj7cwy856M2ehB3HqNOt6sy1HndBY=
|
||||
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||
github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k=
|
||||
github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
|
||||
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
|
||||
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
|
||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||
|
@ -475,6 +479,8 @@ github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope
|
|||
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
||||
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
||||
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||
github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU=
|
||||
github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
|
||||
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg=
|
||||
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k=
|
||||
github.com/microcosm-cc/bluemonday v1.0.26 h1:xbqSvqzQMeEHCqMi64VAs4d8uy6Mequs3rQ0k/Khz58=
|
||||
|
@ -507,8 +513,10 @@ github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjY
|
|||
github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc=
|
||||
github.com/moul/http2curl v1.0.0 h1:dRMWoAtb+ePxMlLkrCbAqh4TlPHXvoGUSQ323/9Zahs=
|
||||
github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ=
|
||||
github.com/ncruces/go-sqlite3 v0.14.0 h1:R1Jmnc7o5ECQeZPNzbLHfE8vz1DLewV+bJypHSad354=
|
||||
github.com/ncruces/go-sqlite3 v0.14.0/go.mod h1:NRmOFatwnQaZq8niw0f3k/j3a0yUVt250qcVeDuyANY=
|
||||
github.com/ncruces/go-sqlite3 v0.14.1-0.20240422130245-189fbc98ac32 h1:bXZoglQBxhicSCUi0lEhveQKR1iDy455dZ2OVaKZAGI=
|
||||
github.com/ncruces/go-sqlite3 v0.14.1-0.20240422130245-189fbc98ac32/go.mod h1:kHHYmFmK4G2VFFoIovEg9BEQ8BP+D81y4ESHXnzJV/w=
|
||||
github.com/ncruces/go-strftime v0.1.9 h1:bY0MQC28UADQmHmaF5dgpLmImcShSi2kHU9XLdhx/f4=
|
||||
github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls=
|
||||
github.com/ncruces/julianday v1.0.0 h1:fH0OKwa7NWvniGQtxdJRxAgkBMolni2BjDHaWTxqt7M=
|
||||
github.com/ncruces/julianday v1.0.0/go.mod h1:Dusn2KvZrrovOMJuOt0TNXL6tB7U2E8kvza5fFc9G7g=
|
||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
|
||||
|
@ -550,6 +558,8 @@ github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k
|
|||
github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
|
||||
github.com/quasoft/memstore v0.0.0-20191010062613-2bce066d2b0b h1:aUNXCGgukb4gtY99imuIeoh8Vr0GSwAlYxPAhqZrpFc=
|
||||
github.com/quasoft/memstore v0.0.0-20191010062613-2bce066d2b0b/go.mod h1:wTPjTepVu7uJBYgZ0SdWHQlIas582j6cn2jgk4DDdlg=
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
|
||||
github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
||||
github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
||||
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
||||
|
@ -712,6 +722,8 @@ github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de
|
|||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
github.com/yuin/goldmark v1.7.1 h1:3bajkSilaCbjdKVsKdZjZCLBNPL9pYzrCakKaf4U49U=
|
||||
github.com/yuin/goldmark v1.7.1/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E=
|
||||
gitlab.com/NyaaaWhatsUpDoc/sqlite v1.29.7-concurrency-workaround h1:N4h6T8jb9BZTor6d4XJYaKYEh3KNAydpuydR2N1hPRc=
|
||||
gitlab.com/NyaaaWhatsUpDoc/sqlite v1.29.7-concurrency-workaround/go.mod h1:lQPm27iqa4UNZpmr4Aor0MH0HkCLbt1huYDfWylLZFk=
|
||||
go.mongodb.org/mongo-driver v1.7.3/go.mod h1:NqaYOwnXWr5Pm7AOpO5QFxKJ503nbMse/R79oO62zWg=
|
||||
go.mongodb.org/mongo-driver v1.7.5/go.mod h1:VXEWRZ6URJIkUq2SCAyapmhH0ZLRBP+FT4xhp5Zvxng=
|
||||
go.mongodb.org/mongo-driver v1.10.0/go.mod h1:wsihk0Kdgv8Kqu1Anit4sfK+22vSFbUrAVEYRhCXrA8=
|
||||
|
@ -1097,6 +1109,30 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh
|
|||
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
|
||||
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
|
||||
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
|
||||
modernc.org/cc/v4 v4.20.0 h1:45Or8mQfbUqJOG9WaxvlFYOAQO0lQ5RvqBcFCXngjxk=
|
||||
modernc.org/cc/v4 v4.20.0/go.mod h1:HM7VJTZbUCR3rV8EYBi9wxnJ0ZBRiGE5OeGXNA0IsLQ=
|
||||
modernc.org/ccgo/v4 v4.16.0 h1:ofwORa6vx2FMm0916/CkZjpFPSR70VwTjUCe2Eg5BnA=
|
||||
modernc.org/ccgo/v4 v4.16.0/go.mod h1:dkNyWIjFrVIZ68DTo36vHK+6/ShBn4ysU61So6PIqCI=
|
||||
modernc.org/fileutil v1.3.0 h1:gQ5SIzK3H9kdfai/5x41oQiKValumqNTDXMvKo62HvE=
|
||||
modernc.org/fileutil v1.3.0/go.mod h1:XatxS8fZi3pS8/hKG2GH/ArUogfxjpEKs3Ku3aK4JyQ=
|
||||
modernc.org/gc/v2 v2.4.1 h1:9cNzOqPyMJBvrUipmynX0ZohMhcxPtMccYgGOJdOiBw=
|
||||
modernc.org/gc/v2 v2.4.1/go.mod h1:wzN5dK1AzVGoH6XOzc3YZ+ey/jPgYHLuVckd62P0GYU=
|
||||
modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6 h1:5D53IMaUuA5InSeMu9eJtlQXS2NxAhyWQvkKEgXZhHI=
|
||||
modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6/go.mod h1:Qz0X07sNOR1jWYCrJMEnbW/X55x206Q7Vt4mz6/wHp4=
|
||||
modernc.org/libc v1.49.3 h1:j2MRCRdwJI2ls/sGbeSk0t2bypOG/uvPZUsGQFDulqg=
|
||||
modernc.org/libc v1.49.3/go.mod h1:yMZuGkn7pXbKfoT/M35gFJOAEdSKdxL0q64sF7KqCDo=
|
||||
modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4=
|
||||
modernc.org/mathutil v1.6.0/go.mod h1:Ui5Q9q1TR2gFm0AQRqQUaBWFLAhQpCwNcuhBOSedWPo=
|
||||
modernc.org/memory v1.8.0 h1:IqGTL6eFMaDZZhEWwcREgeMXYwmW83LYW8cROZYkg+E=
|
||||
modernc.org/memory v1.8.0/go.mod h1:XPZ936zp5OMKGWPqbD3JShgd/ZoQ7899TUuQqxY+peU=
|
||||
modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4=
|
||||
modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0=
|
||||
modernc.org/sortutil v1.2.0 h1:jQiD3PfS2REGJNzNCMMaLSp/wdMNieTbKX920Cqdgqc=
|
||||
modernc.org/sortutil v1.2.0/go.mod h1:TKU2s7kJMf1AE84OoiGppNHJwvB753OYfNl2WRb++Ss=
|
||||
modernc.org/strutil v1.2.0 h1:agBi9dp1I+eOnxXeiZawM8F4LawKv4NzGWSaLfyeNZA=
|
||||
modernc.org/strutil v1.2.0/go.mod h1:/mdcBmfOibveCTBxUl5B5l6W+TTH1FXPLHZE6bTosX0=
|
||||
modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y=
|
||||
modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM=
|
||||
mvdan.cc/xurls/v2 v2.5.0 h1:lyBNOm8Wo71UknhUs4QTFUNNMyxy2JEIaKKo0RWOh+8=
|
||||
mvdan.cc/xurls/v2 v2.5.0/go.mod h1:yQgaGQ1rFtJUzkmKiHYSSfuQxqfYmd//X6PxvholpeE=
|
||||
nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50=
|
||||
|
|
|
@ -337,7 +337,6 @@ func sqliteConn(ctx context.Context) (*bun.DB, error) {
|
|||
// Open new DB instance
|
||||
sqldb, err := sql.Open("sqlite-gts", address)
|
||||
if err != nil {
|
||||
err = processSQLiteError(err) // this adds error code information
|
||||
return nil, fmt.Errorf("could not open sqlite db with address %s: %w", address, err)
|
||||
}
|
||||
|
||||
|
@ -352,7 +351,6 @@ func sqliteConn(ctx context.Context) (*bun.DB, error) {
|
|||
|
||||
// ping to check the db is there and listening
|
||||
if err := db.PingContext(ctx); err != nil {
|
||||
err = processSQLiteError(err) // adds error code
|
||||
return nil, fmt.Errorf("sqlite ping: %w", err)
|
||||
}
|
||||
|
||||
|
@ -527,8 +525,7 @@ func buildSQLiteAddress(addr string) string {
|
|||
|
||||
// in-mem-specific preferences
|
||||
// (shared cache so that tests don't fail)
|
||||
// prefs.Add("mode", "memory")
|
||||
// prefs.Add("cache", "shared")
|
||||
prefs.Add("vfs", "memdb")
|
||||
}
|
||||
|
||||
if dur := config.GetDbSqliteBusyTimeout(); dur > 0 {
|
||||
|
|
|
@ -21,18 +21,16 @@ import (
|
|||
"context"
|
||||
"database/sql"
|
||||
"database/sql/driver"
|
||||
"time"
|
||||
_ "unsafe" // linkname shenanigans
|
||||
|
||||
pgx "github.com/jackc/pgx/v5/stdlib"
|
||||
"github.com/ncruces/go-sqlite3"
|
||||
|
||||
// our sqlite driver wrapper.
|
||||
"github.com/superseriousbusiness/gotosocial/internal/db/sqlite"
|
||||
)
|
||||
|
||||
var (
|
||||
// global wrapped gts driver instances.
|
||||
gtsPostgresDriver = &PostgreSQLDriver{}
|
||||
gtsSQLiteDriver = &SQLiteDriver{}
|
||||
|
||||
// global PostgreSQL driver instances.
|
||||
postgresDriver = pgx.GetDefaultDriver()
|
||||
|
@ -50,7 +48,7 @@ var (
|
|||
|
||||
func init() {
|
||||
sql.Register("pgx-gts", gtsPostgresDriver)
|
||||
sql.Register("sqlite-gts", gtsSQLiteDriver)
|
||||
sql.Register("sqlite-gts", &sqlite.Driver{})
|
||||
}
|
||||
|
||||
// PostgreSQLDriver is our own wrapper around the
|
||||
|
@ -152,161 +150,6 @@ func (stmt *PostgreSQLStmt) QueryContext(ctx context.Context, args []driver.Name
|
|||
return rows, err
|
||||
}
|
||||
|
||||
// SQLiteDriver is our own wrapper around the
|
||||
// sqlite.Driver{} type in order to wrap further
|
||||
// SQL driver types with our own functionality,
|
||||
// e.g. hooks, retries and err processing.
|
||||
type SQLiteDriver struct{}
|
||||
|
||||
func (d *SQLiteDriver) Open(name string) (driver.Conn, error) {
|
||||
cc, err := d.OpenConnector(name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return cc.Connect(context.Background())
|
||||
}
|
||||
|
||||
func (d *SQLiteDriver) OpenConnector(name string) (driver.Connector, error) {
|
||||
cc, err := sqliteDriver.OpenConnector(name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &SQLiteConnector{cc}, nil
|
||||
}
|
||||
|
||||
type SQLiteConnector struct{ driver.Connector }
|
||||
|
||||
func (c *SQLiteConnector) Driver() driver.Driver { return gtsSQLiteDriver }
|
||||
|
||||
func (c *SQLiteConnector) Connect(ctx context.Context) (driver.Conn, error) {
|
||||
conn, err := c.Connector.Connect(ctx)
|
||||
err = processSQLiteError(err)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &SQLiteConn{conn.(sqlite.ConnIface)}, nil
|
||||
}
|
||||
|
||||
type SQLiteConn struct{ sqlite.ConnIface }
|
||||
|
||||
func (c *SQLiteConn) Begin() (driver.Tx, error) {
|
||||
return c.BeginTx(context.Background(), driver.TxOptions{})
|
||||
}
|
||||
|
||||
func (c *SQLiteConn) BeginTx(ctx context.Context, opts driver.TxOptions) (tx driver.Tx, err error) {
|
||||
tx, err = c.ConnIface.BeginTx(ctx, opts)
|
||||
err = processSQLiteError(err)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &SQLiteTx{tx}, nil
|
||||
}
|
||||
|
||||
func (c *SQLiteConn) Prepare(query string) (driver.Stmt, error) {
|
||||
return c.PrepareContext(context.Background(), query)
|
||||
}
|
||||
|
||||
func (c *SQLiteConn) PrepareContext(ctx context.Context, query string) (stmt driver.Stmt, err error) {
|
||||
stmt, err = c.ConnIface.PrepareContext(ctx, query)
|
||||
err = processSQLiteError(err)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &SQLiteStmt{StmtIface: stmt.(sqlite.StmtIface)}, nil
|
||||
}
|
||||
|
||||
func (c *SQLiteConn) Exec(query string, args []driver.Value) (driver.Result, error) {
|
||||
return c.ExecContext(context.Background(), query, toNamedValues(args))
|
||||
}
|
||||
|
||||
func (c *SQLiteConn) ExecContext(ctx context.Context, query string, args []driver.NamedValue) (res driver.Result, err error) {
|
||||
res, err = c.ConnIface.ExecContext(ctx, query, args)
|
||||
err = processSQLiteError(err)
|
||||
return
|
||||
}
|
||||
|
||||
func (c *SQLiteConn) Close() (err error) {
|
||||
ctx := context.Background()
|
||||
|
||||
// Get acces the underlying raw sqlite3 conn.
|
||||
raw := c.ConnIface.(sqlite3.DriverConn).Raw()
|
||||
|
||||
// Set a timeout context to limit execution time.
|
||||
ctx, cncl := context.WithTimeout(ctx, 5*time.Second)
|
||||
old := raw.SetInterrupt(ctx)
|
||||
|
||||
// see: https://www.sqlite.org/pragma.html#pragma_optimize
|
||||
const onClose = "PRAGMA analysis_limit=1000; PRAGMA optimize;"
|
||||
_ = raw.Exec(onClose)
|
||||
|
||||
// Unset timeout context.
|
||||
_ = raw.SetInterrupt(old)
|
||||
cncl()
|
||||
|
||||
// Finally, close.
|
||||
err = raw.Close()
|
||||
return
|
||||
}
|
||||
|
||||
type SQLiteTx struct{ driver.Tx }
|
||||
|
||||
func (tx *SQLiteTx) Commit() (err error) {
|
||||
err = tx.Tx.Commit()
|
||||
err = processSQLiteError(err)
|
||||
return
|
||||
}
|
||||
|
||||
func (tx *SQLiteTx) Rollback() (err error) {
|
||||
err = tx.Tx.Rollback()
|
||||
err = processSQLiteError(err)
|
||||
return
|
||||
}
|
||||
|
||||
type SQLiteStmt struct{ sqlite.StmtIface }
|
||||
|
||||
func (stmt *SQLiteStmt) Exec(args []driver.Value) (driver.Result, error) {
|
||||
return stmt.ExecContext(context.Background(), toNamedValues(args))
|
||||
}
|
||||
|
||||
func (stmt *SQLiteStmt) ExecContext(ctx context.Context, args []driver.NamedValue) (res driver.Result, err error) {
|
||||
res, err = stmt.StmtIface.ExecContext(ctx, args)
|
||||
err = processSQLiteError(err)
|
||||
return
|
||||
}
|
||||
|
||||
func (stmt *SQLiteStmt) Query(args []driver.Value) (driver.Rows, error) {
|
||||
return stmt.QueryContext(context.Background(), toNamedValues(args))
|
||||
}
|
||||
|
||||
func (stmt *SQLiteStmt) QueryContext(ctx context.Context, args []driver.NamedValue) (rows driver.Rows, err error) {
|
||||
rows, err = stmt.StmtIface.QueryContext(ctx, args)
|
||||
err = processSQLiteError(err)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &SQLiteRows{RowsIface: rows.(sqlite.RowsIface)}, nil
|
||||
}
|
||||
|
||||
func (stmt *SQLiteStmt) Close() (err error) {
|
||||
err = stmt.StmtIface.Close()
|
||||
err = processSQLiteError(err)
|
||||
return
|
||||
}
|
||||
|
||||
type SQLiteRows struct{ sqlite.RowsIface }
|
||||
|
||||
func (r *SQLiteRows) Next(dest []driver.Value) (err error) {
|
||||
err = r.RowsIface.Next(dest)
|
||||
err = processSQLiteError(err)
|
||||
return
|
||||
}
|
||||
|
||||
func (r *SQLiteRows) Close() (err error) {
|
||||
err = r.RowsIface.Close()
|
||||
err = processSQLiteError(err)
|
||||
return
|
||||
}
|
||||
|
||||
type conn interface {
|
||||
driver.Conn
|
||||
driver.ConnPrepareContext
|
||||
|
|
|
@ -22,7 +22,6 @@ import (
|
|||
"fmt"
|
||||
|
||||
"github.com/jackc/pgx/v5/pgconn"
|
||||
"github.com/ncruces/go-sqlite3"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||
)
|
||||
|
||||
|
@ -49,25 +48,3 @@ func processPostgresError(err error) error {
|
|||
// extended code for easier debugging later.
|
||||
return fmt.Errorf("%w (code=%s)", err, pgErr.Code)
|
||||
}
|
||||
|
||||
func processSQLiteError(err error) error {
|
||||
// Attempt to cast as sqlite error.
|
||||
sqliteErr, ok := err.(*sqlite3.Error)
|
||||
if !ok {
|
||||
return err
|
||||
}
|
||||
|
||||
// Handle supplied error code:
|
||||
switch sqliteErr.ExtendedCode() {
|
||||
case sqlite3.CONSTRAINT_UNIQUE,
|
||||
sqlite3.CONSTRAINT_PRIMARYKEY:
|
||||
return db.ErrAlreadyExists
|
||||
}
|
||||
|
||||
// Wrap the returned error with the code and
|
||||
// extended code for easier debugging later.
|
||||
return fmt.Errorf("%w (code=%d extended=%d)", err,
|
||||
sqliteErr.Code(),
|
||||
sqliteErr.ExtendedCode(),
|
||||
)
|
||||
}
|
||||
|
|
203
internal/db/sqlite/driver.go
Normal file
203
internal/db/sqlite/driver.go
Normal file
|
@ -0,0 +1,203 @@
|
|||
// GoToSocial
|
||||
// Copyright (C) GoToSocial Authors admin@gotosocial.org
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
//go:build !wasmsqlite3
|
||||
|
||||
package sqlite
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql/driver"
|
||||
"time"
|
||||
|
||||
"modernc.org/sqlite"
|
||||
|
||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||
)
|
||||
|
||||
// Driver is our own wrapper around the
|
||||
// sqlite.Driver{} type in order to wrap
|
||||
// further SQL types with our own
|
||||
// functionality, e.g. err processing.
|
||||
type Driver struct{ sqlite.Driver }
|
||||
|
||||
func (d *Driver) Open(name string) (driver.Conn, error) {
|
||||
conn, err := d.Driver.Open(name)
|
||||
if err != nil {
|
||||
err = processSQLiteError(err)
|
||||
return nil, err
|
||||
}
|
||||
return &sqliteConn{conn.(connIface)}, nil
|
||||
}
|
||||
|
||||
type sqliteConn struct{ connIface }
|
||||
|
||||
func (c *sqliteConn) Begin() (driver.Tx, error) {
|
||||
return c.BeginTx(context.Background(), driver.TxOptions{})
|
||||
}
|
||||
|
||||
func (c *sqliteConn) BeginTx(ctx context.Context, opts driver.TxOptions) (tx driver.Tx, err error) {
|
||||
tx, err = c.connIface.BeginTx(ctx, opts)
|
||||
err = processSQLiteError(err)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &sqliteTx{tx}, nil
|
||||
}
|
||||
|
||||
func (c *sqliteConn) Prepare(query string) (driver.Stmt, error) {
|
||||
return c.PrepareContext(context.Background(), query)
|
||||
}
|
||||
|
||||
func (c *sqliteConn) PrepareContext(ctx context.Context, query string) (stmt driver.Stmt, err error) {
|
||||
stmt, err = c.connIface.PrepareContext(ctx, query)
|
||||
err = processSQLiteError(err)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &sqliteStmt{stmtIface: stmt.(stmtIface)}, nil
|
||||
}
|
||||
|
||||
func (c *sqliteConn) Exec(query string, args []driver.Value) (driver.Result, error) {
|
||||
return c.ExecContext(context.Background(), query, db.ToNamedValues(args))
|
||||
}
|
||||
|
||||
func (c *sqliteConn) ExecContext(ctx context.Context, query string, args []driver.NamedValue) (res driver.Result, err error) {
|
||||
res, err = c.connIface.ExecContext(ctx, query, args)
|
||||
err = processSQLiteError(err)
|
||||
return
|
||||
}
|
||||
|
||||
func (c *sqliteConn) Query(query string, args []driver.Value) (driver.Rows, error) {
|
||||
return c.QueryContext(context.Background(), query, db.ToNamedValues(args))
|
||||
}
|
||||
|
||||
func (c *sqliteConn) QueryContext(ctx context.Context, query string, args []driver.NamedValue) (rows driver.Rows, err error) {
|
||||
rows, err = c.connIface.QueryContext(ctx, query, args)
|
||||
err = processSQLiteError(err)
|
||||
return
|
||||
}
|
||||
|
||||
func (c *sqliteConn) Close() (err error) {
|
||||
ctx := context.Background()
|
||||
|
||||
// Set a timeout context to limit execution time.
|
||||
ctx, cncl := context.WithTimeout(ctx, 5*time.Second)
|
||||
|
||||
// see: https://www.sqlite.org/pragma.html#pragma_optimize
|
||||
const onClose = "PRAGMA analysis_limit=1000; PRAGMA optimize;"
|
||||
_, _ = c.connIface.ExecContext(ctx, onClose, nil)
|
||||
|
||||
// Done.
|
||||
cncl()
|
||||
|
||||
// Finally, close the conn.
|
||||
err = c.connIface.Close()
|
||||
return
|
||||
}
|
||||
|
||||
type sqliteTx struct{ driver.Tx }
|
||||
|
||||
func (tx *sqliteTx) Commit() (err error) {
|
||||
err = tx.Tx.Commit()
|
||||
err = processSQLiteError(err)
|
||||
return
|
||||
}
|
||||
|
||||
func (tx *sqliteTx) Rollback() (err error) {
|
||||
err = tx.Tx.Rollback()
|
||||
err = processSQLiteError(err)
|
||||
return
|
||||
}
|
||||
|
||||
type sqliteStmt struct{ stmtIface }
|
||||
|
||||
func (stmt *sqliteStmt) Exec(args []driver.Value) (driver.Result, error) {
|
||||
return stmt.ExecContext(context.Background(), db.ToNamedValues(args))
|
||||
}
|
||||
|
||||
func (stmt *sqliteStmt) ExecContext(ctx context.Context, args []driver.NamedValue) (res driver.Result, err error) {
|
||||
res, err = stmt.stmtIface.ExecContext(ctx, args)
|
||||
err = processSQLiteError(err)
|
||||
return
|
||||
}
|
||||
|
||||
func (stmt *sqliteStmt) Query(args []driver.Value) (driver.Rows, error) {
|
||||
return stmt.QueryContext(context.Background(), db.ToNamedValues(args))
|
||||
}
|
||||
|
||||
func (stmt *sqliteStmt) QueryContext(ctx context.Context, args []driver.NamedValue) (rows driver.Rows, err error) {
|
||||
rows, err = stmt.stmtIface.QueryContext(ctx, args)
|
||||
err = processSQLiteError(err)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &sqliteRows{rows.(rowsIface)}, nil
|
||||
}
|
||||
|
||||
func (stmt *sqliteStmt) Close() (err error) {
|
||||
err = stmt.stmtIface.Close()
|
||||
err = processSQLiteError(err)
|
||||
return
|
||||
}
|
||||
|
||||
type sqliteRows struct{ rowsIface }
|
||||
|
||||
func (r *sqliteRows) Next(dest []driver.Value) (err error) {
|
||||
err = r.rowsIface.Next(dest)
|
||||
err = processSQLiteError(err)
|
||||
return
|
||||
}
|
||||
|
||||
func (r *sqliteRows) Close() (err error) {
|
||||
err = r.rowsIface.Close()
|
||||
err = processSQLiteError(err)
|
||||
return
|
||||
}
|
||||
|
||||
// connIface is the driver.Conn interface
|
||||
// types (and the like) that modernc.org/sqlite.conn
|
||||
// conforms to. Useful so you don't need
|
||||
// to repeatedly perform checks yourself.
|
||||
type connIface interface {
|
||||
driver.Conn
|
||||
driver.ConnBeginTx
|
||||
driver.ConnPrepareContext
|
||||
driver.ExecerContext
|
||||
driver.QueryerContext
|
||||
}
|
||||
|
||||
// StmtIface is the driver.Stmt interface
|
||||
// types (and the like) that modernc.org/sqlite.stmt
|
||||
// conforms to. Useful so you don't need
|
||||
// to repeatedly perform checks yourself.
|
||||
type stmtIface interface {
|
||||
driver.Stmt
|
||||
driver.StmtExecContext
|
||||
driver.StmtQueryContext
|
||||
}
|
||||
|
||||
// RowsIface is the driver.Rows interface
|
||||
// types (and the like) that modernc.org/sqlite.rows
|
||||
// conforms to. Useful so you don't need
|
||||
// to repeatedly perform checks yourself.
|
||||
type rowsIface interface {
|
||||
driver.Rows
|
||||
driver.RowsColumnTypeDatabaseTypeName
|
||||
driver.RowsColumnTypeLength
|
||||
driver.RowsColumnTypeScanType
|
||||
}
|
222
internal/db/sqlite/driver_wasmsqlite3.go
Normal file
222
internal/db/sqlite/driver_wasmsqlite3.go
Normal file
|
@ -0,0 +1,222 @@
|
|||
// GoToSocial
|
||||
// Copyright (C) GoToSocial Authors admin@gotosocial.org
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
//go:build wasmsqlite3
|
||||
|
||||
package sqlite
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql/driver"
|
||||
"time"
|
||||
|
||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||
|
||||
"github.com/ncruces/go-sqlite3"
|
||||
sqlite3driver "github.com/ncruces/go-sqlite3/driver"
|
||||
_ "github.com/ncruces/go-sqlite3/embed" // embed wasm binary
|
||||
_ "github.com/ncruces/go-sqlite3/vfs/memdb"
|
||||
)
|
||||
|
||||
// Driver is our own wrapper around the
|
||||
// driver.SQLite{} type in order to wrap
|
||||
// further SQL types with our own
|
||||
// functionality, e.g. err processing.
|
||||
type Driver struct{ sqlite3driver.SQLite }
|
||||
|
||||
func (d *Driver) Open(name string) (driver.Conn, error) {
|
||||
conn, err := d.SQLite.Open(name)
|
||||
if err != nil {
|
||||
err = processSQLiteError(err)
|
||||
return nil, err
|
||||
}
|
||||
return &sqliteConn{conn.(connIface)}, nil
|
||||
}
|
||||
|
||||
func (d *Driver) OpenConnector(name string) (driver.Connector, error) {
|
||||
cc, err := d.SQLite.OpenConnector(name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &sqliteConnector{driver: d, Connector: cc}, nil
|
||||
}
|
||||
|
||||
type sqliteConnector struct {
|
||||
driver *Driver
|
||||
driver.Connector
|
||||
}
|
||||
|
||||
func (c *sqliteConnector) Driver() driver.Driver { return c.driver }
|
||||
|
||||
func (c *sqliteConnector) Connect(ctx context.Context) (driver.Conn, error) {
|
||||
conn, err := c.Connector.Connect(ctx)
|
||||
err = processSQLiteError(err)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &sqliteConn{conn.(connIface)}, nil
|
||||
}
|
||||
|
||||
type sqliteConn struct{ connIface }
|
||||
|
||||
func (c *sqliteConn) Begin() (driver.Tx, error) {
|
||||
return c.BeginTx(context.Background(), driver.TxOptions{})
|
||||
}
|
||||
|
||||
func (c *sqliteConn) BeginTx(ctx context.Context, opts driver.TxOptions) (tx driver.Tx, err error) {
|
||||
tx, err = c.connIface.BeginTx(ctx, opts)
|
||||
err = processSQLiteError(err)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &sqliteTx{tx}, nil
|
||||
}
|
||||
|
||||
func (c *sqliteConn) Prepare(query string) (driver.Stmt, error) {
|
||||
return c.PrepareContext(context.Background(), query)
|
||||
}
|
||||
|
||||
func (c *sqliteConn) PrepareContext(ctx context.Context, query string) (stmt driver.Stmt, err error) {
|
||||
stmt, err = c.connIface.PrepareContext(ctx, query)
|
||||
err = processSQLiteError(err)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &sqliteStmt{stmtIface: stmt.(stmtIface)}, nil
|
||||
}
|
||||
|
||||
func (c *sqliteConn) Exec(query string, args []driver.Value) (driver.Result, error) {
|
||||
return c.ExecContext(context.Background(), query, db.ToNamedValues(args))
|
||||
}
|
||||
|
||||
func (c *sqliteConn) ExecContext(ctx context.Context, query string, args []driver.NamedValue) (res driver.Result, err error) {
|
||||
res, err = c.connIface.ExecContext(ctx, query, args)
|
||||
err = processSQLiteError(err)
|
||||
return
|
||||
}
|
||||
|
||||
func (c *sqliteConn) Close() (err error) {
|
||||
ctx := context.Background()
|
||||
|
||||
// Get acces the underlying raw sqlite3 conn.
|
||||
raw := c.connIface.(sqlite3.DriverConn).Raw()
|
||||
|
||||
// Set a timeout context to limit execution time.
|
||||
ctx, cncl := context.WithTimeout(ctx, 5*time.Second)
|
||||
old := raw.SetInterrupt(ctx)
|
||||
|
||||
// see: https://www.sqlite.org/pragma.html#pragma_optimize
|
||||
const onClose = "PRAGMA analysis_limit=1000; PRAGMA optimize;"
|
||||
_ = raw.Exec(onClose)
|
||||
|
||||
// Unset timeout context.
|
||||
_ = raw.SetInterrupt(old)
|
||||
cncl()
|
||||
|
||||
// Finally, close.
|
||||
err = raw.Close()
|
||||
return
|
||||
}
|
||||
|
||||
type sqliteTx struct{ driver.Tx }
|
||||
|
||||
func (tx *sqliteTx) Commit() (err error) {
|
||||
err = tx.Tx.Commit()
|
||||
err = processSQLiteError(err)
|
||||
return
|
||||
}
|
||||
|
||||
func (tx *sqliteTx) Rollback() (err error) {
|
||||
err = tx.Tx.Rollback()
|
||||
err = processSQLiteError(err)
|
||||
return
|
||||
}
|
||||
|
||||
type sqliteStmt struct{ stmtIface }
|
||||
|
||||
func (stmt *sqliteStmt) Exec(args []driver.Value) (driver.Result, error) {
|
||||
return stmt.ExecContext(context.Background(), db.ToNamedValues(args))
|
||||
}
|
||||
|
||||
func (stmt *sqliteStmt) ExecContext(ctx context.Context, args []driver.NamedValue) (res driver.Result, err error) {
|
||||
res, err = stmt.stmtIface.ExecContext(ctx, args)
|
||||
err = processSQLiteError(err)
|
||||
return
|
||||
}
|
||||
|
||||
func (stmt *sqliteStmt) Query(args []driver.Value) (driver.Rows, error) {
|
||||
return stmt.QueryContext(context.Background(), db.ToNamedValues(args))
|
||||
}
|
||||
|
||||
func (stmt *sqliteStmt) QueryContext(ctx context.Context, args []driver.NamedValue) (rows driver.Rows, err error) {
|
||||
rows, err = stmt.stmtIface.QueryContext(ctx, args)
|
||||
err = processSQLiteError(err)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &sqliteRows{rows.(rowsIface)}, nil
|
||||
}
|
||||
|
||||
func (stmt *sqliteStmt) Close() (err error) {
|
||||
err = stmt.stmtIface.Close()
|
||||
err = processSQLiteError(err)
|
||||
return
|
||||
}
|
||||
|
||||
type sqliteRows struct{ rowsIface }
|
||||
|
||||
func (r *sqliteRows) Next(dest []driver.Value) (err error) {
|
||||
err = r.rowsIface.Next(dest)
|
||||
err = processSQLiteError(err)
|
||||
return
|
||||
}
|
||||
|
||||
func (r *sqliteRows) Close() (err error) {
|
||||
err = r.rowsIface.Close()
|
||||
err = processSQLiteError(err)
|
||||
return
|
||||
}
|
||||
|
||||
// connIface is the driver.Conn interface
|
||||
// types (and the like) that go-sqlite3/driver.conn
|
||||
// conforms to. Useful so you don't need
|
||||
// to repeatedly perform checks yourself.
|
||||
type connIface interface {
|
||||
driver.Conn
|
||||
driver.ConnBeginTx
|
||||
driver.ConnPrepareContext
|
||||
driver.ExecerContext
|
||||
}
|
||||
|
||||
// StmtIface is the driver.Stmt interface
|
||||
// types (and the like) that go-sqlite3/driver.stmt
|
||||
// conforms to. Useful so you don't need
|
||||
// to repeatedly perform checks yourself.
|
||||
type stmtIface interface {
|
||||
driver.Stmt
|
||||
driver.StmtExecContext
|
||||
driver.StmtQueryContext
|
||||
}
|
||||
|
||||
// RowsIface is the driver.Rows interface
|
||||
// types (and the like) that go-sqlite3/driver.rows
|
||||
// conforms to. Useful so you don't need
|
||||
// to repeatedly perform checks yourself.
|
||||
type rowsIface interface {
|
||||
driver.Rows
|
||||
driver.RowsColumnTypeDatabaseTypeName
|
||||
}
|
52
internal/db/sqlite/errors.go
Normal file
52
internal/db/sqlite/errors.go
Normal file
|
@ -0,0 +1,52 @@
|
|||
// GoToSocial
|
||||
// Copyright (C) GoToSocial Authors admin@gotosocial.org
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
//go:build !wasmsqlite3
|
||||
|
||||
package sqlite
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"modernc.org/sqlite"
|
||||
sqlite3 "modernc.org/sqlite/lib"
|
||||
|
||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||
)
|
||||
|
||||
// processSQLiteError processes an sqlite3.Error to
|
||||
// handle conversion to any of our common db types.
|
||||
func processSQLiteError(err error) error {
|
||||
// Attempt to cast as sqlite error.
|
||||
sqliteErr, ok := err.(*sqlite.Error)
|
||||
if !ok {
|
||||
return err
|
||||
}
|
||||
|
||||
// Handle supplied error code:
|
||||
switch sqliteErr.Code() {
|
||||
case sqlite3.SQLITE_CONSTRAINT_UNIQUE,
|
||||
sqlite3.SQLITE_CONSTRAINT_PRIMARYKEY:
|
||||
return db.ErrAlreadyExists
|
||||
}
|
||||
|
||||
// Wrap the returned error with the code and
|
||||
// extended code for easier debugging later.
|
||||
return fmt.Errorf("%w (code=%d)", err,
|
||||
sqliteErr.Code(),
|
||||
)
|
||||
}
|
51
internal/db/sqlite/errors_wasmsqlite3.go
Normal file
51
internal/db/sqlite/errors_wasmsqlite3.go
Normal file
|
@ -0,0 +1,51 @@
|
|||
// GoToSocial
|
||||
// Copyright (C) GoToSocial Authors admin@gotosocial.org
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
//go:build wasmsqlite3
|
||||
|
||||
package sqlite
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/ncruces/go-sqlite3"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||
)
|
||||
|
||||
// processSQLiteError processes an sqlite3.Error to
|
||||
// handle conversion to any of our common db types.
|
||||
func processSQLiteError(err error) error {
|
||||
// Attempt to cast as sqlite error.
|
||||
sqliteErr, ok := err.(*sqlite3.Error)
|
||||
if !ok {
|
||||
return err
|
||||
}
|
||||
|
||||
// Handle supplied error code:
|
||||
switch sqliteErr.ExtendedCode() {
|
||||
case sqlite3.CONSTRAINT_UNIQUE,
|
||||
sqlite3.CONSTRAINT_PRIMARYKEY:
|
||||
return db.ErrAlreadyExists
|
||||
}
|
||||
|
||||
// Wrap the returned error with the code and
|
||||
// extended code for easier debugging later.
|
||||
return fmt.Errorf("%w (code=%d extended=%d)", err,
|
||||
sqliteErr.Code(),
|
||||
sqliteErr.ExtendedCode(),
|
||||
)
|
||||
}
|
|
@ -1,103 +0,0 @@
|
|||
// GoToSocial
|
||||
// Copyright (C) GoToSocial Authors admin@gotosocial.org
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package sqlite
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql/driver"
|
||||
|
||||
// linkname shenanigans
|
||||
_ "unsafe"
|
||||
|
||||
// the library being unsafely linked to
|
||||
_ "github.com/ncruces/go-sqlite3/driver"
|
||||
|
||||
// embed wasm sqlite binary
|
||||
_ "github.com/ncruces/go-sqlite3/embed"
|
||||
|
||||
"github.com/ncruces/go-sqlite3"
|
||||
)
|
||||
|
||||
// ConnIface is the driver.Conn interface
|
||||
// types (and the like) that go-sqlite3/driver.conn
|
||||
// conforms to. Useful so you don't need
|
||||
// to repeatedly perform checks yourself.
|
||||
type ConnIface interface {
|
||||
driver.Conn
|
||||
driver.ConnBeginTx
|
||||
driver.ConnPrepareContext
|
||||
driver.ExecerContext
|
||||
}
|
||||
|
||||
// StmtIface is the driver.Stmt interface
|
||||
// types (and the like) that go-sqlite3/driver.stmt
|
||||
// conforms to. Useful so you don't need
|
||||
// to repeatedly perform checks yourself.
|
||||
type StmtIface interface {
|
||||
driver.Stmt
|
||||
driver.StmtExecContext
|
||||
driver.StmtQueryContext
|
||||
}
|
||||
|
||||
// RowsIface is the driver.Rows interface
|
||||
// types (and the like) that go-sqlite3/driver.rows
|
||||
// conforms to. Useful so you don't need
|
||||
// to repeatedly perform checks yourself.
|
||||
type RowsIface interface {
|
||||
driver.Rows
|
||||
driver.RowsColumnTypeDatabaseTypeName
|
||||
}
|
||||
|
||||
type Driver struct {
|
||||
Init func(*sqlite3.Conn) error
|
||||
}
|
||||
|
||||
// Open: implements database/sql/driver.Driver.
|
||||
func (d Driver) Open(name string) (driver.Conn, error) {
|
||||
c, err := d.OpenConnector(name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return c.Connect(context.Background())
|
||||
}
|
||||
|
||||
// OpenConnector: implements database/sql/driver.DriverContext.
|
||||
func (d Driver) OpenConnector(name string) (driver.Connector, error) {
|
||||
return newConnector(name, d.Init)
|
||||
}
|
||||
|
||||
type connector struct {
|
||||
init func(*sqlite3.Conn) error
|
||||
name string
|
||||
txBegin string
|
||||
tmRead sqlite3.TimeFormat
|
||||
tmWrite sqlite3.TimeFormat
|
||||
pragmas bool
|
||||
}
|
||||
|
||||
func (c *connector) Driver() driver.Driver { return Driver{Init: c.init} }
|
||||
|
||||
func (c *connector) Connect(ctx context.Context) (driver.Conn, error) {
|
||||
return connect(c, ctx)
|
||||
}
|
||||
|
||||
//go:linkname newConnector github.com/ncruces/go-sqlite3/driver.newConnector
|
||||
func newConnector(name string, init func(*sqlite3.Conn) error) (*connector, error)
|
||||
|
||||
//go:linkname connect github.com/ncruces/go-sqlite3/driver.(*connector).Connect
|
||||
func connect(n *connector, ctx context.Context) (driver.Conn, error) //nolint
|
35
internal/db/util.go
Normal file
35
internal/db/util.go
Normal file
|
@ -0,0 +1,35 @@
|
|||
// GoToSocial
|
||||
// Copyright (C) GoToSocial Authors admin@gotosocial.org
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package db
|
||||
|
||||
import "database/sql/driver"
|
||||
|
||||
// ToNamedValues converts older driver.Value types to driver.NamedValue types.
|
||||
func ToNamedValues(args []driver.Value) []driver.NamedValue {
|
||||
if args == nil {
|
||||
return nil
|
||||
}
|
||||
args2 := make([]driver.NamedValue, len(args))
|
||||
for i := range args {
|
||||
args2[i] = driver.NamedValue{
|
||||
Ordinal: i + 1,
|
||||
Value: args[i],
|
||||
}
|
||||
}
|
||||
return args2
|
||||
}
|
23
vendor/github.com/hashicorp/golang-lru/v2/.gitignore
generated
vendored
Normal file
23
vendor/github.com/hashicorp/golang-lru/v2/.gitignore
generated
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
# Compiled Object files, Static and Dynamic libs (Shared Objects)
|
||||
*.o
|
||||
*.a
|
||||
*.so
|
||||
|
||||
# Folders
|
||||
_obj
|
||||
_test
|
||||
|
||||
# Architecture specific extensions/prefixes
|
||||
*.[568vq]
|
||||
[568vq].out
|
||||
|
||||
*.cgo1.go
|
||||
*.cgo2.c
|
||||
_cgo_defun.c
|
||||
_cgo_gotypes.go
|
||||
_cgo_export.*
|
||||
|
||||
_testmain.go
|
||||
|
||||
*.exe
|
||||
*.test
|
46
vendor/github.com/hashicorp/golang-lru/v2/.golangci.yml
generated
vendored
Normal file
46
vendor/github.com/hashicorp/golang-lru/v2/.golangci.yml
generated
vendored
Normal file
|
@ -0,0 +1,46 @@
|
|||
# Copyright (c) HashiCorp, Inc.
|
||||
# SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
linters:
|
||||
fast: false
|
||||
disable-all: true
|
||||
enable:
|
||||
- revive
|
||||
- megacheck
|
||||
- govet
|
||||
- unconvert
|
||||
- gas
|
||||
- gocyclo
|
||||
- dupl
|
||||
- misspell
|
||||
- unparam
|
||||
- unused
|
||||
- typecheck
|
||||
- ineffassign
|
||||
# - stylecheck
|
||||
- exportloopref
|
||||
- gocritic
|
||||
- nakedret
|
||||
- gosimple
|
||||
- prealloc
|
||||
|
||||
# golangci-lint configuration file
|
||||
linters-settings:
|
||||
revive:
|
||||
ignore-generated-header: true
|
||||
severity: warning
|
||||
rules:
|
||||
- name: package-comments
|
||||
severity: warning
|
||||
disabled: true
|
||||
- name: exported
|
||||
severity: warning
|
||||
disabled: false
|
||||
arguments: ["checkPrivateReceivers", "disableStutteringCheck"]
|
||||
|
||||
issues:
|
||||
exclude-use-default: false
|
||||
exclude-rules:
|
||||
- path: _test\.go
|
||||
linters:
|
||||
- dupl
|
267
vendor/github.com/hashicorp/golang-lru/v2/2q.go
generated
vendored
Normal file
267
vendor/github.com/hashicorp/golang-lru/v2/2q.go
generated
vendored
Normal file
|
@ -0,0 +1,267 @@
|
|||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
package lru
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"sync"
|
||||
|
||||
"github.com/hashicorp/golang-lru/v2/simplelru"
|
||||
)
|
||||
|
||||
const (
|
||||
// Default2QRecentRatio is the ratio of the 2Q cache dedicated
|
||||
// to recently added entries that have only been accessed once.
|
||||
Default2QRecentRatio = 0.25
|
||||
|
||||
// Default2QGhostEntries is the default ratio of ghost
|
||||
// entries kept to track entries recently evicted
|
||||
Default2QGhostEntries = 0.50
|
||||
)
|
||||
|
||||
// TwoQueueCache is a thread-safe fixed size 2Q cache.
|
||||
// 2Q is an enhancement over the standard LRU cache
|
||||
// in that it tracks both frequently and recently used
|
||||
// entries separately. This avoids a burst in access to new
|
||||
// entries from evicting frequently used entries. It adds some
|
||||
// additional tracking overhead to the standard LRU cache, and is
|
||||
// computationally about 2x the cost, and adds some metadata over
|
||||
// head. The ARCCache is similar, but does not require setting any
|
||||
// parameters.
|
||||
type TwoQueueCache[K comparable, V any] struct {
|
||||
size int
|
||||
recentSize int
|
||||
recentRatio float64
|
||||
ghostRatio float64
|
||||
|
||||
recent simplelru.LRUCache[K, V]
|
||||
frequent simplelru.LRUCache[K, V]
|
||||
recentEvict simplelru.LRUCache[K, struct{}]
|
||||
lock sync.RWMutex
|
||||
}
|
||||
|
||||
// New2Q creates a new TwoQueueCache using the default
|
||||
// values for the parameters.
|
||||
func New2Q[K comparable, V any](size int) (*TwoQueueCache[K, V], error) {
|
||||
return New2QParams[K, V](size, Default2QRecentRatio, Default2QGhostEntries)
|
||||
}
|
||||
|
||||
// New2QParams creates a new TwoQueueCache using the provided
|
||||
// parameter values.
|
||||
func New2QParams[K comparable, V any](size int, recentRatio, ghostRatio float64) (*TwoQueueCache[K, V], error) {
|
||||
if size <= 0 {
|
||||
return nil, errors.New("invalid size")
|
||||
}
|
||||
if recentRatio < 0.0 || recentRatio > 1.0 {
|
||||
return nil, errors.New("invalid recent ratio")
|
||||
}
|
||||
if ghostRatio < 0.0 || ghostRatio > 1.0 {
|
||||
return nil, errors.New("invalid ghost ratio")
|
||||
}
|
||||
|
||||
// Determine the sub-sizes
|
||||
recentSize := int(float64(size) * recentRatio)
|
||||
evictSize := int(float64(size) * ghostRatio)
|
||||
|
||||
// Allocate the LRUs
|
||||
recent, err := simplelru.NewLRU[K, V](size, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
frequent, err := simplelru.NewLRU[K, V](size, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
recentEvict, err := simplelru.NewLRU[K, struct{}](evictSize, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Initialize the cache
|
||||
c := &TwoQueueCache[K, V]{
|
||||
size: size,
|
||||
recentSize: recentSize,
|
||||
recentRatio: recentRatio,
|
||||
ghostRatio: ghostRatio,
|
||||
recent: recent,
|
||||
frequent: frequent,
|
||||
recentEvict: recentEvict,
|
||||
}
|
||||
return c, nil
|
||||
}
|
||||
|
||||
// Get looks up a key's value from the cache.
|
||||
func (c *TwoQueueCache[K, V]) Get(key K) (value V, ok bool) {
|
||||
c.lock.Lock()
|
||||
defer c.lock.Unlock()
|
||||
|
||||
// Check if this is a frequent value
|
||||
if val, ok := c.frequent.Get(key); ok {
|
||||
return val, ok
|
||||
}
|
||||
|
||||
// If the value is contained in recent, then we
|
||||
// promote it to frequent
|
||||
if val, ok := c.recent.Peek(key); ok {
|
||||
c.recent.Remove(key)
|
||||
c.frequent.Add(key, val)
|
||||
return val, ok
|
||||
}
|
||||
|
||||
// No hit
|
||||
return
|
||||
}
|
||||
|
||||
// Add adds a value to the cache.
|
||||
func (c *TwoQueueCache[K, V]) Add(key K, value V) {
|
||||
c.lock.Lock()
|
||||
defer c.lock.Unlock()
|
||||
|
||||
// Check if the value is frequently used already,
|
||||
// and just update the value
|
||||
if c.frequent.Contains(key) {
|
||||
c.frequent.Add(key, value)
|
||||
return
|
||||
}
|
||||
|
||||
// Check if the value is recently used, and promote
|
||||
// the value into the frequent list
|
||||
if c.recent.Contains(key) {
|
||||
c.recent.Remove(key)
|
||||
c.frequent.Add(key, value)
|
||||
return
|
||||
}
|
||||
|
||||
// If the value was recently evicted, add it to the
|
||||
// frequently used list
|
||||
if c.recentEvict.Contains(key) {
|
||||
c.ensureSpace(true)
|
||||
c.recentEvict.Remove(key)
|
||||
c.frequent.Add(key, value)
|
||||
return
|
||||
}
|
||||
|
||||
// Add to the recently seen list
|
||||
c.ensureSpace(false)
|
||||
c.recent.Add(key, value)
|
||||
}
|
||||
|
||||
// ensureSpace is used to ensure we have space in the cache
|
||||
func (c *TwoQueueCache[K, V]) ensureSpace(recentEvict bool) {
|
||||
// If we have space, nothing to do
|
||||
recentLen := c.recent.Len()
|
||||
freqLen := c.frequent.Len()
|
||||
if recentLen+freqLen < c.size {
|
||||
return
|
||||
}
|
||||
|
||||
// If the recent buffer is larger than
|
||||
// the target, evict from there
|
||||
if recentLen > 0 && (recentLen > c.recentSize || (recentLen == c.recentSize && !recentEvict)) {
|
||||
k, _, _ := c.recent.RemoveOldest()
|
||||
c.recentEvict.Add(k, struct{}{})
|
||||
return
|
||||
}
|
||||
|
||||
// Remove from the frequent list otherwise
|
||||
c.frequent.RemoveOldest()
|
||||
}
|
||||
|
||||
// Len returns the number of items in the cache.
|
||||
func (c *TwoQueueCache[K, V]) Len() int {
|
||||
c.lock.RLock()
|
||||
defer c.lock.RUnlock()
|
||||
return c.recent.Len() + c.frequent.Len()
|
||||
}
|
||||
|
||||
// Resize changes the cache size.
|
||||
func (c *TwoQueueCache[K, V]) Resize(size int) (evicted int) {
|
||||
c.lock.Lock()
|
||||
defer c.lock.Unlock()
|
||||
|
||||
// Recalculate the sub-sizes
|
||||
recentSize := int(float64(size) * c.recentRatio)
|
||||
evictSize := int(float64(size) * c.ghostRatio)
|
||||
c.size = size
|
||||
c.recentSize = recentSize
|
||||
|
||||
// ensureSpace
|
||||
diff := c.recent.Len() + c.frequent.Len() - size
|
||||
if diff < 0 {
|
||||
diff = 0
|
||||
}
|
||||
for i := 0; i < diff; i++ {
|
||||
c.ensureSpace(true)
|
||||
}
|
||||
|
||||
// Reallocate the LRUs
|
||||
c.recent.Resize(size)
|
||||
c.frequent.Resize(size)
|
||||
c.recentEvict.Resize(evictSize)
|
||||
|
||||
return diff
|
||||
}
|
||||
|
||||
// Keys returns a slice of the keys in the cache.
|
||||
// The frequently used keys are first in the returned slice.
|
||||
func (c *TwoQueueCache[K, V]) Keys() []K {
|
||||
c.lock.RLock()
|
||||
defer c.lock.RUnlock()
|
||||
k1 := c.frequent.Keys()
|
||||
k2 := c.recent.Keys()
|
||||
return append(k1, k2...)
|
||||
}
|
||||
|
||||
// Values returns a slice of the values in the cache.
|
||||
// The frequently used values are first in the returned slice.
|
||||
func (c *TwoQueueCache[K, V]) Values() []V {
|
||||
c.lock.RLock()
|
||||
defer c.lock.RUnlock()
|
||||
v1 := c.frequent.Values()
|
||||
v2 := c.recent.Values()
|
||||
return append(v1, v2...)
|
||||
}
|
||||
|
||||
// Remove removes the provided key from the cache.
|
||||
func (c *TwoQueueCache[K, V]) Remove(key K) {
|
||||
c.lock.Lock()
|
||||
defer c.lock.Unlock()
|
||||
if c.frequent.Remove(key) {
|
||||
return
|
||||
}
|
||||
if c.recent.Remove(key) {
|
||||
return
|
||||
}
|
||||
if c.recentEvict.Remove(key) {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// Purge is used to completely clear the cache.
|
||||
func (c *TwoQueueCache[K, V]) Purge() {
|
||||
c.lock.Lock()
|
||||
defer c.lock.Unlock()
|
||||
c.recent.Purge()
|
||||
c.frequent.Purge()
|
||||
c.recentEvict.Purge()
|
||||
}
|
||||
|
||||
// Contains is used to check if the cache contains a key
|
||||
// without updating recency or frequency.
|
||||
func (c *TwoQueueCache[K, V]) Contains(key K) bool {
|
||||
c.lock.RLock()
|
||||
defer c.lock.RUnlock()
|
||||
return c.frequent.Contains(key) || c.recent.Contains(key)
|
||||
}
|
||||
|
||||
// Peek is used to inspect the cache value of a key
|
||||
// without updating recency or frequency.
|
||||
func (c *TwoQueueCache[K, V]) Peek(key K) (value V, ok bool) {
|
||||
c.lock.RLock()
|
||||
defer c.lock.RUnlock()
|
||||
if val, ok := c.frequent.Peek(key); ok {
|
||||
return val, ok
|
||||
}
|
||||
return c.recent.Peek(key)
|
||||
}
|
364
vendor/github.com/hashicorp/golang-lru/v2/LICENSE
generated
vendored
Normal file
364
vendor/github.com/hashicorp/golang-lru/v2/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,364 @@
|
|||
Copyright (c) 2014 HashiCorp, Inc.
|
||||
|
||||
Mozilla Public License, version 2.0
|
||||
|
||||
1. Definitions
|
||||
|
||||
1.1. "Contributor"
|
||||
|
||||
means each individual or legal entity that creates, contributes to the
|
||||
creation of, or owns Covered Software.
|
||||
|
||||
1.2. "Contributor Version"
|
||||
|
||||
means the combination of the Contributions of others (if any) used by a
|
||||
Contributor and that particular Contributor's Contribution.
|
||||
|
||||
1.3. "Contribution"
|
||||
|
||||
means Covered Software of a particular Contributor.
|
||||
|
||||
1.4. "Covered Software"
|
||||
|
||||
means Source Code Form to which the initial Contributor has attached the
|
||||
notice in Exhibit A, the Executable Form of such Source Code Form, and
|
||||
Modifications of such Source Code Form, in each case including portions
|
||||
thereof.
|
||||
|
||||
1.5. "Incompatible With Secondary Licenses"
|
||||
means
|
||||
|
||||
a. that the initial Contributor has attached the notice described in
|
||||
Exhibit B to the Covered Software; or
|
||||
|
||||
b. that the Covered Software was made available under the terms of
|
||||
version 1.1 or earlier of the License, but not also under the terms of
|
||||
a Secondary License.
|
||||
|
||||
1.6. "Executable Form"
|
||||
|
||||
means any form of the work other than Source Code Form.
|
||||
|
||||
1.7. "Larger Work"
|
||||
|
||||
means a work that combines Covered Software with other material, in a
|
||||
separate file or files, that is not Covered Software.
|
||||
|
||||
1.8. "License"
|
||||
|
||||
means this document.
|
||||
|
||||
1.9. "Licensable"
|
||||
|
||||
means having the right to grant, to the maximum extent possible, whether
|
||||
at the time of the initial grant or subsequently, any and all of the
|
||||
rights conveyed by this License.
|
||||
|
||||
1.10. "Modifications"
|
||||
|
||||
means any of the following:
|
||||
|
||||
a. any file in Source Code Form that results from an addition to,
|
||||
deletion from, or modification of the contents of Covered Software; or
|
||||
|
||||
b. any new file in Source Code Form that contains any Covered Software.
|
||||
|
||||
1.11. "Patent Claims" of a Contributor
|
||||
|
||||
means any patent claim(s), including without limitation, method,
|
||||
process, and apparatus claims, in any patent Licensable by such
|
||||
Contributor that would be infringed, but for the grant of the License,
|
||||
by the making, using, selling, offering for sale, having made, import,
|
||||
or transfer of either its Contributions or its Contributor Version.
|
||||
|
||||
1.12. "Secondary License"
|
||||
|
||||
means either the GNU General Public License, Version 2.0, the GNU Lesser
|
||||
General Public License, Version 2.1, the GNU Affero General Public
|
||||
License, Version 3.0, or any later versions of those licenses.
|
||||
|
||||
1.13. "Source Code Form"
|
||||
|
||||
means the form of the work preferred for making modifications.
|
||||
|
||||
1.14. "You" (or "Your")
|
||||
|
||||
means an individual or a legal entity exercising rights under this
|
||||
License. For legal entities, "You" includes any entity that controls, is
|
||||
controlled by, or is under common control with You. For purposes of this
|
||||
definition, "control" means (a) the power, direct or indirect, to cause
|
||||
the direction or management of such entity, whether by contract or
|
||||
otherwise, or (b) ownership of more than fifty percent (50%) of the
|
||||
outstanding shares or beneficial ownership of such entity.
|
||||
|
||||
|
||||
2. License Grants and Conditions
|
||||
|
||||
2.1. Grants
|
||||
|
||||
Each Contributor hereby grants You a world-wide, royalty-free,
|
||||
non-exclusive license:
|
||||
|
||||
a. under intellectual property rights (other than patent or trademark)
|
||||
Licensable by such Contributor to use, reproduce, make available,
|
||||
modify, display, perform, distribute, and otherwise exploit its
|
||||
Contributions, either on an unmodified basis, with Modifications, or
|
||||
as part of a Larger Work; and
|
||||
|
||||
b. under Patent Claims of such Contributor to make, use, sell, offer for
|
||||
sale, have made, import, and otherwise transfer either its
|
||||
Contributions or its Contributor Version.
|
||||
|
||||
2.2. Effective Date
|
||||
|
||||
The licenses granted in Section 2.1 with respect to any Contribution
|
||||
become effective for each Contribution on the date the Contributor first
|
||||
distributes such Contribution.
|
||||
|
||||
2.3. Limitations on Grant Scope
|
||||
|
||||
The licenses granted in this Section 2 are the only rights granted under
|
||||
this License. No additional rights or licenses will be implied from the
|
||||
distribution or licensing of Covered Software under this License.
|
||||
Notwithstanding Section 2.1(b) above, no patent license is granted by a
|
||||
Contributor:
|
||||
|
||||
a. for any code that a Contributor has removed from Covered Software; or
|
||||
|
||||
b. for infringements caused by: (i) Your and any other third party's
|
||||
modifications of Covered Software, or (ii) the combination of its
|
||||
Contributions with other software (except as part of its Contributor
|
||||
Version); or
|
||||
|
||||
c. under Patent Claims infringed by Covered Software in the absence of
|
||||
its Contributions.
|
||||
|
||||
This License does not grant any rights in the trademarks, service marks,
|
||||
or logos of any Contributor (except as may be necessary to comply with
|
||||
the notice requirements in Section 3.4).
|
||||
|
||||
2.4. Subsequent Licenses
|
||||
|
||||
No Contributor makes additional grants as a result of Your choice to
|
||||
distribute the Covered Software under a subsequent version of this
|
||||
License (see Section 10.2) or under the terms of a Secondary License (if
|
||||
permitted under the terms of Section 3.3).
|
||||
|
||||
2.5. Representation
|
||||
|
||||
Each Contributor represents that the Contributor believes its
|
||||
Contributions are its original creation(s) or it has sufficient rights to
|
||||
grant the rights to its Contributions conveyed by this License.
|
||||
|
||||
2.6. Fair Use
|
||||
|
||||
This License is not intended to limit any rights You have under
|
||||
applicable copyright doctrines of fair use, fair dealing, or other
|
||||
equivalents.
|
||||
|
||||
2.7. Conditions
|
||||
|
||||
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in
|
||||
Section 2.1.
|
||||
|
||||
|
||||
3. Responsibilities
|
||||
|
||||
3.1. Distribution of Source Form
|
||||
|
||||
All distribution of Covered Software in Source Code Form, including any
|
||||
Modifications that You create or to which You contribute, must be under
|
||||
the terms of this License. You must inform recipients that the Source
|
||||
Code Form of the Covered Software is governed by the terms of this
|
||||
License, and how they can obtain a copy of this License. You may not
|
||||
attempt to alter or restrict the recipients' rights in the Source Code
|
||||
Form.
|
||||
|
||||
3.2. Distribution of Executable Form
|
||||
|
||||
If You distribute Covered Software in Executable Form then:
|
||||
|
||||
a. such Covered Software must also be made available in Source Code Form,
|
||||
as described in Section 3.1, and You must inform recipients of the
|
||||
Executable Form how they can obtain a copy of such Source Code Form by
|
||||
reasonable means in a timely manner, at a charge no more than the cost
|
||||
of distribution to the recipient; and
|
||||
|
||||
b. You may distribute such Executable Form under the terms of this
|
||||
License, or sublicense it under different terms, provided that the
|
||||
license for the Executable Form does not attempt to limit or alter the
|
||||
recipients' rights in the Source Code Form under this License.
|
||||
|
||||
3.3. Distribution of a Larger Work
|
||||
|
||||
You may create and distribute a Larger Work under terms of Your choice,
|
||||
provided that You also comply with the requirements of this License for
|
||||
the Covered Software. If the Larger Work is a combination of Covered
|
||||
Software with a work governed by one or more Secondary Licenses, and the
|
||||
Covered Software is not Incompatible With Secondary Licenses, this
|
||||
License permits You to additionally distribute such Covered Software
|
||||
under the terms of such Secondary License(s), so that the recipient of
|
||||
the Larger Work may, at their option, further distribute the Covered
|
||||
Software under the terms of either this License or such Secondary
|
||||
License(s).
|
||||
|
||||
3.4. Notices
|
||||
|
||||
You may not remove or alter the substance of any license notices
|
||||
(including copyright notices, patent notices, disclaimers of warranty, or
|
||||
limitations of liability) contained within the Source Code Form of the
|
||||
Covered Software, except that You may alter any license notices to the
|
||||
extent required to remedy known factual inaccuracies.
|
||||
|
||||
3.5. Application of Additional Terms
|
||||
|
||||
You may choose to offer, and to charge a fee for, warranty, support,
|
||||
indemnity or liability obligations to one or more recipients of Covered
|
||||
Software. However, You may do so only on Your own behalf, and not on
|
||||
behalf of any Contributor. You must make it absolutely clear that any
|
||||
such warranty, support, indemnity, or liability obligation is offered by
|
||||
You alone, and You hereby agree to indemnify every Contributor for any
|
||||
liability incurred by such Contributor as a result of warranty, support,
|
||||
indemnity or liability terms You offer. You may include additional
|
||||
disclaimers of warranty and limitations of liability specific to any
|
||||
jurisdiction.
|
||||
|
||||
4. Inability to Comply Due to Statute or Regulation
|
||||
|
||||
If it is impossible for You to comply with any of the terms of this License
|
||||
with respect to some or all of the Covered Software due to statute,
|
||||
judicial order, or regulation then You must: (a) comply with the terms of
|
||||
this License to the maximum extent possible; and (b) describe the
|
||||
limitations and the code they affect. Such description must be placed in a
|
||||
text file included with all distributions of the Covered Software under
|
||||
this License. Except to the extent prohibited by statute or regulation,
|
||||
such description must be sufficiently detailed for a recipient of ordinary
|
||||
skill to be able to understand it.
|
||||
|
||||
5. Termination
|
||||
|
||||
5.1. The rights granted under this License will terminate automatically if You
|
||||
fail to comply with any of its terms. However, if You become compliant,
|
||||
then the rights granted under this License from a particular Contributor
|
||||
are reinstated (a) provisionally, unless and until such Contributor
|
||||
explicitly and finally terminates Your grants, and (b) on an ongoing
|
||||
basis, if such Contributor fails to notify You of the non-compliance by
|
||||
some reasonable means prior to 60 days after You have come back into
|
||||
compliance. Moreover, Your grants from a particular Contributor are
|
||||
reinstated on an ongoing basis if such Contributor notifies You of the
|
||||
non-compliance by some reasonable means, this is the first time You have
|
||||
received notice of non-compliance with this License from such
|
||||
Contributor, and You become compliant prior to 30 days after Your receipt
|
||||
of the notice.
|
||||
|
||||
5.2. If You initiate litigation against any entity by asserting a patent
|
||||
infringement claim (excluding declaratory judgment actions,
|
||||
counter-claims, and cross-claims) alleging that a Contributor Version
|
||||
directly or indirectly infringes any patent, then the rights granted to
|
||||
You by any and all Contributors for the Covered Software under Section
|
||||
2.1 of this License shall terminate.
|
||||
|
||||
5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user
|
||||
license agreements (excluding distributors and resellers) which have been
|
||||
validly granted by You or Your distributors under this License prior to
|
||||
termination shall survive termination.
|
||||
|
||||
6. Disclaimer of Warranty
|
||||
|
||||
Covered Software is provided under this License on an "as is" basis,
|
||||
without warranty of any kind, either expressed, implied, or statutory,
|
||||
including, without limitation, warranties that the Covered Software is free
|
||||
of defects, merchantable, fit for a particular purpose or non-infringing.
|
||||
The entire risk as to the quality and performance of the Covered Software
|
||||
is with You. Should any Covered Software prove defective in any respect,
|
||||
You (not any Contributor) assume the cost of any necessary servicing,
|
||||
repair, or correction. This disclaimer of warranty constitutes an essential
|
||||
part of this License. No use of any Covered Software is authorized under
|
||||
this License except under this disclaimer.
|
||||
|
||||
7. Limitation of Liability
|
||||
|
||||
Under no circumstances and under no legal theory, whether tort (including
|
||||
negligence), contract, or otherwise, shall any Contributor, or anyone who
|
||||
distributes Covered Software as permitted above, be liable to You for any
|
||||
direct, indirect, special, incidental, or consequential damages of any
|
||||
character including, without limitation, damages for lost profits, loss of
|
||||
goodwill, work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses, even if such party shall have been
|
||||
informed of the possibility of such damages. This limitation of liability
|
||||
shall not apply to liability for death or personal injury resulting from
|
||||
such party's negligence to the extent applicable law prohibits such
|
||||
limitation. Some jurisdictions do not allow the exclusion or limitation of
|
||||
incidental or consequential damages, so this exclusion and limitation may
|
||||
not apply to You.
|
||||
|
||||
8. Litigation
|
||||
|
||||
Any litigation relating to this License may be brought only in the courts
|
||||
of a jurisdiction where the defendant maintains its principal place of
|
||||
business and such litigation shall be governed by laws of that
|
||||
jurisdiction, without reference to its conflict-of-law provisions. Nothing
|
||||
in this Section shall prevent a party's ability to bring cross-claims or
|
||||
counter-claims.
|
||||
|
||||
9. Miscellaneous
|
||||
|
||||
This License represents the complete agreement concerning the subject
|
||||
matter hereof. If any provision of this License is held to be
|
||||
unenforceable, such provision shall be reformed only to the extent
|
||||
necessary to make it enforceable. Any law or regulation which provides that
|
||||
the language of a contract shall be construed against the drafter shall not
|
||||
be used to construe this License against a Contributor.
|
||||
|
||||
|
||||
10. Versions of the License
|
||||
|
||||
10.1. New Versions
|
||||
|
||||
Mozilla Foundation is the license steward. Except as provided in Section
|
||||
10.3, no one other than the license steward has the right to modify or
|
||||
publish new versions of this License. Each version will be given a
|
||||
distinguishing version number.
|
||||
|
||||
10.2. Effect of New Versions
|
||||
|
||||
You may distribute the Covered Software under the terms of the version
|
||||
of the License under which You originally received the Covered Software,
|
||||
or under the terms of any subsequent version published by the license
|
||||
steward.
|
||||
|
||||
10.3. Modified Versions
|
||||
|
||||
If you create software not governed by this License, and you want to
|
||||
create a new license for such software, you may create and use a
|
||||
modified version of this License if you rename the license and remove
|
||||
any references to the name of the license steward (except to note that
|
||||
such modified license differs from this License).
|
||||
|
||||
10.4. Distributing Source Code Form that is Incompatible With Secondary
|
||||
Licenses If You choose to distribute Source Code Form that is
|
||||
Incompatible With Secondary Licenses under the terms of this version of
|
||||
the License, the notice described in Exhibit B of this License must be
|
||||
attached.
|
||||
|
||||
Exhibit A - Source Code Form License Notice
|
||||
|
||||
This Source Code Form is subject to the
|
||||
terms of the Mozilla Public License, v.
|
||||
2.0. If a copy of the MPL was not
|
||||
distributed with this file, You can
|
||||
obtain one at
|
||||
http://mozilla.org/MPL/2.0/.
|
||||
|
||||
If it is not possible or desirable to put the notice in a particular file,
|
||||
then You may include the notice in a location (such as a LICENSE file in a
|
||||
relevant directory) where a recipient would be likely to look for such a
|
||||
notice.
|
||||
|
||||
You may add additional accurate notices of copyright ownership.
|
||||
|
||||
Exhibit B - "Incompatible With Secondary Licenses" Notice
|
||||
|
||||
This Source Code Form is "Incompatible
|
||||
With Secondary Licenses", as defined by
|
||||
the Mozilla Public License, v. 2.0.
|
79
vendor/github.com/hashicorp/golang-lru/v2/README.md
generated
vendored
Normal file
79
vendor/github.com/hashicorp/golang-lru/v2/README.md
generated
vendored
Normal file
|
@ -0,0 +1,79 @@
|
|||
golang-lru
|
||||
==========
|
||||
|
||||
This provides the `lru` package which implements a fixed-size
|
||||
thread safe LRU cache. It is based on the cache in Groupcache.
|
||||
|
||||
Documentation
|
||||
=============
|
||||
|
||||
Full docs are available on [Go Packages](https://pkg.go.dev/github.com/hashicorp/golang-lru/v2)
|
||||
|
||||
LRU cache example
|
||||
=================
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/hashicorp/golang-lru/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
l, _ := lru.New[int, any](128)
|
||||
for i := 0; i < 256; i++ {
|
||||
l.Add(i, nil)
|
||||
}
|
||||
if l.Len() != 128 {
|
||||
panic(fmt.Sprintf("bad len: %v", l.Len()))
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Expirable LRU cache example
|
||||
===========================
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/hashicorp/golang-lru/v2/expirable"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// make cache with 10ms TTL and 5 max keys
|
||||
cache := expirable.NewLRU[string, string](5, nil, time.Millisecond*10)
|
||||
|
||||
|
||||
// set value under key1.
|
||||
cache.Add("key1", "val1")
|
||||
|
||||
// get value under key1
|
||||
r, ok := cache.Get("key1")
|
||||
|
||||
// check for OK value
|
||||
if ok {
|
||||
fmt.Printf("value before expiration is found: %v, value: %q\n", ok, r)
|
||||
}
|
||||
|
||||
// wait for cache to expire
|
||||
time.Sleep(time.Millisecond * 12)
|
||||
|
||||
// get value under key1 after key expiration
|
||||
r, ok = cache.Get("key1")
|
||||
fmt.Printf("value after expiration is found: %v, value: %q\n", ok, r)
|
||||
|
||||
// set value under key2, would evict old entry because it is already expired.
|
||||
cache.Add("key2", "val2")
|
||||
|
||||
fmt.Printf("Cache len: %d\n", cache.Len())
|
||||
// Output:
|
||||
// value before expiration is found: true, value: "val1"
|
||||
// value after expiration is found: false, value: ""
|
||||
// Cache len: 1
|
||||
}
|
||||
```
|
24
vendor/github.com/hashicorp/golang-lru/v2/doc.go
generated
vendored
Normal file
24
vendor/github.com/hashicorp/golang-lru/v2/doc.go
generated
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
// Package lru provides three different LRU caches of varying sophistication.
|
||||
//
|
||||
// Cache is a simple LRU cache. It is based on the LRU implementation in
|
||||
// groupcache: https://github.com/golang/groupcache/tree/master/lru
|
||||
//
|
||||
// TwoQueueCache tracks frequently used and recently used entries separately.
|
||||
// This avoids a burst of accesses from taking out frequently used entries, at
|
||||
// the cost of about 2x computational overhead and some extra bookkeeping.
|
||||
//
|
||||
// ARCCache is an adaptive replacement cache. It tracks recent evictions as well
|
||||
// as recent usage in both the frequent and recent caches. Its computational
|
||||
// overhead is comparable to TwoQueueCache, but the memory overhead is linear
|
||||
// with the size of the cache.
|
||||
//
|
||||
// ARC has been patented by IBM, so do not use it if that is problematic for
|
||||
// your program. For this reason, it is in a separate go module contained within
|
||||
// this repository.
|
||||
//
|
||||
// All caches in this package take locks while operating, and are therefore
|
||||
// thread-safe for consumers.
|
||||
package lru
|
142
vendor/github.com/hashicorp/golang-lru/v2/internal/list.go
generated
vendored
Normal file
142
vendor/github.com/hashicorp/golang-lru/v2/internal/list.go
generated
vendored
Normal file
|
@ -0,0 +1,142 @@
|
|||
// Copyright 2009 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE_list file.
|
||||
|
||||
package internal
|
||||
|
||||
import "time"
|
||||
|
||||
// Entry is an LRU Entry
|
||||
type Entry[K comparable, V any] struct {
|
||||
// Next and previous pointers in the doubly-linked list of elements.
|
||||
// To simplify the implementation, internally a list l is implemented
|
||||
// as a ring, such that &l.root is both the next element of the last
|
||||
// list element (l.Back()) and the previous element of the first list
|
||||
// element (l.Front()).
|
||||
next, prev *Entry[K, V]
|
||||
|
||||
// The list to which this element belongs.
|
||||
list *LruList[K, V]
|
||||
|
||||
// The LRU Key of this element.
|
||||
Key K
|
||||
|
||||
// The Value stored with this element.
|
||||
Value V
|
||||
|
||||
// The time this element would be cleaned up, optional
|
||||
ExpiresAt time.Time
|
||||
|
||||
// The expiry bucket item was put in, optional
|
||||
ExpireBucket uint8
|
||||
}
|
||||
|
||||
// PrevEntry returns the previous list element or nil.
|
||||
func (e *Entry[K, V]) PrevEntry() *Entry[K, V] {
|
||||
if p := e.prev; e.list != nil && p != &e.list.root {
|
||||
return p
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// LruList represents a doubly linked list.
|
||||
// The zero Value for LruList is an empty list ready to use.
|
||||
type LruList[K comparable, V any] struct {
|
||||
root Entry[K, V] // sentinel list element, only &root, root.prev, and root.next are used
|
||||
len int // current list Length excluding (this) sentinel element
|
||||
}
|
||||
|
||||
// Init initializes or clears list l.
|
||||
func (l *LruList[K, V]) Init() *LruList[K, V] {
|
||||
l.root.next = &l.root
|
||||
l.root.prev = &l.root
|
||||
l.len = 0
|
||||
return l
|
||||
}
|
||||
|
||||
// NewList returns an initialized list.
|
||||
func NewList[K comparable, V any]() *LruList[K, V] { return new(LruList[K, V]).Init() }
|
||||
|
||||
// Length returns the number of elements of list l.
|
||||
// The complexity is O(1).
|
||||
func (l *LruList[K, V]) Length() int { return l.len }
|
||||
|
||||
// Back returns the last element of list l or nil if the list is empty.
|
||||
func (l *LruList[K, V]) Back() *Entry[K, V] {
|
||||
if l.len == 0 {
|
||||
return nil
|
||||
}
|
||||
return l.root.prev
|
||||
}
|
||||
|
||||
// lazyInit lazily initializes a zero List Value.
|
||||
func (l *LruList[K, V]) lazyInit() {
|
||||
if l.root.next == nil {
|
||||
l.Init()
|
||||
}
|
||||
}
|
||||
|
||||
// insert inserts e after at, increments l.len, and returns e.
|
||||
func (l *LruList[K, V]) insert(e, at *Entry[K, V]) *Entry[K, V] {
|
||||
e.prev = at
|
||||
e.next = at.next
|
||||
e.prev.next = e
|
||||
e.next.prev = e
|
||||
e.list = l
|
||||
l.len++
|
||||
return e
|
||||
}
|
||||
|
||||
// insertValue is a convenience wrapper for insert(&Entry{Value: v, ExpiresAt: ExpiresAt}, at).
|
||||
func (l *LruList[K, V]) insertValue(k K, v V, expiresAt time.Time, at *Entry[K, V]) *Entry[K, V] {
|
||||
return l.insert(&Entry[K, V]{Value: v, Key: k, ExpiresAt: expiresAt}, at)
|
||||
}
|
||||
|
||||
// Remove removes e from its list, decrements l.len
|
||||
func (l *LruList[K, V]) Remove(e *Entry[K, V]) V {
|
||||
e.prev.next = e.next
|
||||
e.next.prev = e.prev
|
||||
e.next = nil // avoid memory leaks
|
||||
e.prev = nil // avoid memory leaks
|
||||
e.list = nil
|
||||
l.len--
|
||||
|
||||
return e.Value
|
||||
}
|
||||
|
||||
// move moves e to next to at.
|
||||
func (l *LruList[K, V]) move(e, at *Entry[K, V]) {
|
||||
if e == at {
|
||||
return
|
||||
}
|
||||
e.prev.next = e.next
|
||||
e.next.prev = e.prev
|
||||
|
||||
e.prev = at
|
||||
e.next = at.next
|
||||
e.prev.next = e
|
||||
e.next.prev = e
|
||||
}
|
||||
|
||||
// PushFront inserts a new element e with value v at the front of list l and returns e.
|
||||
func (l *LruList[K, V]) PushFront(k K, v V) *Entry[K, V] {
|
||||
l.lazyInit()
|
||||
return l.insertValue(k, v, time.Time{}, &l.root)
|
||||
}
|
||||
|
||||
// PushFrontExpirable inserts a new expirable element e with Value v at the front of list l and returns e.
|
||||
func (l *LruList[K, V]) PushFrontExpirable(k K, v V, expiresAt time.Time) *Entry[K, V] {
|
||||
l.lazyInit()
|
||||
return l.insertValue(k, v, expiresAt, &l.root)
|
||||
}
|
||||
|
||||
// MoveToFront moves element e to the front of list l.
|
||||
// If e is not an element of l, the list is not modified.
|
||||
// The element must not be nil.
|
||||
func (l *LruList[K, V]) MoveToFront(e *Entry[K, V]) {
|
||||
if e.list != l || l.root.next == e {
|
||||
return
|
||||
}
|
||||
// see comment in List.Remove about initialization of l
|
||||
l.move(e, &l.root)
|
||||
}
|
250
vendor/github.com/hashicorp/golang-lru/v2/lru.go
generated
vendored
Normal file
250
vendor/github.com/hashicorp/golang-lru/v2/lru.go
generated
vendored
Normal file
|
@ -0,0 +1,250 @@
|
|||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
package lru
|
||||
|
||||
import (
|
||||
"sync"
|
||||
|
||||
"github.com/hashicorp/golang-lru/v2/simplelru"
|
||||
)
|
||||
|
||||
const (
|
||||
// DefaultEvictedBufferSize defines the default buffer size to store evicted key/val
|
||||
DefaultEvictedBufferSize = 16
|
||||
)
|
||||
|
||||
// Cache is a thread-safe fixed size LRU cache.
|
||||
type Cache[K comparable, V any] struct {
|
||||
lru *simplelru.LRU[K, V]
|
||||
evictedKeys []K
|
||||
evictedVals []V
|
||||
onEvictedCB func(k K, v V)
|
||||
lock sync.RWMutex
|
||||
}
|
||||
|
||||
// New creates an LRU of the given size.
|
||||
func New[K comparable, V any](size int) (*Cache[K, V], error) {
|
||||
return NewWithEvict[K, V](size, nil)
|
||||
}
|
||||
|
||||
// NewWithEvict constructs a fixed size cache with the given eviction
|
||||
// callback.
|
||||
func NewWithEvict[K comparable, V any](size int, onEvicted func(key K, value V)) (c *Cache[K, V], err error) {
|
||||
// create a cache with default settings
|
||||
c = &Cache[K, V]{
|
||||
onEvictedCB: onEvicted,
|
||||
}
|
||||
if onEvicted != nil {
|
||||
c.initEvictBuffers()
|
||||
onEvicted = c.onEvicted
|
||||
}
|
||||
c.lru, err = simplelru.NewLRU(size, onEvicted)
|
||||
return
|
||||
}
|
||||
|
||||
func (c *Cache[K, V]) initEvictBuffers() {
|
||||
c.evictedKeys = make([]K, 0, DefaultEvictedBufferSize)
|
||||
c.evictedVals = make([]V, 0, DefaultEvictedBufferSize)
|
||||
}
|
||||
|
||||
// onEvicted save evicted key/val and sent in externally registered callback
|
||||
// outside of critical section
|
||||
func (c *Cache[K, V]) onEvicted(k K, v V) {
|
||||
c.evictedKeys = append(c.evictedKeys, k)
|
||||
c.evictedVals = append(c.evictedVals, v)
|
||||
}
|
||||
|
||||
// Purge is used to completely clear the cache.
|
||||
func (c *Cache[K, V]) Purge() {
|
||||
var ks []K
|
||||
var vs []V
|
||||
c.lock.Lock()
|
||||
c.lru.Purge()
|
||||
if c.onEvictedCB != nil && len(c.evictedKeys) > 0 {
|
||||
ks, vs = c.evictedKeys, c.evictedVals
|
||||
c.initEvictBuffers()
|
||||
}
|
||||
c.lock.Unlock()
|
||||
// invoke callback outside of critical section
|
||||
if c.onEvictedCB != nil {
|
||||
for i := 0; i < len(ks); i++ {
|
||||
c.onEvictedCB(ks[i], vs[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add adds a value to the cache. Returns true if an eviction occurred.
|
||||
func (c *Cache[K, V]) Add(key K, value V) (evicted bool) {
|
||||
var k K
|
||||
var v V
|
||||
c.lock.Lock()
|
||||
evicted = c.lru.Add(key, value)
|
||||
if c.onEvictedCB != nil && evicted {
|
||||
k, v = c.evictedKeys[0], c.evictedVals[0]
|
||||
c.evictedKeys, c.evictedVals = c.evictedKeys[:0], c.evictedVals[:0]
|
||||
}
|
||||
c.lock.Unlock()
|
||||
if c.onEvictedCB != nil && evicted {
|
||||
c.onEvictedCB(k, v)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// Get looks up a key's value from the cache.
|
||||
func (c *Cache[K, V]) Get(key K) (value V, ok bool) {
|
||||
c.lock.Lock()
|
||||
value, ok = c.lru.Get(key)
|
||||
c.lock.Unlock()
|
||||
return value, ok
|
||||
}
|
||||
|
||||
// Contains checks if a key is in the cache, without updating the
|
||||
// recent-ness or deleting it for being stale.
|
||||
func (c *Cache[K, V]) Contains(key K) bool {
|
||||
c.lock.RLock()
|
||||
containKey := c.lru.Contains(key)
|
||||
c.lock.RUnlock()
|
||||
return containKey
|
||||
}
|
||||
|
||||
// Peek returns the key value (or undefined if not found) without updating
|
||||
// the "recently used"-ness of the key.
|
||||
func (c *Cache[K, V]) Peek(key K) (value V, ok bool) {
|
||||
c.lock.RLock()
|
||||
value, ok = c.lru.Peek(key)
|
||||
c.lock.RUnlock()
|
||||
return value, ok
|
||||
}
|
||||
|
||||
// ContainsOrAdd checks if a key is in the cache without updating the
|
||||
// recent-ness or deleting it for being stale, and if not, adds the value.
|
||||
// Returns whether found and whether an eviction occurred.
|
||||
func (c *Cache[K, V]) ContainsOrAdd(key K, value V) (ok, evicted bool) {
|
||||
var k K
|
||||
var v V
|
||||
c.lock.Lock()
|
||||
if c.lru.Contains(key) {
|
||||
c.lock.Unlock()
|
||||
return true, false
|
||||
}
|
||||
evicted = c.lru.Add(key, value)
|
||||
if c.onEvictedCB != nil && evicted {
|
||||
k, v = c.evictedKeys[0], c.evictedVals[0]
|
||||
c.evictedKeys, c.evictedVals = c.evictedKeys[:0], c.evictedVals[:0]
|
||||
}
|
||||
c.lock.Unlock()
|
||||
if c.onEvictedCB != nil && evicted {
|
||||
c.onEvictedCB(k, v)
|
||||
}
|
||||
return false, evicted
|
||||
}
|
||||
|
||||
// PeekOrAdd checks if a key is in the cache without updating the
|
||||
// recent-ness or deleting it for being stale, and if not, adds the value.
|
||||
// Returns whether found and whether an eviction occurred.
|
||||
func (c *Cache[K, V]) PeekOrAdd(key K, value V) (previous V, ok, evicted bool) {
|
||||
var k K
|
||||
var v V
|
||||
c.lock.Lock()
|
||||
previous, ok = c.lru.Peek(key)
|
||||
if ok {
|
||||
c.lock.Unlock()
|
||||
return previous, true, false
|
||||
}
|
||||
evicted = c.lru.Add(key, value)
|
||||
if c.onEvictedCB != nil && evicted {
|
||||
k, v = c.evictedKeys[0], c.evictedVals[0]
|
||||
c.evictedKeys, c.evictedVals = c.evictedKeys[:0], c.evictedVals[:0]
|
||||
}
|
||||
c.lock.Unlock()
|
||||
if c.onEvictedCB != nil && evicted {
|
||||
c.onEvictedCB(k, v)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// Remove removes the provided key from the cache.
|
||||
func (c *Cache[K, V]) Remove(key K) (present bool) {
|
||||
var k K
|
||||
var v V
|
||||
c.lock.Lock()
|
||||
present = c.lru.Remove(key)
|
||||
if c.onEvictedCB != nil && present {
|
||||
k, v = c.evictedKeys[0], c.evictedVals[0]
|
||||
c.evictedKeys, c.evictedVals = c.evictedKeys[:0], c.evictedVals[:0]
|
||||
}
|
||||
c.lock.Unlock()
|
||||
if c.onEvictedCB != nil && present {
|
||||
c.onEvictedCB(k, v)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// Resize changes the cache size.
|
||||
func (c *Cache[K, V]) Resize(size int) (evicted int) {
|
||||
var ks []K
|
||||
var vs []V
|
||||
c.lock.Lock()
|
||||
evicted = c.lru.Resize(size)
|
||||
if c.onEvictedCB != nil && evicted > 0 {
|
||||
ks, vs = c.evictedKeys, c.evictedVals
|
||||
c.initEvictBuffers()
|
||||
}
|
||||
c.lock.Unlock()
|
||||
if c.onEvictedCB != nil && evicted > 0 {
|
||||
for i := 0; i < len(ks); i++ {
|
||||
c.onEvictedCB(ks[i], vs[i])
|
||||
}
|
||||
}
|
||||
return evicted
|
||||
}
|
||||
|
||||
// RemoveOldest removes the oldest item from the cache.
|
||||
func (c *Cache[K, V]) RemoveOldest() (key K, value V, ok bool) {
|
||||
var k K
|
||||
var v V
|
||||
c.lock.Lock()
|
||||
key, value, ok = c.lru.RemoveOldest()
|
||||
if c.onEvictedCB != nil && ok {
|
||||
k, v = c.evictedKeys[0], c.evictedVals[0]
|
||||
c.evictedKeys, c.evictedVals = c.evictedKeys[:0], c.evictedVals[:0]
|
||||
}
|
||||
c.lock.Unlock()
|
||||
if c.onEvictedCB != nil && ok {
|
||||
c.onEvictedCB(k, v)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// GetOldest returns the oldest entry
|
||||
func (c *Cache[K, V]) GetOldest() (key K, value V, ok bool) {
|
||||
c.lock.RLock()
|
||||
key, value, ok = c.lru.GetOldest()
|
||||
c.lock.RUnlock()
|
||||
return
|
||||
}
|
||||
|
||||
// Keys returns a slice of the keys in the cache, from oldest to newest.
|
||||
func (c *Cache[K, V]) Keys() []K {
|
||||
c.lock.RLock()
|
||||
keys := c.lru.Keys()
|
||||
c.lock.RUnlock()
|
||||
return keys
|
||||
}
|
||||
|
||||
// Values returns a slice of the values in the cache, from oldest to newest.
|
||||
func (c *Cache[K, V]) Values() []V {
|
||||
c.lock.RLock()
|
||||
values := c.lru.Values()
|
||||
c.lock.RUnlock()
|
||||
return values
|
||||
}
|
||||
|
||||
// Len returns the number of items in the cache.
|
||||
func (c *Cache[K, V]) Len() int {
|
||||
c.lock.RLock()
|
||||
length := c.lru.Len()
|
||||
c.lock.RUnlock()
|
||||
return length
|
||||
}
|
29
vendor/github.com/hashicorp/golang-lru/v2/simplelru/LICENSE_list
generated
vendored
Normal file
29
vendor/github.com/hashicorp/golang-lru/v2/simplelru/LICENSE_list
generated
vendored
Normal file
|
@ -0,0 +1,29 @@
|
|||
This license applies to simplelru/list.go
|
||||
|
||||
Copyright (c) 2009 The Go Authors. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of Google Inc. nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
177
vendor/github.com/hashicorp/golang-lru/v2/simplelru/lru.go
generated
vendored
Normal file
177
vendor/github.com/hashicorp/golang-lru/v2/simplelru/lru.go
generated
vendored
Normal file
|
@ -0,0 +1,177 @@
|
|||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
package simplelru
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/hashicorp/golang-lru/v2/internal"
|
||||
)
|
||||
|
||||
// EvictCallback is used to get a callback when a cache entry is evicted
|
||||
type EvictCallback[K comparable, V any] func(key K, value V)
|
||||
|
||||
// LRU implements a non-thread safe fixed size LRU cache
|
||||
type LRU[K comparable, V any] struct {
|
||||
size int
|
||||
evictList *internal.LruList[K, V]
|
||||
items map[K]*internal.Entry[K, V]
|
||||
onEvict EvictCallback[K, V]
|
||||
}
|
||||
|
||||
// NewLRU constructs an LRU of the given size
|
||||
func NewLRU[K comparable, V any](size int, onEvict EvictCallback[K, V]) (*LRU[K, V], error) {
|
||||
if size <= 0 {
|
||||
return nil, errors.New("must provide a positive size")
|
||||
}
|
||||
|
||||
c := &LRU[K, V]{
|
||||
size: size,
|
||||
evictList: internal.NewList[K, V](),
|
||||
items: make(map[K]*internal.Entry[K, V]),
|
||||
onEvict: onEvict,
|
||||
}
|
||||
return c, nil
|
||||
}
|
||||
|
||||
// Purge is used to completely clear the cache.
|
||||
func (c *LRU[K, V]) Purge() {
|
||||
for k, v := range c.items {
|
||||
if c.onEvict != nil {
|
||||
c.onEvict(k, v.Value)
|
||||
}
|
||||
delete(c.items, k)
|
||||
}
|
||||
c.evictList.Init()
|
||||
}
|
||||
|
||||
// Add adds a value to the cache. Returns true if an eviction occurred.
|
||||
func (c *LRU[K, V]) Add(key K, value V) (evicted bool) {
|
||||
// Check for existing item
|
||||
if ent, ok := c.items[key]; ok {
|
||||
c.evictList.MoveToFront(ent)
|
||||
ent.Value = value
|
||||
return false
|
||||
}
|
||||
|
||||
// Add new item
|
||||
ent := c.evictList.PushFront(key, value)
|
||||
c.items[key] = ent
|
||||
|
||||
evict := c.evictList.Length() > c.size
|
||||
// Verify size not exceeded
|
||||
if evict {
|
||||
c.removeOldest()
|
||||
}
|
||||
return evict
|
||||
}
|
||||
|
||||
// Get looks up a key's value from the cache.
|
||||
func (c *LRU[K, V]) Get(key K) (value V, ok bool) {
|
||||
if ent, ok := c.items[key]; ok {
|
||||
c.evictList.MoveToFront(ent)
|
||||
return ent.Value, true
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// Contains checks if a key is in the cache, without updating the recent-ness
|
||||
// or deleting it for being stale.
|
||||
func (c *LRU[K, V]) Contains(key K) (ok bool) {
|
||||
_, ok = c.items[key]
|
||||
return ok
|
||||
}
|
||||
|
||||
// Peek returns the key value (or undefined if not found) without updating
|
||||
// the "recently used"-ness of the key.
|
||||
func (c *LRU[K, V]) Peek(key K) (value V, ok bool) {
|
||||
var ent *internal.Entry[K, V]
|
||||
if ent, ok = c.items[key]; ok {
|
||||
return ent.Value, true
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// Remove removes the provided key from the cache, returning if the
|
||||
// key was contained.
|
||||
func (c *LRU[K, V]) Remove(key K) (present bool) {
|
||||
if ent, ok := c.items[key]; ok {
|
||||
c.removeElement(ent)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// RemoveOldest removes the oldest item from the cache.
|
||||
func (c *LRU[K, V]) RemoveOldest() (key K, value V, ok bool) {
|
||||
if ent := c.evictList.Back(); ent != nil {
|
||||
c.removeElement(ent)
|
||||
return ent.Key, ent.Value, true
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// GetOldest returns the oldest entry
|
||||
func (c *LRU[K, V]) GetOldest() (key K, value V, ok bool) {
|
||||
if ent := c.evictList.Back(); ent != nil {
|
||||
return ent.Key, ent.Value, true
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// Keys returns a slice of the keys in the cache, from oldest to newest.
|
||||
func (c *LRU[K, V]) Keys() []K {
|
||||
keys := make([]K, c.evictList.Length())
|
||||
i := 0
|
||||
for ent := c.evictList.Back(); ent != nil; ent = ent.PrevEntry() {
|
||||
keys[i] = ent.Key
|
||||
i++
|
||||
}
|
||||
return keys
|
||||
}
|
||||
|
||||
// Values returns a slice of the values in the cache, from oldest to newest.
|
||||
func (c *LRU[K, V]) Values() []V {
|
||||
values := make([]V, len(c.items))
|
||||
i := 0
|
||||
for ent := c.evictList.Back(); ent != nil; ent = ent.PrevEntry() {
|
||||
values[i] = ent.Value
|
||||
i++
|
||||
}
|
||||
return values
|
||||
}
|
||||
|
||||
// Len returns the number of items in the cache.
|
||||
func (c *LRU[K, V]) Len() int {
|
||||
return c.evictList.Length()
|
||||
}
|
||||
|
||||
// Resize changes the cache size.
|
||||
func (c *LRU[K, V]) Resize(size int) (evicted int) {
|
||||
diff := c.Len() - size
|
||||
if diff < 0 {
|
||||
diff = 0
|
||||
}
|
||||
for i := 0; i < diff; i++ {
|
||||
c.removeOldest()
|
||||
}
|
||||
c.size = size
|
||||
return diff
|
||||
}
|
||||
|
||||
// removeOldest removes the oldest item from the cache.
|
||||
func (c *LRU[K, V]) removeOldest() {
|
||||
if ent := c.evictList.Back(); ent != nil {
|
||||
c.removeElement(ent)
|
||||
}
|
||||
}
|
||||
|
||||
// removeElement is used to remove a given list element from the cache
|
||||
func (c *LRU[K, V]) removeElement(e *internal.Entry[K, V]) {
|
||||
c.evictList.Remove(e)
|
||||
delete(c.items, e.Key)
|
||||
if c.onEvict != nil {
|
||||
c.onEvict(e.Key, e.Value)
|
||||
}
|
||||
}
|
46
vendor/github.com/hashicorp/golang-lru/v2/simplelru/lru_interface.go
generated
vendored
Normal file
46
vendor/github.com/hashicorp/golang-lru/v2/simplelru/lru_interface.go
generated
vendored
Normal file
|
@ -0,0 +1,46 @@
|
|||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
// Package simplelru provides simple LRU implementation based on build-in container/list.
|
||||
package simplelru
|
||||
|
||||
// LRUCache is the interface for simple LRU cache.
|
||||
type LRUCache[K comparable, V any] interface {
|
||||
// Adds a value to the cache, returns true if an eviction occurred and
|
||||
// updates the "recently used"-ness of the key.
|
||||
Add(key K, value V) bool
|
||||
|
||||
// Returns key's value from the cache and
|
||||
// updates the "recently used"-ness of the key. #value, isFound
|
||||
Get(key K) (value V, ok bool)
|
||||
|
||||
// Checks if a key exists in cache without updating the recent-ness.
|
||||
Contains(key K) (ok bool)
|
||||
|
||||
// Returns key's value without updating the "recently used"-ness of the key.
|
||||
Peek(key K) (value V, ok bool)
|
||||
|
||||
// Removes a key from the cache.
|
||||
Remove(key K) bool
|
||||
|
||||
// Removes the oldest entry from cache.
|
||||
RemoveOldest() (K, V, bool)
|
||||
|
||||
// Returns the oldest entry from the cache. #key, value, isFound
|
||||
GetOldest() (K, V, bool)
|
||||
|
||||
// Returns a slice of the keys in the cache, from oldest to newest.
|
||||
Keys() []K
|
||||
|
||||
// Values returns a slice of the values in the cache, from oldest to newest.
|
||||
Values() []V
|
||||
|
||||
// Returns the number of items in the cache.
|
||||
Len() int
|
||||
|
||||
// Clears all cache entries.
|
||||
Purge()
|
||||
|
||||
// Resizes cache, returning number evicted
|
||||
Resize(int) int
|
||||
}
|
13
vendor/github.com/ncruces/go-sqlite3/README.md
generated
vendored
13
vendor/github.com/ncruces/go-sqlite3/README.md
generated
vendored
|
@ -4,12 +4,13 @@
|
|||
[![Go Report](https://goreportcard.com/badge/github.com/ncruces/go-sqlite3)](https://goreportcard.com/report/github.com/ncruces/go-sqlite3)
|
||||
[![Go Coverage](https://github.com/ncruces/go-sqlite3/wiki/coverage.svg)](https://github.com/ncruces/go-sqlite3/wiki/Test-coverage-report)
|
||||
|
||||
Go module `github.com/ncruces/go-sqlite3` is `cgo`-free [SQLite](https://sqlite.org/) wrapper.\
|
||||
Go module `github.com/ncruces/go-sqlite3` is a `cgo`-free [SQLite](https://sqlite.org/) wrapper.\
|
||||
It provides a [`database/sql`](https://pkg.go.dev/database/sql) compatible driver,
|
||||
as well as direct access to most of the [C SQLite API](https://sqlite.org/cintro.html).
|
||||
|
||||
It wraps a [Wasm](https://webassembly.org/) build of SQLite, and uses [wazero](https://wazero.io/) as the runtime.\
|
||||
Go, wazero and [`x/sys`](https://pkg.go.dev/golang.org/x/sys) are the _only_ runtime dependencies.
|
||||
It wraps a [Wasm](https://webassembly.org/) [build](embed/) of SQLite,
|
||||
and uses [wazero](https://wazero.io/) as the runtime.\
|
||||
Go, wazero and [`x/sys`](https://pkg.go.dev/golang.org/x/sys) are the _only_ runtime dependencies [^1].
|
||||
|
||||
### Packages
|
||||
|
||||
|
@ -54,6 +55,8 @@ Go, wazero and [`x/sys`](https://pkg.go.dev/golang.org/x/sys) are the _only_ run
|
|||
implements an in-memory VFS.
|
||||
- [`github.com/ncruces/go-sqlite3/vfs/readervfs`](https://pkg.go.dev/github.com/ncruces/go-sqlite3/vfs/readervfs)
|
||||
implements a VFS for immutable databases.
|
||||
- [`github.com/ncruces/go-sqlite3/vfs/adiantum`](https://pkg.go.dev/github.com/ncruces/go-sqlite3/vfs/adiantum)
|
||||
wraps a VFS to offer encryption at rest.
|
||||
|
||||
### Advanced features
|
||||
|
||||
|
@ -67,6 +70,7 @@ Go, wazero and [`x/sys`](https://pkg.go.dev/golang.org/x/sys) are the _only_ run
|
|||
- [math functions](https://sqlite.org/lang_mathfunc.html)
|
||||
- [full-text search](https://sqlite.org/fts5.html)
|
||||
- [geospatial search](https://sqlite.org/geopoly.html)
|
||||
- [encryption at rest](vfs/adiantum/README.md)
|
||||
- [and more…](embed/README.md)
|
||||
|
||||
### Caveats
|
||||
|
@ -101,3 +105,6 @@ The Wasm and VFS layers are also tested by running SQLite's
|
|||
- [`crawshaw.io/sqlite`](https://pkg.go.dev/crawshaw.io/sqlite)
|
||||
- [`github.com/mattn/go-sqlite3`](https://pkg.go.dev/github.com/mattn/go-sqlite3)
|
||||
- [`github.com/zombiezen/go-sqlite`](https://pkg.go.dev/github.com/zombiezen/go-sqlite)
|
||||
|
||||
[^1]: anything else you find in [`go.mod`](./go.mod) is either a test dependency,
|
||||
or needed by one of the extensions.
|
||||
|
|
36
vendor/github.com/ncruces/go-sqlite3/driver/driver.go
generated
vendored
36
vendor/github.com/ncruces/go-sqlite3/driver/driver.go
generated
vendored
|
@ -63,7 +63,7 @@ var driverName = "sqlite3"
|
|||
|
||||
func init() {
|
||||
if driverName != "" {
|
||||
sql.Register(driverName, sqlite{})
|
||||
sql.Register(driverName, &SQLite{})
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -73,29 +73,37 @@ func init() {
|
|||
// The conn can be used to execute queries, register functions, etc.
|
||||
// Any error return closes the conn and passes the error to [database/sql].
|
||||
func Open(dataSourceName string, init func(*sqlite3.Conn) error) (*sql.DB, error) {
|
||||
c, err := newConnector(dataSourceName, init)
|
||||
c, err := (&SQLite{Init: init}).OpenConnector(dataSourceName)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return sql.OpenDB(c), nil
|
||||
}
|
||||
|
||||
type sqlite struct{}
|
||||
type SQLite struct {
|
||||
|
||||
func (sqlite) Open(name string) (driver.Conn, error) {
|
||||
c, err := newConnector(name, nil)
|
||||
// The init function is called by the driver on new connections.
|
||||
// The conn can be used to execute queries, register functions, etc.
|
||||
// Any error return closes the conn and passes the error to [database/sql].
|
||||
Init func(*sqlite3.Conn) error
|
||||
}
|
||||
|
||||
// Open: implements [database/sql.Driver].
|
||||
func (d *SQLite) Open(name string) (driver.Conn, error) {
|
||||
c, err := d.newConnector(name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return c.Connect(context.Background())
|
||||
}
|
||||
|
||||
func (sqlite) OpenConnector(name string) (driver.Connector, error) {
|
||||
return newConnector(name, nil)
|
||||
// OpenConnector: implements [database/sql.DriverContext].
|
||||
func (d *SQLite) OpenConnector(name string) (driver.Connector, error) {
|
||||
return d.newConnector(name)
|
||||
}
|
||||
|
||||
func newConnector(name string, init func(*sqlite3.Conn) error) (*connector, error) {
|
||||
c := connector{name: name, init: init}
|
||||
func (d *SQLite) newConnector(name string) (*connector, error) {
|
||||
c := connector{driver: d, name: name}
|
||||
|
||||
var txlock, timefmt string
|
||||
if strings.HasPrefix(name, "file:") {
|
||||
|
@ -137,7 +145,7 @@ func newConnector(name string, init func(*sqlite3.Conn) error) (*connector, erro
|
|||
}
|
||||
|
||||
type connector struct {
|
||||
init func(*sqlite3.Conn) error
|
||||
driver *SQLite
|
||||
name string
|
||||
txBegin string
|
||||
tmRead sqlite3.TimeFormat
|
||||
|
@ -146,7 +154,7 @@ type connector struct {
|
|||
}
|
||||
|
||||
func (n *connector) Driver() driver.Driver {
|
||||
return sqlite{}
|
||||
return n.driver
|
||||
}
|
||||
|
||||
func (n *connector) Connect(ctx context.Context) (_ driver.Conn, err error) {
|
||||
|
@ -175,13 +183,13 @@ func (n *connector) Connect(ctx context.Context) (_ driver.Conn, err error) {
|
|||
return nil, err
|
||||
}
|
||||
}
|
||||
if n.init != nil {
|
||||
err = n.init(c.Conn)
|
||||
if n.driver.Init != nil {
|
||||
err = n.driver.Init(c.Conn)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
if n.pragmas || n.init != nil {
|
||||
if n.pragmas || n.driver.Init != nil {
|
||||
s, _, err := c.Conn.Prepare(`PRAGMA query_only`)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
2
vendor/github.com/ncruces/go-sqlite3/embed/build.sh
generated
vendored
2
vendor/github.com/ncruces/go-sqlite3/embed/build.sh
generated
vendored
|
@ -8,7 +8,7 @@ BINARYEN="$ROOT/tools/binaryen-version_117/bin"
|
|||
WASI_SDK="$ROOT/tools/wasi-sdk-22.0/bin"
|
||||
|
||||
"$WASI_SDK/clang" --target=wasm32-wasi -std=c17 -flto -g0 -O2 \
|
||||
-Wall -Wextra -Wno-unused-parameter \
|
||||
-Wall -Wextra -Wno-unused-parameter \
|
||||
-o sqlite3.wasm "$ROOT/sqlite3/main.c" \
|
||||
-I"$ROOT/sqlite3" \
|
||||
-mexec-model=reactor \
|
||||
|
|
1
vendor/github.com/ncruces/go-sqlite3/embed/exports.txt
generated
vendored
1
vendor/github.com/ncruces/go-sqlite3/embed/exports.txt
generated
vendored
|
@ -51,6 +51,7 @@ sqlite3_create_collation_go
|
|||
sqlite3_create_function_go
|
||||
sqlite3_create_module_go
|
||||
sqlite3_create_window_function_go
|
||||
sqlite3_database_file_object
|
||||
sqlite3_db_config
|
||||
sqlite3_db_name
|
||||
sqlite3_db_readonly
|
||||
|
|
BIN
vendor/github.com/ncruces/go-sqlite3/embed/sqlite3.wasm
generated
vendored
BIN
vendor/github.com/ncruces/go-sqlite3/embed/sqlite3.wasm
generated
vendored
Binary file not shown.
2
vendor/github.com/ncruces/go-sqlite3/internal/util/mmap.go
generated
vendored
2
vendor/github.com/ncruces/go-sqlite3/internal/util/mmap.go
generated
vendored
|
@ -25,7 +25,7 @@ func (s *mmapState) init(ctx context.Context, enabled bool) context.Context {
|
|||
return ctx
|
||||
}
|
||||
|
||||
func CanMap(ctx context.Context) bool {
|
||||
func CanMapFiles(ctx context.Context) bool {
|
||||
s := ctx.Value(moduleKey{}).(*moduleState)
|
||||
return s.mmapState.enabled
|
||||
}
|
||||
|
|
2
vendor/github.com/ncruces/go-sqlite3/internal/util/mmap_other.go
generated
vendored
2
vendor/github.com/ncruces/go-sqlite3/internal/util/mmap_other.go
generated
vendored
|
@ -10,6 +10,6 @@ func (s *mmapState) init(ctx context.Context, _ bool) context.Context {
|
|||
return ctx
|
||||
}
|
||||
|
||||
func CanMap(ctx context.Context) bool {
|
||||
func CanMapFiles(ctx context.Context) bool {
|
||||
return false
|
||||
}
|
||||
|
|
2
vendor/github.com/ncruces/go-sqlite3/vfs/README.md
generated
vendored
2
vendor/github.com/ncruces/go-sqlite3/vfs/README.md
generated
vendored
|
@ -51,7 +51,7 @@ like SQLite.
|
|||
|
||||
To allow `mmap` to work, each connection needs to reserve up to 4GB of address space.\
|
||||
To limit the amount of address space each connection needs,
|
||||
use [`WithMemoryLimitPages`](../tests/parallel/parallel_test.go#L21).
|
||||
use [`WithMemoryLimitPages`](../tests/testcfg/testcfg.go).
|
||||
|
||||
On all other platforms, [WAL](https://sqlite.org/wal.html) support is
|
||||
[limited](https://sqlite.org/wal.html#noshm).
|
||||
|
|
31
vendor/github.com/ncruces/go-sqlite3/vfs/api.go
generated
vendored
31
vendor/github.com/ncruces/go-sqlite3/vfs/api.go
generated
vendored
|
@ -1,7 +1,12 @@
|
|||
// Package vfs wraps the C SQLite VFS API.
|
||||
package vfs
|
||||
|
||||
import "net/url"
|
||||
import (
|
||||
"context"
|
||||
"net/url"
|
||||
|
||||
"github.com/tetratelabs/wazero/api"
|
||||
)
|
||||
|
||||
// A VFS defines the interface between the SQLite core and the underlying operating system.
|
||||
//
|
||||
|
@ -24,6 +29,15 @@ type VFSParams interface {
|
|||
OpenParams(name string, flags OpenFlag, params url.Values) (File, OpenFlag, error)
|
||||
}
|
||||
|
||||
// VFSJournal extends VFS with the ability to open journals
|
||||
// that need a reference to their corresponding database files.
|
||||
//
|
||||
// https://sqlite.org/c3ref/database_file_object.html
|
||||
type VFSJournal interface {
|
||||
VFS
|
||||
OpenJournal(name string, flags OpenFlag, db File) (File, OpenFlag, error)
|
||||
}
|
||||
|
||||
// A File represents an open file in the OS interface layer.
|
||||
//
|
||||
// Use sqlite3.ErrorCode or sqlite3.ExtendedErrorCode to return specific error codes to SQLite.
|
||||
|
@ -120,3 +134,18 @@ type FileBatchAtomicWrite interface {
|
|||
CommitAtomicWrite() error
|
||||
RollbackAtomicWrite() error
|
||||
}
|
||||
|
||||
// FileSharedMemory extends File to possibly implement shared memory.
|
||||
// It's OK for SharedMemory to return nil.
|
||||
type FileSharedMemory interface {
|
||||
File
|
||||
SharedMemory() SharedMemory
|
||||
}
|
||||
|
||||
// SharedMemory is a shared memory implementation.
|
||||
// This cannot be externally implemented.
|
||||
type SharedMemory interface {
|
||||
shmMap(context.Context, api.Module, int32, int32, bool) (uint32, error)
|
||||
shmLock(int32, int32, _ShmFlag) error
|
||||
shmUnmap(bool)
|
||||
}
|
||||
|
|
8
vendor/github.com/ncruces/go-sqlite3/vfs/file.go
generated
vendored
8
vendor/github.com/ncruces/go-sqlite3/vfs/file.go
generated
vendored
|
@ -1,7 +1,6 @@
|
|||
package vfs
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"io"
|
||||
"io/fs"
|
||||
|
@ -12,7 +11,6 @@ import (
|
|||
"syscall"
|
||||
|
||||
"github.com/ncruces/go-sqlite3/util/osutil"
|
||||
"github.com/tetratelabs/wazero/api"
|
||||
)
|
||||
|
||||
type vfsOS struct{}
|
||||
|
@ -215,9 +213,3 @@ func (f *vfsFile) PowersafeOverwrite() bool { return f.psow }
|
|||
func (f *vfsFile) PersistentWAL() bool { return f.keepWAL }
|
||||
func (f *vfsFile) SetPowersafeOverwrite(psow bool) { f.psow = psow }
|
||||
func (f *vfsFile) SetPersistentWAL(keepWAL bool) { f.keepWAL = keepWAL }
|
||||
|
||||
type fileShm interface {
|
||||
shmMap(context.Context, api.Module, int32, int32, bool) (uint32, error)
|
||||
shmLock(int32, int32, _ShmFlag) error
|
||||
shmUnmap(bool)
|
||||
}
|
||||
|
|
9
vendor/github.com/ncruces/go-sqlite3/vfs/memdb/README.md
generated
vendored
Normal file
9
vendor/github.com/ncruces/go-sqlite3/vfs/memdb/README.md
generated
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
# Go `"memdb"` SQLite VFS
|
||||
|
||||
This package implements the [`"memdb"`](https://sqlite.org/src/doc/tip/src/memdb.c)
|
||||
SQLite VFS in pure Go.
|
||||
|
||||
It has some benefits over the C version:
|
||||
- the memory backing the database needs not be contiguous,
|
||||
- the database can grow/shrink incrementally without copying,
|
||||
- reader-writer concurrency is slightly improved.
|
65
vendor/github.com/ncruces/go-sqlite3/vfs/memdb/api.go
generated
vendored
Normal file
65
vendor/github.com/ncruces/go-sqlite3/vfs/memdb/api.go
generated
vendored
Normal file
|
@ -0,0 +1,65 @@
|
|||
// Package memdb implements the "memdb" SQLite VFS.
|
||||
//
|
||||
// The "memdb" [vfs.VFS] allows the same in-memory database to be shared
|
||||
// among multiple database connections in the same process,
|
||||
// as long as the database name begins with "/".
|
||||
//
|
||||
// Importing package memdb registers the VFS.
|
||||
//
|
||||
// import _ "github.com/ncruces/go-sqlite3/vfs/memdb"
|
||||
package memdb
|
||||
|
||||
import (
|
||||
"sync"
|
||||
|
||||
"github.com/ncruces/go-sqlite3/vfs"
|
||||
)
|
||||
|
||||
func init() {
|
||||
vfs.Register("memdb", memVFS{})
|
||||
}
|
||||
|
||||
var (
|
||||
memoryMtx sync.Mutex
|
||||
// +checklocks:memoryMtx
|
||||
memoryDBs = map[string]*memDB{}
|
||||
)
|
||||
|
||||
// Create creates a shared memory database,
|
||||
// using data as its initial contents.
|
||||
// The new database takes ownership of data,
|
||||
// and the caller should not use data after this call.
|
||||
func Create(name string, data []byte) {
|
||||
memoryMtx.Lock()
|
||||
defer memoryMtx.Unlock()
|
||||
|
||||
db := new(memDB)
|
||||
db.size = int64(len(data))
|
||||
|
||||
// Convert data from WAL to rollback journal.
|
||||
if len(data) >= 20 && data[18] == 2 && data[19] == 2 {
|
||||
data[18] = 1
|
||||
data[19] = 1
|
||||
}
|
||||
|
||||
sectors := divRoundUp(db.size, sectorSize)
|
||||
db.data = make([]*[sectorSize]byte, sectors)
|
||||
for i := range db.data {
|
||||
sector := data[i*sectorSize:]
|
||||
if len(sector) >= sectorSize {
|
||||
db.data[i] = (*[sectorSize]byte)(sector)
|
||||
} else {
|
||||
db.data[i] = new([sectorSize]byte)
|
||||
copy((*db.data[i])[:], sector)
|
||||
}
|
||||
}
|
||||
|
||||
memoryDBs[name] = db
|
||||
}
|
||||
|
||||
// Delete deletes a shared memory database.
|
||||
func Delete(name string) {
|
||||
memoryMtx.Lock()
|
||||
defer memoryMtx.Unlock()
|
||||
delete(memoryDBs, name)
|
||||
}
|
296
vendor/github.com/ncruces/go-sqlite3/vfs/memdb/memdb.go
generated
vendored
Normal file
296
vendor/github.com/ncruces/go-sqlite3/vfs/memdb/memdb.go
generated
vendored
Normal file
|
@ -0,0 +1,296 @@
|
|||
package memdb
|
||||
|
||||
import (
|
||||
"io"
|
||||
"runtime"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/ncruces/go-sqlite3"
|
||||
"github.com/ncruces/go-sqlite3/vfs"
|
||||
)
|
||||
|
||||
// Must be a multiple of 64K (the largest page size).
|
||||
const sectorSize = 65536
|
||||
|
||||
type memVFS struct{}
|
||||
|
||||
func (memVFS) Open(name string, flags vfs.OpenFlag) (vfs.File, vfs.OpenFlag, error) {
|
||||
// For simplicity, we do not support reading or writing data
|
||||
// across "sector" boundaries.
|
||||
//
|
||||
// This is not a problem for most SQLite file types:
|
||||
// - databases, which only do page aligned reads/writes;
|
||||
// - temp journals, as used by the sorter, which does the same:
|
||||
// https://sqlite.org/src/artifact/237840?ln=409-412
|
||||
//
|
||||
// We refuse to open all other file types,
|
||||
// but returning OPEN_MEMORY means SQLite won't ask us to.
|
||||
const types = vfs.OPEN_MAIN_DB |
|
||||
vfs.OPEN_TRANSIENT_DB |
|
||||
vfs.OPEN_TEMP_DB |
|
||||
vfs.OPEN_TEMP_JOURNAL
|
||||
if flags&types == 0 {
|
||||
return nil, flags, sqlite3.CANTOPEN
|
||||
}
|
||||
|
||||
var db *memDB
|
||||
|
||||
shared := strings.HasPrefix(name, "/")
|
||||
if shared {
|
||||
memoryMtx.Lock()
|
||||
defer memoryMtx.Unlock()
|
||||
db = memoryDBs[name[1:]]
|
||||
}
|
||||
if db == nil {
|
||||
if flags&vfs.OPEN_CREATE == 0 {
|
||||
return nil, flags, sqlite3.CANTOPEN
|
||||
}
|
||||
db = new(memDB)
|
||||
}
|
||||
if shared {
|
||||
memoryDBs[name[1:]] = db // +checklocksignore: lock is held
|
||||
}
|
||||
|
||||
return &memFile{
|
||||
memDB: db,
|
||||
readOnly: flags&vfs.OPEN_READONLY != 0,
|
||||
}, flags | vfs.OPEN_MEMORY, nil
|
||||
}
|
||||
|
||||
func (memVFS) Delete(name string, dirSync bool) error {
|
||||
return sqlite3.IOERR_DELETE
|
||||
}
|
||||
|
||||
func (memVFS) Access(name string, flag vfs.AccessFlag) (bool, error) {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
func (memVFS) FullPathname(name string) (string, error) {
|
||||
return name, nil
|
||||
}
|
||||
|
||||
type memDB struct {
|
||||
// +checklocks:lockMtx
|
||||
pending *memFile
|
||||
// +checklocks:lockMtx
|
||||
reserved *memFile
|
||||
|
||||
// +checklocks:dataMtx
|
||||
data []*[sectorSize]byte
|
||||
|
||||
// +checklocks:dataMtx
|
||||
size int64
|
||||
|
||||
// +checklocks:lockMtx
|
||||
shared int
|
||||
|
||||
lockMtx sync.Mutex
|
||||
dataMtx sync.RWMutex
|
||||
}
|
||||
|
||||
type memFile struct {
|
||||
*memDB
|
||||
lock vfs.LockLevel
|
||||
readOnly bool
|
||||
}
|
||||
|
||||
var (
|
||||
// Ensure these interfaces are implemented:
|
||||
_ vfs.FileLockState = &memFile{}
|
||||
_ vfs.FileSizeHint = &memFile{}
|
||||
)
|
||||
|
||||
func (m *memFile) Close() error {
|
||||
return m.Unlock(vfs.LOCK_NONE)
|
||||
}
|
||||
|
||||
func (m *memFile) ReadAt(b []byte, off int64) (n int, err error) {
|
||||
m.dataMtx.RLock()
|
||||
defer m.dataMtx.RUnlock()
|
||||
|
||||
if off >= m.size {
|
||||
return 0, io.EOF
|
||||
}
|
||||
|
||||
base := off / sectorSize
|
||||
rest := off % sectorSize
|
||||
have := int64(sectorSize)
|
||||
if base == int64(len(m.data))-1 {
|
||||
have = modRoundUp(m.size, sectorSize)
|
||||
}
|
||||
n = copy(b, (*m.data[base])[rest:have])
|
||||
if n < len(b) {
|
||||
// Assume reads are page aligned.
|
||||
return 0, io.ErrNoProgress
|
||||
}
|
||||
return n, nil
|
||||
}
|
||||
|
||||
func (m *memFile) WriteAt(b []byte, off int64) (n int, err error) {
|
||||
m.dataMtx.Lock()
|
||||
defer m.dataMtx.Unlock()
|
||||
|
||||
base := off / sectorSize
|
||||
rest := off % sectorSize
|
||||
for base >= int64(len(m.data)) {
|
||||
m.data = append(m.data, new([sectorSize]byte))
|
||||
}
|
||||
n = copy((*m.data[base])[rest:], b)
|
||||
if n < len(b) {
|
||||
// Assume writes are page aligned.
|
||||
return n, io.ErrShortWrite
|
||||
}
|
||||
if size := off + int64(len(b)); size > m.size {
|
||||
m.size = size
|
||||
}
|
||||
return n, nil
|
||||
}
|
||||
|
||||
func (m *memFile) Truncate(size int64) error {
|
||||
m.dataMtx.Lock()
|
||||
defer m.dataMtx.Unlock()
|
||||
return m.truncate(size)
|
||||
}
|
||||
|
||||
// +checklocks:m.dataMtx
|
||||
func (m *memFile) truncate(size int64) error {
|
||||
if size < m.size {
|
||||
base := size / sectorSize
|
||||
rest := size % sectorSize
|
||||
if rest != 0 {
|
||||
clear((*m.data[base])[rest:])
|
||||
}
|
||||
}
|
||||
sectors := divRoundUp(size, sectorSize)
|
||||
for sectors > int64(len(m.data)) {
|
||||
m.data = append(m.data, new([sectorSize]byte))
|
||||
}
|
||||
clear(m.data[sectors:])
|
||||
m.data = m.data[:sectors]
|
||||
m.size = size
|
||||
return nil
|
||||
}
|
||||
|
||||
func (*memFile) Sync(flag vfs.SyncFlag) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *memFile) Size() (int64, error) {
|
||||
m.dataMtx.RLock()
|
||||
defer m.dataMtx.RUnlock()
|
||||
return m.size, nil
|
||||
}
|
||||
|
||||
const spinWait = 25 * time.Microsecond
|
||||
|
||||
func (m *memFile) Lock(lock vfs.LockLevel) error {
|
||||
if m.lock >= lock {
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.readOnly && lock >= vfs.LOCK_RESERVED {
|
||||
return sqlite3.IOERR_LOCK
|
||||
}
|
||||
|
||||
m.lockMtx.Lock()
|
||||
defer m.lockMtx.Unlock()
|
||||
|
||||
switch lock {
|
||||
case vfs.LOCK_SHARED:
|
||||
if m.pending != nil {
|
||||
return sqlite3.BUSY
|
||||
}
|
||||
m.shared++
|
||||
|
||||
case vfs.LOCK_RESERVED:
|
||||
if m.reserved != nil {
|
||||
return sqlite3.BUSY
|
||||
}
|
||||
m.reserved = m
|
||||
|
||||
case vfs.LOCK_EXCLUSIVE:
|
||||
if m.lock < vfs.LOCK_PENDING {
|
||||
if m.pending != nil {
|
||||
return sqlite3.BUSY
|
||||
}
|
||||
m.lock = vfs.LOCK_PENDING
|
||||
m.pending = m
|
||||
}
|
||||
|
||||
for before := time.Now(); m.shared > 1; {
|
||||
if time.Since(before) > spinWait {
|
||||
return sqlite3.BUSY
|
||||
}
|
||||
m.lockMtx.Unlock()
|
||||
runtime.Gosched()
|
||||
m.lockMtx.Lock()
|
||||
}
|
||||
}
|
||||
|
||||
m.lock = lock
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *memFile) Unlock(lock vfs.LockLevel) error {
|
||||
if m.lock <= lock {
|
||||
return nil
|
||||
}
|
||||
|
||||
m.lockMtx.Lock()
|
||||
defer m.lockMtx.Unlock()
|
||||
|
||||
if m.pending == m {
|
||||
m.pending = nil
|
||||
}
|
||||
if m.reserved == m {
|
||||
m.reserved = nil
|
||||
}
|
||||
if lock < vfs.LOCK_SHARED {
|
||||
m.shared--
|
||||
}
|
||||
m.lock = lock
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *memFile) CheckReservedLock() (bool, error) {
|
||||
if m.lock >= vfs.LOCK_RESERVED {
|
||||
return true, nil
|
||||
}
|
||||
m.lockMtx.Lock()
|
||||
defer m.lockMtx.Unlock()
|
||||
return m.reserved != nil, nil
|
||||
}
|
||||
|
||||
func (*memFile) SectorSize() int {
|
||||
return sectorSize
|
||||
}
|
||||
|
||||
func (*memFile) DeviceCharacteristics() vfs.DeviceCharacteristic {
|
||||
return vfs.IOCAP_ATOMIC |
|
||||
vfs.IOCAP_SEQUENTIAL |
|
||||
vfs.IOCAP_SAFE_APPEND |
|
||||
vfs.IOCAP_POWERSAFE_OVERWRITE
|
||||
}
|
||||
|
||||
func (m *memFile) SizeHint(size int64) error {
|
||||
m.dataMtx.Lock()
|
||||
defer m.dataMtx.Unlock()
|
||||
if size > m.size {
|
||||
return m.truncate(size)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *memFile) LockState() vfs.LockLevel {
|
||||
return m.lock
|
||||
}
|
||||
|
||||
func divRoundUp(a, b int64) int64 {
|
||||
return (a + b - 1) / b
|
||||
}
|
||||
|
||||
func modRoundUp(a, b int64) int64 {
|
||||
return b - (b-a%b)%b
|
||||
}
|
BIN
vendor/github.com/ncruces/go-sqlite3/vfs/memdb/testdata/test.db
generated
vendored
Normal file
BIN
vendor/github.com/ncruces/go-sqlite3/vfs/memdb/testdata/test.db
generated
vendored
Normal file
Binary file not shown.
BIN
vendor/github.com/ncruces/go-sqlite3/vfs/memdb/testdata/wal.db
generated
vendored
Normal file
BIN
vendor/github.com/ncruces/go-sqlite3/vfs/memdb/testdata/wal.db
generated
vendored
Normal file
Binary file not shown.
1
vendor/github.com/ncruces/go-sqlite3/vfs/registry.go
generated
vendored
1
vendor/github.com/ncruces/go-sqlite3/vfs/registry.go
generated
vendored
|
@ -23,6 +23,7 @@ func Find(name string) VFS {
|
|||
}
|
||||
|
||||
// Register registers a VFS.
|
||||
// Empty and "os" are reserved names.
|
||||
//
|
||||
// https://sqlite.org/c3ref/vfs_find.html
|
||||
func Register(name string, vfs VFS) {
|
||||
|
|
2
vendor/github.com/ncruces/go-sqlite3/vfs/shm.go
generated
vendored
2
vendor/github.com/ncruces/go-sqlite3/vfs/shm.go
generated
vendored
|
@ -33,6 +33,8 @@ const (
|
|||
_SHM_DMS = _SHM_BASE + _SHM_NLOCK
|
||||
)
|
||||
|
||||
func (f *vfsFile) SharedMemory() SharedMemory { return f }
|
||||
|
||||
func (f *vfsFile) shmMap(ctx context.Context, mod api.Module, id, size int32, extend bool) (uint32, error) {
|
||||
// Ensure size is a multiple of the OS page size.
|
||||
if int(size)&(unix.Getpagesize()-1) != 0 {
|
||||
|
|
43
vendor/github.com/ncruces/go-sqlite3/vfs/vfs.go
generated
vendored
43
vendor/github.com/ncruces/go-sqlite3/vfs/vfs.go
generated
vendored
|
@ -143,7 +143,10 @@ func vfsOpen(ctx context.Context, mod api.Module, pVfs, zPath, pFile uint32, fla
|
|||
var err error
|
||||
var parsed bool
|
||||
var params url.Values
|
||||
if pfs, ok := vfs.(VFSParams); ok {
|
||||
if jfs, ok := vfs.(VFSJournal); ok && flags&(OPEN_WAL|OPEN_MAIN_JOURNAL) != 0 {
|
||||
db := vfsDatabaseFileObject(ctx, mod, zPath)
|
||||
file, flags, err = jfs.OpenJournal(path, flags, db)
|
||||
} else if pfs, ok := vfs.(VFSParams); ok {
|
||||
parsed = true
|
||||
params = vfsURIParameters(ctx, mod, zPath, flags)
|
||||
file, flags, err = pfs.OpenParams(path, flags, params)
|
||||
|
@ -167,8 +170,12 @@ func vfsOpen(ctx context.Context, mod api.Module, pVfs, zPath, pFile uint32, fla
|
|||
if pOutFlags != 0 {
|
||||
util.WriteUint32(mod, pOutFlags, uint32(flags))
|
||||
}
|
||||
if pOutVFS != 0 && util.CanMap(ctx) {
|
||||
util.WriteUint32(mod, pOutVFS, 1)
|
||||
if pOutVFS != 0 && util.CanMapFiles(ctx) {
|
||||
if f, ok := file.(FileSharedMemory); ok {
|
||||
if f.SharedMemory() != nil {
|
||||
util.WriteUint32(mod, pOutVFS, 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
vfsFileRegister(ctx, mod, pFile, file)
|
||||
return _OK
|
||||
|
@ -361,7 +368,7 @@ func vfsShmBarrier(ctx context.Context, mod api.Module, pFile uint32) {
|
|||
}
|
||||
|
||||
func vfsShmMap(ctx context.Context, mod api.Module, pFile uint32, iRegion, szRegion int32, bExtend, pp uint32) _ErrorCode {
|
||||
file := vfsFileGet(ctx, mod, pFile).(fileShm)
|
||||
file := vfsFileGet(ctx, mod, pFile).(FileSharedMemory).SharedMemory()
|
||||
p, err := file.shmMap(ctx, mod, iRegion, szRegion, bExtend != 0)
|
||||
if err != nil {
|
||||
return vfsErrorCode(err, _IOERR_SHMMAP)
|
||||
|
@ -371,30 +378,31 @@ func vfsShmMap(ctx context.Context, mod api.Module, pFile uint32, iRegion, szReg
|
|||
}
|
||||
|
||||
func vfsShmLock(ctx context.Context, mod api.Module, pFile uint32, offset, n int32, flags _ShmFlag) _ErrorCode {
|
||||
file := vfsFileGet(ctx, mod, pFile).(fileShm)
|
||||
file := vfsFileGet(ctx, mod, pFile).(FileSharedMemory).SharedMemory()
|
||||
err := file.shmLock(offset, n, flags)
|
||||
return vfsErrorCode(err, _IOERR_SHMLOCK)
|
||||
}
|
||||
|
||||
func vfsShmUnmap(ctx context.Context, mod api.Module, pFile, bDelete uint32) _ErrorCode {
|
||||
file := vfsFileGet(ctx, mod, pFile).(fileShm)
|
||||
file := vfsFileGet(ctx, mod, pFile).(FileSharedMemory).SharedMemory()
|
||||
file.shmUnmap(bDelete != 0)
|
||||
return _OK
|
||||
}
|
||||
|
||||
func vfsURIParameters(ctx context.Context, mod api.Module, zPath uint32, flags OpenFlag) url.Values {
|
||||
if flags&OPEN_URI == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
uriParam := mod.ExportedFunction("sqlite3_uri_parameter")
|
||||
uriKey := mod.ExportedFunction("sqlite3_uri_key")
|
||||
if uriParam == nil || uriKey == nil {
|
||||
switch {
|
||||
case flags&(OPEN_URI|OPEN_MAIN_DB) == OPEN_URI|OPEN_MAIN_DB:
|
||||
// database file with URI
|
||||
case flags&(OPEN_WAL|OPEN_MAIN_JOURNAL) != 0:
|
||||
// journal or WAL file
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
|
||||
var stack [2]uint64
|
||||
var params url.Values
|
||||
uriKey := mod.ExportedFunction("sqlite3_uri_key")
|
||||
uriParam := mod.ExportedFunction("sqlite3_uri_parameter")
|
||||
|
||||
for i := 0; ; i++ {
|
||||
stack[1] = uint64(i)
|
||||
|
@ -422,6 +430,15 @@ func vfsURIParameters(ctx context.Context, mod api.Module, zPath uint32, flags O
|
|||
}
|
||||
}
|
||||
|
||||
func vfsDatabaseFileObject(ctx context.Context, mod api.Module, zPath uint32) File {
|
||||
stack := [...]uint64{uint64(zPath)}
|
||||
fn := mod.ExportedFunction("sqlite3_database_file_object")
|
||||
if err := fn.CallWithStack(ctx, stack[:]); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return vfsFileGet(ctx, mod, uint32(stack[0]))
|
||||
}
|
||||
|
||||
func vfsGet(mod api.Module, pVfs uint32) VFS {
|
||||
var name string
|
||||
if pVfs != 0 {
|
||||
|
|
15
vendor/github.com/ncruces/go-strftime/.gitignore
generated
vendored
Normal file
15
vendor/github.com/ncruces/go-strftime/.gitignore
generated
vendored
Normal file
|
@ -0,0 +1,15 @@
|
|||
# Binaries for programs and plugins
|
||||
*.exe
|
||||
*.exe~
|
||||
*.dll
|
||||
*.so
|
||||
*.dylib
|
||||
|
||||
# Test binary, built with `go test -c`
|
||||
*.test
|
||||
|
||||
# Output of the go coverage tool, specifically when used with LiteIDE
|
||||
*.out
|
||||
|
||||
# Dependency directories (remove the comment below to include it)
|
||||
# vendor/
|
21
vendor/github.com/ncruces/go-strftime/LICENSE
generated
vendored
Normal file
21
vendor/github.com/ncruces/go-strftime/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2022 Nuno Cruces
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
5
vendor/github.com/ncruces/go-strftime/README.md
generated
vendored
Normal file
5
vendor/github.com/ncruces/go-strftime/README.md
generated
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
# `strftime`/`strptime` compatible time formatting and parsing for Go
|
||||
|
||||
[![Go Reference](https://pkg.go.dev/badge/image)](https://pkg.go.dev/github.com/ncruces/go-strftime)
|
||||
[![Go Report](https://goreportcard.com/badge/github.com/ncruces/go-strftime)](https://goreportcard.com/report/github.com/ncruces/go-strftime)
|
||||
[![Go Coverage](https://github.com/ncruces/go-strftime/wiki/coverage.svg)](https://raw.githack.com/wiki/ncruces/go-strftime/coverage.html)
|
107
vendor/github.com/ncruces/go-strftime/parser.go
generated
vendored
Normal file
107
vendor/github.com/ncruces/go-strftime/parser.go
generated
vendored
Normal file
|
@ -0,0 +1,107 @@
|
|||
package strftime
|
||||
|
||||
import "unicode/utf8"
|
||||
|
||||
type parser struct {
|
||||
format func(spec, flag byte) error
|
||||
literal func(byte) error
|
||||
}
|
||||
|
||||
func (p *parser) parse(fmt string) error {
|
||||
const (
|
||||
initial = iota
|
||||
percent
|
||||
flagged
|
||||
modified
|
||||
)
|
||||
|
||||
var flag, modifier byte
|
||||
var err error
|
||||
state := initial
|
||||
start := 0
|
||||
for i, b := range []byte(fmt) {
|
||||
switch state {
|
||||
default:
|
||||
if b == '%' {
|
||||
state = percent
|
||||
start = i
|
||||
continue
|
||||
}
|
||||
err = p.literal(b)
|
||||
|
||||
case percent:
|
||||
if b == '-' || b == ':' {
|
||||
state = flagged
|
||||
flag = b
|
||||
continue
|
||||
}
|
||||
if b == 'E' || b == 'O' {
|
||||
state = modified
|
||||
modifier = b
|
||||
flag = 0
|
||||
continue
|
||||
}
|
||||
err = p.format(b, 0)
|
||||
state = initial
|
||||
|
||||
case flagged:
|
||||
if b == 'E' || b == 'O' {
|
||||
state = modified
|
||||
modifier = b
|
||||
continue
|
||||
}
|
||||
err = p.format(b, flag)
|
||||
state = initial
|
||||
|
||||
case modified:
|
||||
if okModifier(modifier, b) {
|
||||
err = p.format(b, flag)
|
||||
} else {
|
||||
err = p.literals(fmt[start : i+1])
|
||||
}
|
||||
state = initial
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
if err, ok := err.(formatError); ok {
|
||||
err.setDirective(fmt, start, i)
|
||||
return err
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if state != initial {
|
||||
return p.literals(fmt[start:])
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *parser) literals(literal string) error {
|
||||
for _, b := range []byte(literal) {
|
||||
if err := p.literal(b); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type literalErr string
|
||||
|
||||
func (e literalErr) Error() string {
|
||||
return "strftime: unsupported literal: " + string(e)
|
||||
}
|
||||
|
||||
type formatError struct {
|
||||
message string
|
||||
directive string
|
||||
}
|
||||
|
||||
func (e formatError) Error() string {
|
||||
return "strftime: unsupported directive: " + e.directive + " " + e.message
|
||||
}
|
||||
|
||||
func (e *formatError) setDirective(str string, i, j int) {
|
||||
_, n := utf8.DecodeRuneInString(str[j:])
|
||||
e.directive = str[i : j+n]
|
||||
}
|
96
vendor/github.com/ncruces/go-strftime/pkg.go
generated
vendored
Normal file
96
vendor/github.com/ncruces/go-strftime/pkg.go
generated
vendored
Normal file
|
@ -0,0 +1,96 @@
|
|||
/*
|
||||
Package strftime provides strftime/strptime compatible time formatting and parsing.
|
||||
|
||||
The following specifiers are available:
|
||||
|
||||
Date (Year, Month, Day):
|
||||
%Y - Year with century (can be negative, 4 digits at least)
|
||||
-0001, 0000, 1995, 2009, 14292, etc.
|
||||
%C - year / 100 (round down, 20 in 2009)
|
||||
%y - year % 100 (00..99)
|
||||
|
||||
%m - Month of the year, zero-padded (01..12)
|
||||
%-m no-padded (1..12)
|
||||
%B - Full month name (January)
|
||||
%b - Abbreviated month name (Jan)
|
||||
%h - Equivalent to %b
|
||||
|
||||
%d - Day of the month, zero-padded (01..31)
|
||||
%-d no-padded (1..31)
|
||||
%e - Day of the month, blank-padded ( 1..31)
|
||||
|
||||
%j - Day of the year (001..366)
|
||||
%-j no-padded (1..366)
|
||||
|
||||
Time (Hour, Minute, Second, Subsecond):
|
||||
%H - Hour of the day, 24-hour clock, zero-padded (00..23)
|
||||
%-H no-padded (0..23)
|
||||
%k - Hour of the day, 24-hour clock, blank-padded ( 0..23)
|
||||
%I - Hour of the day, 12-hour clock, zero-padded (01..12)
|
||||
%-I no-padded (1..12)
|
||||
%l - Hour of the day, 12-hour clock, blank-padded ( 1..12)
|
||||
%P - Meridian indicator, lowercase (am or pm)
|
||||
%p - Meridian indicator, uppercase (AM or PM)
|
||||
|
||||
%M - Minute of the hour (00..59)
|
||||
%-M no-padded (0..59)
|
||||
|
||||
%S - Second of the minute (00..60)
|
||||
%-S no-padded (0..60)
|
||||
|
||||
%L - Millisecond of the second (000..999)
|
||||
%f - Microsecond of the second (000000..999999)
|
||||
%N - Nanosecond of the second (000000000..999999999)
|
||||
|
||||
Time zone:
|
||||
%z - Time zone as hour and minute offset from UTC (e.g. +0900)
|
||||
%:z - hour and minute offset from UTC with a colon (e.g. +09:00)
|
||||
%Z - Time zone abbreviation (e.g. MST)
|
||||
|
||||
Weekday:
|
||||
%A - Full weekday name (Sunday)
|
||||
%a - Abbreviated weekday name (Sun)
|
||||
%u - Day of the week (Monday is 1, 1..7)
|
||||
%w - Day of the week (Sunday is 0, 0..6)
|
||||
|
||||
ISO 8601 week-based year and week number:
|
||||
Week 1 of YYYY starts with a Monday and includes YYYY-01-04.
|
||||
The days in the year before the first week are in the last week of
|
||||
the previous year.
|
||||
%G - Week-based year
|
||||
%g - Last 2 digits of the week-based year (00..99)
|
||||
%V - Week number of the week-based year (01..53)
|
||||
%-V no-padded (1..53)
|
||||
|
||||
Week number:
|
||||
Week 1 of YYYY starts with a Sunday or Monday (according to %U or %W).
|
||||
The days in the year before the first week are in week 0.
|
||||
%U - Week number of the year. The week starts with Sunday. (00..53)
|
||||
%-U no-padded (0..53)
|
||||
%W - Week number of the year. The week starts with Monday. (00..53)
|
||||
%-W no-padded (0..53)
|
||||
|
||||
Seconds since the Unix Epoch:
|
||||
%s - Number of seconds since 1970-01-01 00:00:00 UTC.
|
||||
%Q - Number of milliseconds since 1970-01-01 00:00:00 UTC.
|
||||
|
||||
Literal string:
|
||||
%n - Newline character (\n)
|
||||
%t - Tab character (\t)
|
||||
%% - Literal % character
|
||||
|
||||
Combination:
|
||||
%c - date and time (%a %b %e %T %Y)
|
||||
%D - Date (%m/%d/%y)
|
||||
%F - ISO 8601 date format (%Y-%m-%d)
|
||||
%v - VMS date (%e-%b-%Y)
|
||||
%x - Same as %D
|
||||
%X - Same as %T
|
||||
%r - 12-hour time (%I:%M:%S %p)
|
||||
%R - 24-hour time (%H:%M)
|
||||
%T - 24-hour time (%H:%M:%S)
|
||||
%+ - date(1) (%a %b %e %H:%M:%S %Z %Y)
|
||||
|
||||
The modifiers ``E'' and ``O'' are ignored.
|
||||
*/
|
||||
package strftime
|
241
vendor/github.com/ncruces/go-strftime/specifiers.go
generated
vendored
Normal file
241
vendor/github.com/ncruces/go-strftime/specifiers.go
generated
vendored
Normal file
|
@ -0,0 +1,241 @@
|
|||
package strftime
|
||||
|
||||
import "strings"
|
||||
|
||||
// https://strftime.org/
|
||||
func goLayout(spec, flag byte, parsing bool) string {
|
||||
switch spec {
|
||||
default:
|
||||
return ""
|
||||
|
||||
case 'B':
|
||||
return "January"
|
||||
case 'b', 'h':
|
||||
return "Jan"
|
||||
case 'm':
|
||||
if flag == '-' || parsing {
|
||||
return "1"
|
||||
}
|
||||
return "01"
|
||||
case 'A':
|
||||
return "Monday"
|
||||
case 'a':
|
||||
return "Mon"
|
||||
case 'e':
|
||||
return "_2"
|
||||
case 'd':
|
||||
if flag == '-' || parsing {
|
||||
return "2"
|
||||
}
|
||||
return "02"
|
||||
case 'j':
|
||||
if flag == '-' {
|
||||
if parsing {
|
||||
return "__2"
|
||||
}
|
||||
return ""
|
||||
}
|
||||
return "002"
|
||||
case 'I':
|
||||
if flag == '-' || parsing {
|
||||
return "3"
|
||||
}
|
||||
return "03"
|
||||
case 'H':
|
||||
if flag == '-' && !parsing {
|
||||
return ""
|
||||
}
|
||||
return "15"
|
||||
case 'M':
|
||||
if flag == '-' || parsing {
|
||||
return "4"
|
||||
}
|
||||
return "04"
|
||||
case 'S':
|
||||
if flag == '-' || parsing {
|
||||
return "5"
|
||||
}
|
||||
return "05"
|
||||
case 'y':
|
||||
return "06"
|
||||
case 'Y':
|
||||
return "2006"
|
||||
case 'p':
|
||||
return "PM"
|
||||
case 'P':
|
||||
return "pm"
|
||||
case 'Z':
|
||||
return "MST"
|
||||
case 'z':
|
||||
if flag == ':' {
|
||||
if parsing {
|
||||
return "Z07:00"
|
||||
}
|
||||
return "-07:00"
|
||||
}
|
||||
if parsing {
|
||||
return "Z0700"
|
||||
}
|
||||
return "-0700"
|
||||
|
||||
case '+':
|
||||
if parsing {
|
||||
return "Mon Jan _2 15:4:5 MST 2006"
|
||||
}
|
||||
return "Mon Jan _2 15:04:05 MST 2006"
|
||||
case 'c':
|
||||
if parsing {
|
||||
return "Mon Jan _2 15:4:5 2006"
|
||||
}
|
||||
return "Mon Jan _2 15:04:05 2006"
|
||||
case 'v':
|
||||
return "_2-Jan-2006"
|
||||
case 'F':
|
||||
if parsing {
|
||||
return "2006-1-2"
|
||||
}
|
||||
return "2006-01-02"
|
||||
case 'D', 'x':
|
||||
if parsing {
|
||||
return "1/2/06"
|
||||
}
|
||||
return "01/02/06"
|
||||
case 'r':
|
||||
if parsing {
|
||||
return "3:4:5 PM"
|
||||
}
|
||||
return "03:04:05 PM"
|
||||
case 'T', 'X':
|
||||
if parsing {
|
||||
return "15:4:5"
|
||||
}
|
||||
return "15:04:05"
|
||||
case 'R':
|
||||
if parsing {
|
||||
return "15:4"
|
||||
}
|
||||
return "15:04"
|
||||
|
||||
case '%':
|
||||
return "%"
|
||||
case 't':
|
||||
return "\t"
|
||||
case 'n':
|
||||
return "\n"
|
||||
}
|
||||
}
|
||||
|
||||
// https://nsdateformatter.com/
|
||||
func uts35Pattern(spec, flag byte) string {
|
||||
switch spec {
|
||||
default:
|
||||
return ""
|
||||
|
||||
case 'B':
|
||||
return "MMMM"
|
||||
case 'b', 'h':
|
||||
return "MMM"
|
||||
case 'm':
|
||||
if flag == '-' {
|
||||
return "M"
|
||||
}
|
||||
return "MM"
|
||||
case 'A':
|
||||
return "EEEE"
|
||||
case 'a':
|
||||
return "E"
|
||||
case 'd':
|
||||
if flag == '-' {
|
||||
return "d"
|
||||
}
|
||||
return "dd"
|
||||
case 'j':
|
||||
if flag == '-' {
|
||||
return "D"
|
||||
}
|
||||
return "DDD"
|
||||
case 'I':
|
||||
if flag == '-' {
|
||||
return "h"
|
||||
}
|
||||
return "hh"
|
||||
case 'H':
|
||||
if flag == '-' {
|
||||
return "H"
|
||||
}
|
||||
return "HH"
|
||||
case 'M':
|
||||
if flag == '-' {
|
||||
return "m"
|
||||
}
|
||||
return "mm"
|
||||
case 'S':
|
||||
if flag == '-' {
|
||||
return "s"
|
||||
}
|
||||
return "ss"
|
||||
case 'y':
|
||||
return "yy"
|
||||
case 'Y':
|
||||
return "yyyy"
|
||||
case 'g':
|
||||
return "YY"
|
||||
case 'G':
|
||||
return "YYYY"
|
||||
case 'V':
|
||||
if flag == '-' {
|
||||
return "w"
|
||||
}
|
||||
return "ww"
|
||||
case 'p':
|
||||
return "a"
|
||||
case 'Z':
|
||||
return "zzz"
|
||||
case 'z':
|
||||
if flag == ':' {
|
||||
return "xxx"
|
||||
}
|
||||
return "xx"
|
||||
case 'L':
|
||||
return "SSS"
|
||||
case 'f':
|
||||
return "SSSSSS"
|
||||
case 'N':
|
||||
return "SSSSSSSSS"
|
||||
|
||||
case '+':
|
||||
return "E MMM d HH:mm:ss zzz yyyy"
|
||||
case 'c':
|
||||
return "E MMM d HH:mm:ss yyyy"
|
||||
case 'v':
|
||||
return "d-MMM-yyyy"
|
||||
case 'F':
|
||||
return "yyyy-MM-dd"
|
||||
case 'D', 'x':
|
||||
return "MM/dd/yy"
|
||||
case 'r':
|
||||
return "hh:mm:ss a"
|
||||
case 'T', 'X':
|
||||
return "HH:mm:ss"
|
||||
case 'R':
|
||||
return "HH:mm"
|
||||
|
||||
case '%':
|
||||
return "%"
|
||||
case 't':
|
||||
return "\t"
|
||||
case 'n':
|
||||
return "\n"
|
||||
}
|
||||
}
|
||||
|
||||
// http://man.he.net/man3/strftime
|
||||
func okModifier(mod, spec byte) bool {
|
||||
if mod == 'E' {
|
||||
return strings.Contains("cCxXyY", string(spec))
|
||||
}
|
||||
if mod == 'O' {
|
||||
return strings.Contains("deHImMSuUVwWy", string(spec))
|
||||
}
|
||||
return false
|
||||
}
|
324
vendor/github.com/ncruces/go-strftime/strftime.go
generated
vendored
Normal file
324
vendor/github.com/ncruces/go-strftime/strftime.go
generated
vendored
Normal file
|
@ -0,0 +1,324 @@
|
|||
package strftime
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"strconv"
|
||||
"time"
|
||||
)
|
||||
|
||||
// Format returns a textual representation of the time value
|
||||
// formatted according to the strftime format specification.
|
||||
func Format(fmt string, t time.Time) string {
|
||||
buf := buffer(fmt)
|
||||
return string(AppendFormat(buf, fmt, t))
|
||||
}
|
||||
|
||||
// AppendFormat is like Format, but appends the textual representation
|
||||
// to dst and returns the extended buffer.
|
||||
func AppendFormat(dst []byte, fmt string, t time.Time) []byte {
|
||||
var parser parser
|
||||
|
||||
parser.literal = func(b byte) error {
|
||||
dst = append(dst, b)
|
||||
return nil
|
||||
}
|
||||
|
||||
parser.format = func(spec, flag byte) error {
|
||||
switch spec {
|
||||
case 'A':
|
||||
dst = append(dst, t.Weekday().String()...)
|
||||
return nil
|
||||
case 'a':
|
||||
dst = append(dst, t.Weekday().String()[:3]...)
|
||||
return nil
|
||||
case 'B':
|
||||
dst = append(dst, t.Month().String()...)
|
||||
return nil
|
||||
case 'b', 'h':
|
||||
dst = append(dst, t.Month().String()[:3]...)
|
||||
return nil
|
||||
case 'm':
|
||||
dst = appendInt2(dst, int(t.Month()), flag)
|
||||
return nil
|
||||
case 'd':
|
||||
dst = appendInt2(dst, int(t.Day()), flag)
|
||||
return nil
|
||||
case 'e':
|
||||
dst = appendInt2(dst, int(t.Day()), ' ')
|
||||
return nil
|
||||
case 'I':
|
||||
dst = append12Hour(dst, t, flag)
|
||||
return nil
|
||||
case 'l':
|
||||
dst = append12Hour(dst, t, ' ')
|
||||
return nil
|
||||
case 'H':
|
||||
dst = appendInt2(dst, t.Hour(), flag)
|
||||
return nil
|
||||
case 'k':
|
||||
dst = appendInt2(dst, t.Hour(), ' ')
|
||||
return nil
|
||||
case 'M':
|
||||
dst = appendInt2(dst, t.Minute(), flag)
|
||||
return nil
|
||||
case 'S':
|
||||
dst = appendInt2(dst, t.Second(), flag)
|
||||
return nil
|
||||
case 'L':
|
||||
dst = append(dst, t.Format(".000")[1:]...)
|
||||
return nil
|
||||
case 'f':
|
||||
dst = append(dst, t.Format(".000000")[1:]...)
|
||||
return nil
|
||||
case 'N':
|
||||
dst = append(dst, t.Format(".000000000")[1:]...)
|
||||
return nil
|
||||
case 'y':
|
||||
dst = t.AppendFormat(dst, "06")
|
||||
return nil
|
||||
case 'Y':
|
||||
dst = t.AppendFormat(dst, "2006")
|
||||
return nil
|
||||
case 'C':
|
||||
dst = t.AppendFormat(dst, "2006")
|
||||
dst = dst[:len(dst)-2]
|
||||
return nil
|
||||
case 'U':
|
||||
dst = appendWeekNumber(dst, t, flag, true)
|
||||
return nil
|
||||
case 'W':
|
||||
dst = appendWeekNumber(dst, t, flag, false)
|
||||
return nil
|
||||
case 'V':
|
||||
_, w := t.ISOWeek()
|
||||
dst = appendInt2(dst, w, flag)
|
||||
return nil
|
||||
case 'g':
|
||||
y, _ := t.ISOWeek()
|
||||
dst = year(y).AppendFormat(dst, "06")
|
||||
return nil
|
||||
case 'G':
|
||||
y, _ := t.ISOWeek()
|
||||
dst = year(y).AppendFormat(dst, "2006")
|
||||
return nil
|
||||
case 's':
|
||||
dst = strconv.AppendInt(dst, t.Unix(), 10)
|
||||
return nil
|
||||
case 'Q':
|
||||
dst = strconv.AppendInt(dst, t.UnixMilli(), 10)
|
||||
return nil
|
||||
case 'w':
|
||||
w := t.Weekday()
|
||||
dst = appendInt1(dst, int(w))
|
||||
return nil
|
||||
case 'u':
|
||||
if w := t.Weekday(); w == 0 {
|
||||
dst = append(dst, '7')
|
||||
} else {
|
||||
dst = appendInt1(dst, int(w))
|
||||
}
|
||||
return nil
|
||||
case 'j':
|
||||
if flag == '-' {
|
||||
dst = strconv.AppendInt(dst, int64(t.YearDay()), 10)
|
||||
} else {
|
||||
dst = t.AppendFormat(dst, "002")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
if layout := goLayout(spec, flag, false); layout != "" {
|
||||
dst = t.AppendFormat(dst, layout)
|
||||
return nil
|
||||
}
|
||||
|
||||
dst = append(dst, '%')
|
||||
if flag != 0 {
|
||||
dst = append(dst, flag)
|
||||
}
|
||||
dst = append(dst, spec)
|
||||
return nil
|
||||
}
|
||||
|
||||
parser.parse(fmt)
|
||||
return dst
|
||||
}
|
||||
|
||||
// Parse converts a textual representation of time to the time value it represents
|
||||
// according to the strptime format specification.
|
||||
func Parse(fmt, value string) (time.Time, error) {
|
||||
pattern, err := layout(fmt, true)
|
||||
if err != nil {
|
||||
return time.Time{}, err
|
||||
}
|
||||
return time.Parse(pattern, value)
|
||||
}
|
||||
|
||||
// Layout converts a strftime format specification
|
||||
// to a Go time pattern specification.
|
||||
func Layout(fmt string) (string, error) {
|
||||
return layout(fmt, false)
|
||||
}
|
||||
|
||||
func layout(fmt string, parsing bool) (string, error) {
|
||||
dst := buffer(fmt)
|
||||
var parser parser
|
||||
|
||||
parser.literal = func(b byte) error {
|
||||
if '0' <= b && b <= '9' {
|
||||
return literalErr(b)
|
||||
}
|
||||
dst = append(dst, b)
|
||||
if b == 'M' || b == 'T' || b == 'm' || b == 'n' {
|
||||
switch {
|
||||
case bytes.HasSuffix(dst, []byte("Jan")):
|
||||
return literalErr("Jan")
|
||||
case bytes.HasSuffix(dst, []byte("Mon")):
|
||||
return literalErr("Mon")
|
||||
case bytes.HasSuffix(dst, []byte("MST")):
|
||||
return literalErr("MST")
|
||||
case bytes.HasSuffix(dst, []byte("PM")):
|
||||
return literalErr("PM")
|
||||
case bytes.HasSuffix(dst, []byte("pm")):
|
||||
return literalErr("pm")
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
parser.format = func(spec, flag byte) error {
|
||||
if layout := goLayout(spec, flag, parsing); layout != "" {
|
||||
dst = append(dst, layout...)
|
||||
return nil
|
||||
}
|
||||
|
||||
switch spec {
|
||||
default:
|
||||
return formatError{}
|
||||
|
||||
case 'L', 'f', 'N':
|
||||
if bytes.HasSuffix(dst, []byte(".")) || bytes.HasSuffix(dst, []byte(",")) {
|
||||
switch spec {
|
||||
default:
|
||||
dst = append(dst, "000"...)
|
||||
case 'f':
|
||||
dst = append(dst, "000000"...)
|
||||
case 'N':
|
||||
dst = append(dst, "000000000"...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
return formatError{message: "must follow '.' or ','"}
|
||||
}
|
||||
}
|
||||
|
||||
if err := parser.parse(fmt); err != nil {
|
||||
return "", err
|
||||
}
|
||||
return string(dst), nil
|
||||
}
|
||||
|
||||
// UTS35 converts a strftime format specification
|
||||
// to a Unicode Technical Standard #35 Date Format Pattern.
|
||||
func UTS35(fmt string) (string, error) {
|
||||
const quote = '\''
|
||||
var quoted bool
|
||||
dst := buffer(fmt)
|
||||
|
||||
var parser parser
|
||||
|
||||
parser.literal = func(b byte) error {
|
||||
if b == quote {
|
||||
dst = append(dst, quote, quote)
|
||||
return nil
|
||||
}
|
||||
if !quoted && ('a' <= b && b <= 'z' || 'A' <= b && b <= 'Z') {
|
||||
dst = append(dst, quote)
|
||||
quoted = true
|
||||
}
|
||||
dst = append(dst, b)
|
||||
return nil
|
||||
}
|
||||
|
||||
parser.format = func(spec, flag byte) error {
|
||||
if quoted {
|
||||
dst = append(dst, quote)
|
||||
quoted = false
|
||||
}
|
||||
if pattern := uts35Pattern(spec, flag); pattern != "" {
|
||||
dst = append(dst, pattern...)
|
||||
return nil
|
||||
}
|
||||
return formatError{}
|
||||
}
|
||||
|
||||
if err := parser.parse(fmt); err != nil {
|
||||
return "", err
|
||||
}
|
||||
if quoted {
|
||||
dst = append(dst, quote)
|
||||
}
|
||||
return string(dst), nil
|
||||
}
|
||||
|
||||
func buffer(format string) (buf []byte) {
|
||||
const bufSize = 64
|
||||
max := len(format) + 10
|
||||
if max < bufSize {
|
||||
var b [bufSize]byte
|
||||
buf = b[:0]
|
||||
} else {
|
||||
buf = make([]byte, 0, max)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func year(y int) time.Time {
|
||||
return time.Date(y, time.January, 1, 0, 0, 0, 0, time.UTC)
|
||||
}
|
||||
|
||||
func appendWeekNumber(dst []byte, t time.Time, flag byte, sunday bool) []byte {
|
||||
offset := int(t.Weekday())
|
||||
if sunday {
|
||||
offset = 6 - offset
|
||||
} else if offset != 0 {
|
||||
offset = 7 - offset
|
||||
}
|
||||
return appendInt2(dst, (t.YearDay()+offset)/7, flag)
|
||||
}
|
||||
|
||||
func append12Hour(dst []byte, t time.Time, flag byte) []byte {
|
||||
h := t.Hour()
|
||||
if h == 0 {
|
||||
h = 12
|
||||
} else if h > 12 {
|
||||
h -= 12
|
||||
}
|
||||
return appendInt2(dst, h, flag)
|
||||
}
|
||||
|
||||
func appendInt1(dst []byte, i int) []byte {
|
||||
return append(dst, byte('0'+i))
|
||||
}
|
||||
|
||||
func appendInt2(dst []byte, i int, flag byte) []byte {
|
||||
if flag == 0 || i >= 10 {
|
||||
return append(dst, smallsString[i*2:i*2+2]...)
|
||||
}
|
||||
if flag == ' ' {
|
||||
dst = append(dst, flag)
|
||||
}
|
||||
return appendInt1(dst, i)
|
||||
}
|
||||
|
||||
const smallsString = "" +
|
||||
"00010203040506070809" +
|
||||
"10111213141516171819" +
|
||||
"20212223242526272829" +
|
||||
"30313233343536373839" +
|
||||
"40414243444546474849" +
|
||||
"50515253545556575859" +
|
||||
"60616263646566676869" +
|
||||
"70717273747576777879" +
|
||||
"80818283848586878889" +
|
||||
"90919293949596979899"
|
27
vendor/github.com/remyoudompheng/bigfft/LICENSE
generated
vendored
Normal file
27
vendor/github.com/remyoudompheng/bigfft/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,27 @@
|
|||
Copyright (c) 2012 The Go Authors. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of Google Inc. nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
54
vendor/github.com/remyoudompheng/bigfft/README
generated
vendored
Normal file
54
vendor/github.com/remyoudompheng/bigfft/README
generated
vendored
Normal file
|
@ -0,0 +1,54 @@
|
|||
This library is a toy proof-of-concept implementation of the
|
||||
well-known Schonhage-Strassen method for multiplying integers.
|
||||
It is not expected to have a real life usecase outside number
|
||||
theory computations, nor is it expected to be used in any production
|
||||
system.
|
||||
|
||||
If you are using it in your project, you may want to carefully
|
||||
examine the actual requirement or problem you are trying to solve.
|
||||
|
||||
# Comparison with the standard library and GMP
|
||||
|
||||
Benchmarking math/big vs. bigfft
|
||||
|
||||
Number size old ns/op new ns/op delta
|
||||
1kb 1599 1640 +2.56%
|
||||
10kb 61533 62170 +1.04%
|
||||
50kb 833693 831051 -0.32%
|
||||
100kb 2567995 2693864 +4.90%
|
||||
1Mb 105237800 28446400 -72.97%
|
||||
5Mb 1272947000 168554600 -86.76%
|
||||
10Mb 3834354000 405120200 -89.43%
|
||||
20Mb 11514488000 845081600 -92.66%
|
||||
50Mb 49199945000 2893950000 -94.12%
|
||||
100Mb 147599836000 5921594000 -95.99%
|
||||
|
||||
Benchmarking GMP vs bigfft
|
||||
|
||||
Number size GMP ns/op Go ns/op delta
|
||||
1kb 536 1500 +179.85%
|
||||
10kb 26669 50777 +90.40%
|
||||
50kb 252270 658534 +161.04%
|
||||
100kb 686813 2127534 +209.77%
|
||||
1Mb 12100000 22391830 +85.06%
|
||||
5Mb 111731843 133550600 +19.53%
|
||||
10Mb 212314000 318595800 +50.06%
|
||||
20Mb 490196000 671512800 +36.99%
|
||||
50Mb 1280000000 2451476000 +91.52%
|
||||
100Mb 2673000000 5228991000 +95.62%
|
||||
|
||||
Benchmarks were run on a Core 2 Quad Q8200 (2.33GHz).
|
||||
FFT is enabled when input numbers are over 200kbits.
|
||||
|
||||
Scanning large decimal number from strings.
|
||||
(math/big [n^2 complexity] vs bigfft [n^1.6 complexity], Core i5-4590)
|
||||
|
||||
Digits old ns/op new ns/op delta
|
||||
1e3 9995 10876 +8.81%
|
||||
1e4 175356 243806 +39.03%
|
||||
1e5 9427422 6780545 -28.08%
|
||||
1e6 1776707489 144867502 -91.85%
|
||||
2e6 6865499995 346540778 -94.95%
|
||||
5e6 42641034189 1069878799 -97.49%
|
||||
10e6 151975273589 2693328580 -98.23%
|
||||
|
33
vendor/github.com/remyoudompheng/bigfft/arith_decl.go
generated
vendored
Normal file
33
vendor/github.com/remyoudompheng/bigfft/arith_decl.go
generated
vendored
Normal file
|
@ -0,0 +1,33 @@
|
|||
// Copyright 2010 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package bigfft
|
||||
|
||||
import (
|
||||
"math/big"
|
||||
_ "unsafe"
|
||||
)
|
||||
|
||||
type Word = big.Word
|
||||
|
||||
//go:linkname addVV math/big.addVV
|
||||
func addVV(z, x, y []Word) (c Word)
|
||||
|
||||
//go:linkname subVV math/big.subVV
|
||||
func subVV(z, x, y []Word) (c Word)
|
||||
|
||||
//go:linkname addVW math/big.addVW
|
||||
func addVW(z, x []Word, y Word) (c Word)
|
||||
|
||||
//go:linkname subVW math/big.subVW
|
||||
func subVW(z, x []Word, y Word) (c Word)
|
||||
|
||||
//go:linkname shlVU math/big.shlVU
|
||||
func shlVU(z, x []Word, s uint) (c Word)
|
||||
|
||||
//go:linkname mulAddVWW math/big.mulAddVWW
|
||||
func mulAddVWW(z, x []Word, y, r Word) (c Word)
|
||||
|
||||
//go:linkname addMulVVW math/big.addMulVVW
|
||||
func addMulVVW(z, x []Word, y Word) (c Word)
|
216
vendor/github.com/remyoudompheng/bigfft/fermat.go
generated
vendored
Normal file
216
vendor/github.com/remyoudompheng/bigfft/fermat.go
generated
vendored
Normal file
|
@ -0,0 +1,216 @@
|
|||
package bigfft
|
||||
|
||||
import (
|
||||
"math/big"
|
||||
)
|
||||
|
||||
// Arithmetic modulo 2^n+1.
|
||||
|
||||
// A fermat of length w+1 represents a number modulo 2^(w*_W) + 1. The last
|
||||
// word is zero or one. A number has at most two representatives satisfying the
|
||||
// 0-1 last word constraint.
|
||||
type fermat nat
|
||||
|
||||
func (n fermat) String() string { return nat(n).String() }
|
||||
|
||||
func (z fermat) norm() {
|
||||
n := len(z) - 1
|
||||
c := z[n]
|
||||
if c == 0 {
|
||||
return
|
||||
}
|
||||
if z[0] >= c {
|
||||
z[n] = 0
|
||||
z[0] -= c
|
||||
return
|
||||
}
|
||||
// z[0] < z[n].
|
||||
subVW(z, z, c) // Substract c
|
||||
if c > 1 {
|
||||
z[n] -= c - 1
|
||||
c = 1
|
||||
}
|
||||
// Add back c.
|
||||
if z[n] == 1 {
|
||||
z[n] = 0
|
||||
return
|
||||
} else {
|
||||
addVW(z, z, 1)
|
||||
}
|
||||
}
|
||||
|
||||
// Shift computes (x << k) mod (2^n+1).
|
||||
func (z fermat) Shift(x fermat, k int) {
|
||||
if len(z) != len(x) {
|
||||
panic("len(z) != len(x) in Shift")
|
||||
}
|
||||
n := len(x) - 1
|
||||
// Shift by n*_W is taking the opposite.
|
||||
k %= 2 * n * _W
|
||||
if k < 0 {
|
||||
k += 2 * n * _W
|
||||
}
|
||||
neg := false
|
||||
if k >= n*_W {
|
||||
k -= n * _W
|
||||
neg = true
|
||||
}
|
||||
|
||||
kw, kb := k/_W, k%_W
|
||||
|
||||
z[n] = 1 // Add (-1)
|
||||
if !neg {
|
||||
for i := 0; i < kw; i++ {
|
||||
z[i] = 0
|
||||
}
|
||||
// Shift left by kw words.
|
||||
// x = a·2^(n-k) + b
|
||||
// x<<k = (b<<k) - a
|
||||
copy(z[kw:], x[:n-kw])
|
||||
b := subVV(z[:kw+1], z[:kw+1], x[n-kw:])
|
||||
if z[kw+1] > 0 {
|
||||
z[kw+1] -= b
|
||||
} else {
|
||||
subVW(z[kw+1:], z[kw+1:], b)
|
||||
}
|
||||
} else {
|
||||
for i := kw + 1; i < n; i++ {
|
||||
z[i] = 0
|
||||
}
|
||||
// Shift left and negate, by kw words.
|
||||
copy(z[:kw+1], x[n-kw:n+1]) // z_low = x_high
|
||||
b := subVV(z[kw:n], z[kw:n], x[:n-kw]) // z_high -= x_low
|
||||
z[n] -= b
|
||||
}
|
||||
// Add back 1.
|
||||
if z[n] > 0 {
|
||||
z[n]--
|
||||
} else if z[0] < ^big.Word(0) {
|
||||
z[0]++
|
||||
} else {
|
||||
addVW(z, z, 1)
|
||||
}
|
||||
// Shift left by kb bits
|
||||
shlVU(z, z, uint(kb))
|
||||
z.norm()
|
||||
}
|
||||
|
||||
// ShiftHalf shifts x by k/2 bits the left. Shifting by 1/2 bit
|
||||
// is multiplication by sqrt(2) mod 2^n+1 which is 2^(3n/4) - 2^(n/4).
|
||||
// A temporary buffer must be provided in tmp.
|
||||
func (z fermat) ShiftHalf(x fermat, k int, tmp fermat) {
|
||||
n := len(z) - 1
|
||||
if k%2 == 0 {
|
||||
z.Shift(x, k/2)
|
||||
return
|
||||
}
|
||||
u := (k - 1) / 2
|
||||
a := u + (3*_W/4)*n
|
||||
b := u + (_W/4)*n
|
||||
z.Shift(x, a)
|
||||
tmp.Shift(x, b)
|
||||
z.Sub(z, tmp)
|
||||
}
|
||||
|
||||
// Add computes addition mod 2^n+1.
|
||||
func (z fermat) Add(x, y fermat) fermat {
|
||||
if len(z) != len(x) {
|
||||
panic("Add: len(z) != len(x)")
|
||||
}
|
||||
addVV(z, x, y) // there cannot be a carry here.
|
||||
z.norm()
|
||||
return z
|
||||
}
|
||||
|
||||
// Sub computes substraction mod 2^n+1.
|
||||
func (z fermat) Sub(x, y fermat) fermat {
|
||||
if len(z) != len(x) {
|
||||
panic("Add: len(z) != len(x)")
|
||||
}
|
||||
n := len(y) - 1
|
||||
b := subVV(z[:n], x[:n], y[:n])
|
||||
b += y[n]
|
||||
// If b > 0, we need to subtract b<<n, which is the same as adding b.
|
||||
z[n] = x[n]
|
||||
if z[0] <= ^big.Word(0)-b {
|
||||
z[0] += b
|
||||
} else {
|
||||
addVW(z, z, b)
|
||||
}
|
||||
z.norm()
|
||||
return z
|
||||
}
|
||||
|
||||
func (z fermat) Mul(x, y fermat) fermat {
|
||||
if len(x) != len(y) {
|
||||
panic("Mul: len(x) != len(y)")
|
||||
}
|
||||
n := len(x) - 1
|
||||
if n < 30 {
|
||||
z = z[:2*n+2]
|
||||
basicMul(z, x, y)
|
||||
z = z[:2*n+1]
|
||||
} else {
|
||||
var xi, yi, zi big.Int
|
||||
xi.SetBits(x)
|
||||
yi.SetBits(y)
|
||||
zi.SetBits(z)
|
||||
zb := zi.Mul(&xi, &yi).Bits()
|
||||
if len(zb) <= n {
|
||||
// Short product.
|
||||
copy(z, zb)
|
||||
for i := len(zb); i < len(z); i++ {
|
||||
z[i] = 0
|
||||
}
|
||||
return z
|
||||
}
|
||||
z = zb
|
||||
}
|
||||
// len(z) is at most 2n+1.
|
||||
if len(z) > 2*n+1 {
|
||||
panic("len(z) > 2n+1")
|
||||
}
|
||||
// We now have
|
||||
// z = z[:n] + 1<<(n*W) * z[n:2n+1]
|
||||
// which normalizes to:
|
||||
// z = z[:n] - z[n:2n] + z[2n]
|
||||
c1 := big.Word(0)
|
||||
if len(z) > 2*n {
|
||||
c1 = addVW(z[:n], z[:n], z[2*n])
|
||||
}
|
||||
c2 := big.Word(0)
|
||||
if len(z) >= 2*n {
|
||||
c2 = subVV(z[:n], z[:n], z[n:2*n])
|
||||
} else {
|
||||
m := len(z) - n
|
||||
c2 = subVV(z[:m], z[:m], z[n:])
|
||||
c2 = subVW(z[m:n], z[m:n], c2)
|
||||
}
|
||||
// Restore carries.
|
||||
// Substracting z[n] -= c2 is the same
|
||||
// as z[0] += c2
|
||||
z = z[:n+1]
|
||||
z[n] = c1
|
||||
c := addVW(z, z, c2)
|
||||
if c != 0 {
|
||||
panic("impossible")
|
||||
}
|
||||
z.norm()
|
||||
return z
|
||||
}
|
||||
|
||||
// copied from math/big
|
||||
//
|
||||
// basicMul multiplies x and y and leaves the result in z.
|
||||
// The (non-normalized) result is placed in z[0 : len(x) + len(y)].
|
||||
func basicMul(z, x, y fermat) {
|
||||
// initialize z
|
||||
for i := 0; i < len(z); i++ {
|
||||
z[i] = 0
|
||||
}
|
||||
for i, d := range y {
|
||||
if d != 0 {
|
||||
z[len(x)+i] = addMulVVW(z[i:i+len(x)], x, d)
|
||||
}
|
||||
}
|
||||
}
|
370
vendor/github.com/remyoudompheng/bigfft/fft.go
generated
vendored
Normal file
370
vendor/github.com/remyoudompheng/bigfft/fft.go
generated
vendored
Normal file
|
@ -0,0 +1,370 @@
|
|||
// Package bigfft implements multiplication of big.Int using FFT.
|
||||
//
|
||||
// The implementation is based on the Schönhage-Strassen method
|
||||
// using integer FFT modulo 2^n+1.
|
||||
package bigfft
|
||||
|
||||
import (
|
||||
"math/big"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
const _W = int(unsafe.Sizeof(big.Word(0)) * 8)
|
||||
|
||||
type nat []big.Word
|
||||
|
||||
func (n nat) String() string {
|
||||
v := new(big.Int)
|
||||
v.SetBits(n)
|
||||
return v.String()
|
||||
}
|
||||
|
||||
// fftThreshold is the size (in words) above which FFT is used over
|
||||
// Karatsuba from math/big.
|
||||
//
|
||||
// TestCalibrate seems to indicate a threshold of 60kbits on 32-bit
|
||||
// arches and 110kbits on 64-bit arches.
|
||||
var fftThreshold = 1800
|
||||
|
||||
// Mul computes the product x*y and returns z.
|
||||
// It can be used instead of the Mul method of
|
||||
// *big.Int from math/big package.
|
||||
func Mul(x, y *big.Int) *big.Int {
|
||||
xwords := len(x.Bits())
|
||||
ywords := len(y.Bits())
|
||||
if xwords > fftThreshold && ywords > fftThreshold {
|
||||
return mulFFT(x, y)
|
||||
}
|
||||
return new(big.Int).Mul(x, y)
|
||||
}
|
||||
|
||||
func mulFFT(x, y *big.Int) *big.Int {
|
||||
var xb, yb nat = x.Bits(), y.Bits()
|
||||
zb := fftmul(xb, yb)
|
||||
z := new(big.Int)
|
||||
z.SetBits(zb)
|
||||
if x.Sign()*y.Sign() < 0 {
|
||||
z.Neg(z)
|
||||
}
|
||||
return z
|
||||
}
|
||||
|
||||
// A FFT size of K=1<<k is adequate when K is about 2*sqrt(N) where
|
||||
// N = x.Bitlen() + y.Bitlen().
|
||||
|
||||
func fftmul(x, y nat) nat {
|
||||
k, m := fftSize(x, y)
|
||||
xp := polyFromNat(x, k, m)
|
||||
yp := polyFromNat(y, k, m)
|
||||
rp := xp.Mul(&yp)
|
||||
return rp.Int()
|
||||
}
|
||||
|
||||
// fftSizeThreshold[i] is the maximal size (in bits) where we should use
|
||||
// fft size i.
|
||||
var fftSizeThreshold = [...]int64{0, 0, 0,
|
||||
4 << 10, 8 << 10, 16 << 10, // 5
|
||||
32 << 10, 64 << 10, 1 << 18, 1 << 20, 3 << 20, // 10
|
||||
8 << 20, 30 << 20, 100 << 20, 300 << 20, 600 << 20,
|
||||
}
|
||||
|
||||
// returns the FFT length k, m the number of words per chunk
|
||||
// such that m << k is larger than the number of words
|
||||
// in x*y.
|
||||
func fftSize(x, y nat) (k uint, m int) {
|
||||
words := len(x) + len(y)
|
||||
bits := int64(words) * int64(_W)
|
||||
k = uint(len(fftSizeThreshold))
|
||||
for i := range fftSizeThreshold {
|
||||
if fftSizeThreshold[i] > bits {
|
||||
k = uint(i)
|
||||
break
|
||||
}
|
||||
}
|
||||
// The 1<<k chunks of m words must have N bits so that
|
||||
// 2^N-1 is larger than x*y. That is, m<<k > words
|
||||
m = words>>k + 1
|
||||
return
|
||||
}
|
||||
|
||||
// valueSize returns the length (in words) to use for polynomial
|
||||
// coefficients, to compute a correct product of polynomials P*Q
|
||||
// where deg(P*Q) < K (== 1<<k) and where coefficients of P and Q are
|
||||
// less than b^m (== 1 << (m*_W)).
|
||||
// The chosen length (in bits) must be a multiple of 1 << (k-extra).
|
||||
func valueSize(k uint, m int, extra uint) int {
|
||||
// The coefficients of P*Q are less than b^(2m)*K
|
||||
// so we need W * valueSize >= 2*m*W+K
|
||||
n := 2*m*_W + int(k) // necessary bits
|
||||
K := 1 << (k - extra)
|
||||
if K < _W {
|
||||
K = _W
|
||||
}
|
||||
n = ((n / K) + 1) * K // round to a multiple of K
|
||||
return n / _W
|
||||
}
|
||||
|
||||
// poly represents an integer via a polynomial in Z[x]/(x^K+1)
|
||||
// where K is the FFT length and b^m is the computation basis 1<<(m*_W).
|
||||
// If P = a[0] + a[1] x + ... a[n] x^(K-1), the associated natural number
|
||||
// is P(b^m).
|
||||
type poly struct {
|
||||
k uint // k is such that K = 1<<k.
|
||||
m int // the m such that P(b^m) is the original number.
|
||||
a []nat // a slice of at most K m-word coefficients.
|
||||
}
|
||||
|
||||
// polyFromNat slices the number x into a polynomial
|
||||
// with 1<<k coefficients made of m words.
|
||||
func polyFromNat(x nat, k uint, m int) poly {
|
||||
p := poly{k: k, m: m}
|
||||
length := len(x)/m + 1
|
||||
p.a = make([]nat, length)
|
||||
for i := range p.a {
|
||||
if len(x) < m {
|
||||
p.a[i] = make(nat, m)
|
||||
copy(p.a[i], x)
|
||||
break
|
||||
}
|
||||
p.a[i] = x[:m]
|
||||
x = x[m:]
|
||||
}
|
||||
return p
|
||||
}
|
||||
|
||||
// Int evaluates back a poly to its integer value.
|
||||
func (p *poly) Int() nat {
|
||||
length := len(p.a)*p.m + 1
|
||||
if na := len(p.a); na > 0 {
|
||||
length += len(p.a[na-1])
|
||||
}
|
||||
n := make(nat, length)
|
||||
m := p.m
|
||||
np := n
|
||||
for i := range p.a {
|
||||
l := len(p.a[i])
|
||||
c := addVV(np[:l], np[:l], p.a[i])
|
||||
if np[l] < ^big.Word(0) {
|
||||
np[l] += c
|
||||
} else {
|
||||
addVW(np[l:], np[l:], c)
|
||||
}
|
||||
np = np[m:]
|
||||
}
|
||||
n = trim(n)
|
||||
return n
|
||||
}
|
||||
|
||||
func trim(n nat) nat {
|
||||
for i := range n {
|
||||
if n[len(n)-1-i] != 0 {
|
||||
return n[:len(n)-i]
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Mul multiplies p and q modulo X^K-1, where K = 1<<p.k.
|
||||
// The product is done via a Fourier transform.
|
||||
func (p *poly) Mul(q *poly) poly {
|
||||
// extra=2 because:
|
||||
// * some power of 2 is a K-th root of unity when n is a multiple of K/2.
|
||||
// * 2 itself is a square (see fermat.ShiftHalf)
|
||||
n := valueSize(p.k, p.m, 2)
|
||||
|
||||
pv, qv := p.Transform(n), q.Transform(n)
|
||||
rv := pv.Mul(&qv)
|
||||
r := rv.InvTransform()
|
||||
r.m = p.m
|
||||
return r
|
||||
}
|
||||
|
||||
// A polValues represents the value of a poly at the powers of a
|
||||
// K-th root of unity θ=2^(l/2) in Z/(b^n+1)Z, where b^n = 2^(K/4*l).
|
||||
type polValues struct {
|
||||
k uint // k is such that K = 1<<k.
|
||||
n int // the length of coefficients, n*_W a multiple of K/4.
|
||||
values []fermat // a slice of K (n+1)-word values
|
||||
}
|
||||
|
||||
// Transform evaluates p at θ^i for i = 0...K-1, where
|
||||
// θ is a K-th primitive root of unity in Z/(b^n+1)Z.
|
||||
func (p *poly) Transform(n int) polValues {
|
||||
k := p.k
|
||||
inputbits := make([]big.Word, (n+1)<<k)
|
||||
input := make([]fermat, 1<<k)
|
||||
// Now computed q(ω^i) for i = 0 ... K-1
|
||||
valbits := make([]big.Word, (n+1)<<k)
|
||||
values := make([]fermat, 1<<k)
|
||||
for i := range values {
|
||||
input[i] = inputbits[i*(n+1) : (i+1)*(n+1)]
|
||||
if i < len(p.a) {
|
||||
copy(input[i], p.a[i])
|
||||
}
|
||||
values[i] = fermat(valbits[i*(n+1) : (i+1)*(n+1)])
|
||||
}
|
||||
fourier(values, input, false, n, k)
|
||||
return polValues{k, n, values}
|
||||
}
|
||||
|
||||
// InvTransform reconstructs p (modulo X^K - 1) from its
|
||||
// values at θ^i for i = 0..K-1.
|
||||
func (v *polValues) InvTransform() poly {
|
||||
k, n := v.k, v.n
|
||||
|
||||
// Perform an inverse Fourier transform to recover p.
|
||||
pbits := make([]big.Word, (n+1)<<k)
|
||||
p := make([]fermat, 1<<k)
|
||||
for i := range p {
|
||||
p[i] = fermat(pbits[i*(n+1) : (i+1)*(n+1)])
|
||||
}
|
||||
fourier(p, v.values, true, n, k)
|
||||
// Divide by K, and untwist q to recover p.
|
||||
u := make(fermat, n+1)
|
||||
a := make([]nat, 1<<k)
|
||||
for i := range p {
|
||||
u.Shift(p[i], -int(k))
|
||||
copy(p[i], u)
|
||||
a[i] = nat(p[i])
|
||||
}
|
||||
return poly{k: k, m: 0, a: a}
|
||||
}
|
||||
|
||||
// NTransform evaluates p at θω^i for i = 0...K-1, where
|
||||
// θ is a (2K)-th primitive root of unity in Z/(b^n+1)Z
|
||||
// and ω = θ².
|
||||
func (p *poly) NTransform(n int) polValues {
|
||||
k := p.k
|
||||
if len(p.a) >= 1<<k {
|
||||
panic("Transform: len(p.a) >= 1<<k")
|
||||
}
|
||||
// θ is represented as a shift.
|
||||
θshift := (n * _W) >> k
|
||||
// p(x) = a_0 + a_1 x + ... + a_{K-1} x^(K-1)
|
||||
// p(θx) = q(x) where
|
||||
// q(x) = a_0 + θa_1 x + ... + θ^(K-1) a_{K-1} x^(K-1)
|
||||
//
|
||||
// Twist p by θ to obtain q.
|
||||
tbits := make([]big.Word, (n+1)<<k)
|
||||
twisted := make([]fermat, 1<<k)
|
||||
src := make(fermat, n+1)
|
||||
for i := range twisted {
|
||||
twisted[i] = fermat(tbits[i*(n+1) : (i+1)*(n+1)])
|
||||
if i < len(p.a) {
|
||||
for i := range src {
|
||||
src[i] = 0
|
||||
}
|
||||
copy(src, p.a[i])
|
||||
twisted[i].Shift(src, θshift*i)
|
||||
}
|
||||
}
|
||||
|
||||
// Now computed q(ω^i) for i = 0 ... K-1
|
||||
valbits := make([]big.Word, (n+1)<<k)
|
||||
values := make([]fermat, 1<<k)
|
||||
for i := range values {
|
||||
values[i] = fermat(valbits[i*(n+1) : (i+1)*(n+1)])
|
||||
}
|
||||
fourier(values, twisted, false, n, k)
|
||||
return polValues{k, n, values}
|
||||
}
|
||||
|
||||
// InvTransform reconstructs a polynomial from its values at
|
||||
// roots of x^K+1. The m field of the returned polynomial
|
||||
// is unspecified.
|
||||
func (v *polValues) InvNTransform() poly {
|
||||
k := v.k
|
||||
n := v.n
|
||||
θshift := (n * _W) >> k
|
||||
|
||||
// Perform an inverse Fourier transform to recover q.
|
||||
qbits := make([]big.Word, (n+1)<<k)
|
||||
q := make([]fermat, 1<<k)
|
||||
for i := range q {
|
||||
q[i] = fermat(qbits[i*(n+1) : (i+1)*(n+1)])
|
||||
}
|
||||
fourier(q, v.values, true, n, k)
|
||||
|
||||
// Divide by K, and untwist q to recover p.
|
||||
u := make(fermat, n+1)
|
||||
a := make([]nat, 1<<k)
|
||||
for i := range q {
|
||||
u.Shift(q[i], -int(k)-i*θshift)
|
||||
copy(q[i], u)
|
||||
a[i] = nat(q[i])
|
||||
}
|
||||
return poly{k: k, m: 0, a: a}
|
||||
}
|
||||
|
||||
// fourier performs an unnormalized Fourier transform
|
||||
// of src, a length 1<<k vector of numbers modulo b^n+1
|
||||
// where b = 1<<_W.
|
||||
func fourier(dst []fermat, src []fermat, backward bool, n int, k uint) {
|
||||
var rec func(dst, src []fermat, size uint)
|
||||
tmp := make(fermat, n+1) // pre-allocate temporary variables.
|
||||
tmp2 := make(fermat, n+1) // pre-allocate temporary variables.
|
||||
|
||||
// The recursion function of the FFT.
|
||||
// The root of unity used in the transform is ω=1<<(ω2shift/2).
|
||||
// The source array may use shifted indices (i.e. the i-th
|
||||
// element is src[i << idxShift]).
|
||||
rec = func(dst, src []fermat, size uint) {
|
||||
idxShift := k - size
|
||||
ω2shift := (4 * n * _W) >> size
|
||||
if backward {
|
||||
ω2shift = -ω2shift
|
||||
}
|
||||
|
||||
// Easy cases.
|
||||
if len(src[0]) != n+1 || len(dst[0]) != n+1 {
|
||||
panic("len(src[0]) != n+1 || len(dst[0]) != n+1")
|
||||
}
|
||||
switch size {
|
||||
case 0:
|
||||
copy(dst[0], src[0])
|
||||
return
|
||||
case 1:
|
||||
dst[0].Add(src[0], src[1<<idxShift]) // dst[0] = src[0] + src[1]
|
||||
dst[1].Sub(src[0], src[1<<idxShift]) // dst[1] = src[0] - src[1]
|
||||
return
|
||||
}
|
||||
|
||||
// Let P(x) = src[0] + src[1<<idxShift] * x + ... + src[K-1 << idxShift] * x^(K-1)
|
||||
// The P(x) = Q1(x²) + x*Q2(x²)
|
||||
// where Q1's coefficients are src with indices shifted by 1
|
||||
// where Q2's coefficients are src[1<<idxShift:] with indices shifted by 1
|
||||
|
||||
// Split destination vectors in halves.
|
||||
dst1 := dst[:1<<(size-1)]
|
||||
dst2 := dst[1<<(size-1):]
|
||||
// Transform Q1 and Q2 in the halves.
|
||||
rec(dst1, src, size-1)
|
||||
rec(dst2, src[1<<idxShift:], size-1)
|
||||
|
||||
// Reconstruct P's transform from transforms of Q1 and Q2.
|
||||
// dst[i] is dst1[i] + ω^i * dst2[i]
|
||||
// dst[i + 1<<(k-1)] is dst1[i] + ω^(i+K/2) * dst2[i]
|
||||
//
|
||||
for i := range dst1 {
|
||||
tmp.ShiftHalf(dst2[i], i*ω2shift, tmp2) // ω^i * dst2[i]
|
||||
dst2[i].Sub(dst1[i], tmp)
|
||||
dst1[i].Add(dst1[i], tmp)
|
||||
}
|
||||
}
|
||||
rec(dst, src, k)
|
||||
}
|
||||
|
||||
// Mul returns the pointwise product of p and q.
|
||||
func (p *polValues) Mul(q *polValues) (r polValues) {
|
||||
n := p.n
|
||||
r.k, r.n = p.k, p.n
|
||||
r.values = make([]fermat, len(p.values))
|
||||
bits := make([]big.Word, len(p.values)*(n+1))
|
||||
buf := make(fermat, 8*n)
|
||||
for i := range r.values {
|
||||
r.values[i] = bits[i*(n+1) : (i+1)*(n+1)]
|
||||
z := buf.Mul(p.values[i], q.values[i])
|
||||
copy(r.values[i], z)
|
||||
}
|
||||
return
|
||||
}
|
70
vendor/github.com/remyoudompheng/bigfft/scan.go
generated
vendored
Normal file
70
vendor/github.com/remyoudompheng/bigfft/scan.go
generated
vendored
Normal file
|
@ -0,0 +1,70 @@
|
|||
package bigfft
|
||||
|
||||
import (
|
||||
"math/big"
|
||||
)
|
||||
|
||||
// FromDecimalString converts the base 10 string
|
||||
// representation of a natural (non-negative) number
|
||||
// into a *big.Int.
|
||||
// Its asymptotic complexity is less than quadratic.
|
||||
func FromDecimalString(s string) *big.Int {
|
||||
var sc scanner
|
||||
z := new(big.Int)
|
||||
sc.scan(z, s)
|
||||
return z
|
||||
}
|
||||
|
||||
type scanner struct {
|
||||
// powers[i] is 10^(2^i * quadraticScanThreshold).
|
||||
powers []*big.Int
|
||||
}
|
||||
|
||||
func (s *scanner) chunkSize(size int) (int, *big.Int) {
|
||||
if size <= quadraticScanThreshold {
|
||||
panic("size < quadraticScanThreshold")
|
||||
}
|
||||
pow := uint(0)
|
||||
for n := size; n > quadraticScanThreshold; n /= 2 {
|
||||
pow++
|
||||
}
|
||||
// threshold * 2^(pow-1) <= size < threshold * 2^pow
|
||||
return quadraticScanThreshold << (pow - 1), s.power(pow - 1)
|
||||
}
|
||||
|
||||
func (s *scanner) power(k uint) *big.Int {
|
||||
for i := len(s.powers); i <= int(k); i++ {
|
||||
z := new(big.Int)
|
||||
if i == 0 {
|
||||
if quadraticScanThreshold%14 != 0 {
|
||||
panic("quadraticScanThreshold % 14 != 0")
|
||||
}
|
||||
z.Exp(big.NewInt(1e14), big.NewInt(quadraticScanThreshold/14), nil)
|
||||
} else {
|
||||
z.Mul(s.powers[i-1], s.powers[i-1])
|
||||
}
|
||||
s.powers = append(s.powers, z)
|
||||
}
|
||||
return s.powers[k]
|
||||
}
|
||||
|
||||
func (s *scanner) scan(z *big.Int, str string) {
|
||||
if len(str) <= quadraticScanThreshold {
|
||||
z.SetString(str, 10)
|
||||
return
|
||||
}
|
||||
sz, pow := s.chunkSize(len(str))
|
||||
// Scan the left half.
|
||||
s.scan(z, str[:len(str)-sz])
|
||||
// FIXME: reuse temporaries.
|
||||
left := Mul(z, pow)
|
||||
// Scan the right half
|
||||
s.scan(z, str[len(str)-sz:])
|
||||
z.Add(z, left)
|
||||
}
|
||||
|
||||
// quadraticScanThreshold is the number of digits
|
||||
// below which big.Int.SetString is more efficient
|
||||
// than subquadratic algorithms.
|
||||
// 1232 digits fit in 4096 bits.
|
||||
const quadraticScanThreshold = 1232
|
27
vendor/modernc.org/gc/v3/GO-LICENSE
generated
vendored
Normal file
27
vendor/modernc.org/gc/v3/GO-LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,27 @@
|
|||
Copyright (c) 2009 The Go Authors. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of Google Inc. nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
69
vendor/modernc.org/gc/v3/LICENSE
generated
vendored
Normal file
69
vendor/modernc.org/gc/v3/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,69 @@
|
|||
-------------------------------------------------------------------------------
|
||||
Copyright (c) 2016 The GC Authors. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the names of the authors nor the names of the
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Code in this repository contains or may contain
|
||||
|
||||
- copied original code from
|
||||
- code based on original code from
|
||||
- code inspired by original code in
|
||||
|
||||
"The Go Programming Language" project at https://go.googlesource.com/go/.
|
||||
|
||||
Copy of the license of the original code follows below
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (c) 2009 The Go Authors. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of Google Inc. nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
-------------------------------------------------------------------------------
|
113
vendor/modernc.org/gc/v3/Makefile
generated
vendored
Normal file
113
vendor/modernc.org/gc/v3/Makefile
generated
vendored
Normal file
|
@ -0,0 +1,113 @@
|
|||
.PHONY: all clean edit editor test test2 back report report2 parser2 benchmarks benchmarks2 mem memgo race nreport build_all_targets
|
||||
|
||||
all:
|
||||
|
||||
build_all_targets:
|
||||
GOOS=darwin GOARCH=amd64 go test -c -o /dev/null
|
||||
GOOS=darwin GOARCH=arm64 go test -c -o /dev/null
|
||||
GOOS=freebsd GOARCH=386 go test -c -o /dev/null
|
||||
GOOS=freebsd GOARCH=amd64 go test -c -o /dev/null
|
||||
GOOS=freebsd GOARCH=arm go test -c -o /dev/null
|
||||
GOOS=freebsd GOARCH=arm64 go test -c -o /dev/null
|
||||
GOOS=illumos GOARCH=amd64 go test -c -o /dev/null
|
||||
GOOS=linux GOARCH=386 go test -c -o /dev/null
|
||||
GOOS=linux GOARCH=amd64 go test -c -o /dev/null
|
||||
GOOS=linux GOARCH=arm go test -c -o /dev/null
|
||||
GOOS=linux GOARCH=arm64 go test -c -o /dev/null
|
||||
GOOS=linux GOARCH=ppc64le go test -c -o /dev/null
|
||||
GOOS=linux GOARCH=riscv64 go test -c -o /dev/null
|
||||
GOOS=linux GOARCH=s390x go test -c -o /dev/null
|
||||
GOOS=netbsd GOARCH=386 go test -c -o /dev/null
|
||||
GOOS=netbsd GOARCH=amd64 go test -c -o /dev/null
|
||||
GOOS=netbsd GOARCH=arm go test -c -o /dev/null
|
||||
GOOS=openbsd GOARCH=386 go test -c -o /dev/null
|
||||
GOOS=openbsd GOARCH=amd64 go test -c -o /dev/null
|
||||
GOOS=openbsd GOARCH=arm64 go test -c -o /dev/null
|
||||
GOOS=windows GOARCH=386 go test -c -o /dev/null
|
||||
GOOS=windows GOARCH=amd64 go test -c -o /dev/null
|
||||
GOOS=windows GOARCH=arm64 go test -c -o /dev/null
|
||||
|
||||
clean:
|
||||
rm -f cpu.test mem.test *.out
|
||||
go clean
|
||||
|
||||
edit:
|
||||
@touch log
|
||||
@if [ -f "Session.vim" ]; then gvim -S & else gvim -p Makefile all_test.go gc.go & fi
|
||||
|
||||
editor:
|
||||
gofmt -l -s -w *.go
|
||||
go test -c -o /dev/null 2>&1 | tee log-editor
|
||||
|
||||
race:
|
||||
go test -v -failfast -heap -race 2>&1 | tee log-test
|
||||
@git diff testdata/ || true
|
||||
@git status
|
||||
@grep TOTAL log-test || true
|
||||
grep 'FAIL\|TODO' log-test || true
|
||||
|
||||
test:
|
||||
go test -v -failfast -trctodo -exterr -heap 2>&1 | tee log-test
|
||||
@git diff testdata/ || true
|
||||
@git status
|
||||
@grep TOTAL log-test || true
|
||||
grep 'FAIL\|TODO' log-test || true
|
||||
|
||||
test2:
|
||||
go test -v -failfast -trctodo -exterr -src $$HOME/src 2>&1 | tee log-test2
|
||||
@git diff testdata/ || true
|
||||
@git status
|
||||
@grep TOTAL log-test2 || true
|
||||
grep 'FAIL\|TODO' log-test2 || true
|
||||
|
||||
parser2:
|
||||
go test -v -failfast -run TestParser -src $$HOME/src 2>&1 | tee log-parser2
|
||||
@git diff testdata/ || true
|
||||
@git status
|
||||
@grep TOTAL log-parser2 || true
|
||||
grep 'FAIL\|TODO' log-parser2 || true
|
||||
|
||||
back:
|
||||
go test -v -failfast -noback 2>&1 | tee log-back
|
||||
@git diff testdata/ || true
|
||||
@git status
|
||||
@grep TOTAL log-back || true
|
||||
grep 'FAIL\|TODO' log-back || true
|
||||
|
||||
nreport:
|
||||
touch log-nreport
|
||||
cp log-nreport log-nreport0
|
||||
go test -v -failfast -run TestParser -heap -nreport 2>&1 | tee log-nreport
|
||||
@git diff testdata/ || true
|
||||
@git status
|
||||
@grep TOTAL log-report || true
|
||||
grep 'FAIL\|TODO' log-report || true
|
||||
|
||||
report:
|
||||
go test -v -failfast -run TestParser -report 2>&1 | tee log-report
|
||||
@git diff testdata/ || true
|
||||
@git status
|
||||
@grep TOTAL log-report || true
|
||||
grep 'FAIL\|TODO' log-report || true
|
||||
|
||||
report2:
|
||||
go test -v -failfast -run TestParser -src $$HOME/src -report 2>&1 | tee log-report2
|
||||
@git diff testdata/ || true
|
||||
@git status
|
||||
@grep TOTAL log-report2 || true
|
||||
grep 'FAIL\|TODO' log-report2 || true
|
||||
|
||||
|
||||
benchmarks:
|
||||
go test -v -run @ -bench . 2>&1 | tee log-benchmarks
|
||||
|
||||
benchmarks2:
|
||||
go test -v -run @ -bench . -bsrc $$HOME/src 2>&1 | tee log-benchmarks2
|
||||
|
||||
mem:
|
||||
go test -run @ -bench BenchmarkParser -memprofile mem.out
|
||||
go tool pprof --lines --alloc_space *.test mem.out
|
||||
|
||||
memgo:
|
||||
go test -run @ -bench BenchmarkGoParser -memprofile mem.out
|
||||
go tool pprof --lines --alloc_space *.test mem.out
|
682
vendor/modernc.org/gc/v3/abi.go
generated
vendored
Normal file
682
vendor/modernc.org/gc/v3/abi.go
generated
vendored
Normal file
|
@ -0,0 +1,682 @@
|
|||
// Copyright 2022 The Gc Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package gc // import "modernc.org/gc/v3"
|
||||
|
||||
import (
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
var (
|
||||
byteOrders = map[string]binary.ByteOrder{
|
||||
"386": binary.LittleEndian,
|
||||
"amd64": binary.LittleEndian,
|
||||
"arm": binary.LittleEndian,
|
||||
"arm64": binary.LittleEndian,
|
||||
"ppc64le": binary.LittleEndian,
|
||||
"riscv64": binary.LittleEndian,
|
||||
"s390x": binary.BigEndian,
|
||||
}
|
||||
|
||||
abiTypes = map[[2]string]map[Kind]ABIType{
|
||||
// go1.19.1
|
||||
{"freebsd", "386"}: {
|
||||
Bool: {1, 1, 1},
|
||||
Chan: {4, 4, 4},
|
||||
Complex128: {16, 4, 4},
|
||||
Complex64: {8, 4, 4},
|
||||
Float32: {4, 4, 4},
|
||||
Float64: {8, 4, 4},
|
||||
Function: {4, 4, 4},
|
||||
Int: {4, 4, 4},
|
||||
Int16: {2, 2, 2},
|
||||
Int32: {4, 4, 4},
|
||||
Int64: {8, 4, 4},
|
||||
Int8: {1, 1, 1},
|
||||
Interface: {8, 4, 4},
|
||||
Map: {4, 4, 4},
|
||||
Pointer: {4, 4, 4},
|
||||
Slice: {12, 4, 4},
|
||||
String: {8, 4, 4},
|
||||
Uint: {4, 4, 4},
|
||||
Uint16: {2, 2, 2},
|
||||
Uint32: {4, 4, 4},
|
||||
Uint64: {8, 4, 4},
|
||||
Uint8: {1, 1, 1},
|
||||
Uintptr: {4, 4, 4},
|
||||
UnsafePointer: {4, 4, 4},
|
||||
},
|
||||
// go1.19.1
|
||||
{"freebsd", "amd64"}: {
|
||||
Bool: {1, 1, 1},
|
||||
Chan: {8, 8, 8},
|
||||
Complex128: {16, 8, 8},
|
||||
Complex64: {8, 4, 4},
|
||||
Float32: {4, 4, 4},
|
||||
Float64: {8, 8, 8},
|
||||
Function: {8, 8, 8},
|
||||
Int: {8, 8, 8},
|
||||
Int16: {2, 2, 2},
|
||||
Int32: {4, 4, 4},
|
||||
Int64: {8, 8, 8},
|
||||
Int8: {1, 1, 1},
|
||||
Interface: {16, 8, 8},
|
||||
Map: {8, 8, 8},
|
||||
Pointer: {8, 8, 8},
|
||||
Slice: {24, 8, 8},
|
||||
String: {16, 8, 8},
|
||||
Uint: {8, 8, 8},
|
||||
Uint16: {2, 2, 2},
|
||||
Uint32: {4, 4, 4},
|
||||
Uint64: {8, 8, 8},
|
||||
Uint8: {1, 1, 1},
|
||||
Uintptr: {8, 8, 8},
|
||||
UnsafePointer: {8, 8, 8},
|
||||
},
|
||||
// go1.18.5
|
||||
{"freebsd", "arm"}: {
|
||||
Bool: {1, 1, 1},
|
||||
Chan: {4, 4, 4},
|
||||
Complex128: {16, 4, 4},
|
||||
Complex64: {8, 4, 4},
|
||||
Float32: {4, 4, 4},
|
||||
Float64: {8, 4, 4},
|
||||
Function: {4, 4, 4},
|
||||
Int: {4, 4, 4},
|
||||
Int16: {2, 2, 2},
|
||||
Int32: {4, 4, 4},
|
||||
Int64: {8, 4, 4},
|
||||
Int8: {1, 1, 1},
|
||||
Interface: {8, 4, 4},
|
||||
Map: {4, 4, 4},
|
||||
Pointer: {4, 4, 4},
|
||||
Slice: {12, 4, 4},
|
||||
String: {8, 4, 4},
|
||||
Uint: {4, 4, 4},
|
||||
Uint16: {2, 2, 2},
|
||||
Uint32: {4, 4, 4},
|
||||
Uint64: {8, 4, 4},
|
||||
Uint8: {1, 1, 1},
|
||||
Uintptr: {4, 4, 4},
|
||||
UnsafePointer: {4, 4, 4},
|
||||
},
|
||||
// go1.19
|
||||
{"freebsd", "arm64"}: {
|
||||
Bool: {1, 1, 1},
|
||||
Chan: {8, 8, 8},
|
||||
Complex128: {16, 8, 8},
|
||||
Complex64: {8, 4, 4},
|
||||
Float32: {4, 4, 4},
|
||||
Float64: {8, 8, 8},
|
||||
Function: {8, 8, 8},
|
||||
Int: {8, 8, 8},
|
||||
Int16: {2, 2, 2},
|
||||
Int32: {4, 4, 4},
|
||||
Int64: {8, 8, 8},
|
||||
Int8: {1, 1, 1},
|
||||
Interface: {16, 8, 8},
|
||||
Map: {8, 8, 8},
|
||||
Pointer: {8, 8, 8},
|
||||
Slice: {24, 8, 8},
|
||||
String: {16, 8, 8},
|
||||
Uint: {8, 8, 8},
|
||||
Uint16: {2, 2, 2},
|
||||
Uint32: {4, 4, 4},
|
||||
Uint64: {8, 8, 8},
|
||||
Uint8: {1, 1, 1},
|
||||
Uintptr: {8, 8, 8},
|
||||
UnsafePointer: {8, 8, 8},
|
||||
},
|
||||
// go1.19.1
|
||||
{"darwin", "amd64"}: {
|
||||
Bool: {1, 1, 1},
|
||||
Chan: {8, 8, 8},
|
||||
Complex128: {16, 8, 8},
|
||||
Complex64: {8, 4, 4},
|
||||
Float32: {4, 4, 4},
|
||||
Float64: {8, 8, 8},
|
||||
Function: {8, 8, 8},
|
||||
Int: {8, 8, 8},
|
||||
Int16: {2, 2, 2},
|
||||
Int32: {4, 4, 4},
|
||||
Int64: {8, 8, 8},
|
||||
Int8: {1, 1, 1},
|
||||
Interface: {16, 8, 8},
|
||||
Map: {8, 8, 8},
|
||||
Pointer: {8, 8, 8},
|
||||
Slice: {24, 8, 8},
|
||||
String: {16, 8, 8},
|
||||
Uint: {8, 8, 8},
|
||||
Uint16: {2, 2, 2},
|
||||
Uint32: {4, 4, 4},
|
||||
Uint64: {8, 8, 8},
|
||||
Uint8: {1, 1, 1},
|
||||
Uintptr: {8, 8, 8},
|
||||
UnsafePointer: {8, 8, 8},
|
||||
},
|
||||
// go1.19.1
|
||||
{"darwin", "arm64"}: {
|
||||
Bool: {1, 1, 1},
|
||||
Chan: {8, 8, 8},
|
||||
Complex128: {16, 8, 8},
|
||||
Complex64: {8, 4, 4},
|
||||
Float32: {4, 4, 4},
|
||||
Float64: {8, 8, 8},
|
||||
Function: {8, 8, 8},
|
||||
Int: {8, 8, 8},
|
||||
Int16: {2, 2, 2},
|
||||
Int32: {4, 4, 4},
|
||||
Int64: {8, 8, 8},
|
||||
Int8: {1, 1, 1},
|
||||
Interface: {16, 8, 8},
|
||||
Map: {8, 8, 8},
|
||||
Pointer: {8, 8, 8},
|
||||
Slice: {24, 8, 8},
|
||||
String: {16, 8, 8},
|
||||
Uint: {8, 8, 8},
|
||||
Uint16: {2, 2, 2},
|
||||
Uint32: {4, 4, 4},
|
||||
Uint64: {8, 8, 8},
|
||||
Uint8: {1, 1, 1},
|
||||
Uintptr: {8, 8, 8},
|
||||
UnsafePointer: {8, 8, 8},
|
||||
},
|
||||
// go1.19.1
|
||||
{"linux", "386"}: {
|
||||
Bool: {1, 1, 1},
|
||||
Chan: {4, 4, 4},
|
||||
Complex128: {16, 4, 4},
|
||||
Complex64: {8, 4, 4},
|
||||
Float32: {4, 4, 4},
|
||||
Float64: {8, 4, 4},
|
||||
Function: {4, 4, 4},
|
||||
Int: {4, 4, 4},
|
||||
Int16: {2, 2, 2},
|
||||
Int32: {4, 4, 4},
|
||||
Int64: {8, 4, 4},
|
||||
Int8: {1, 1, 1},
|
||||
Interface: {8, 4, 4},
|
||||
Map: {4, 4, 4},
|
||||
Pointer: {4, 4, 4},
|
||||
Slice: {12, 4, 4},
|
||||
String: {8, 4, 4},
|
||||
Uint: {4, 4, 4},
|
||||
Uint16: {2, 2, 2},
|
||||
Uint32: {4, 4, 4},
|
||||
Uint64: {8, 4, 4},
|
||||
Uint8: {1, 1, 1},
|
||||
Uintptr: {4, 4, 4},
|
||||
UnsafePointer: {4, 4, 4},
|
||||
},
|
||||
// go1.19.1
|
||||
{"linux", "amd64"}: {
|
||||
Bool: {1, 1, 1},
|
||||
Chan: {8, 8, 8},
|
||||
Complex128: {16, 8, 8},
|
||||
Complex64: {8, 4, 4},
|
||||
Float32: {4, 4, 4},
|
||||
Float64: {8, 8, 8},
|
||||
Function: {8, 8, 8},
|
||||
Int: {8, 8, 8},
|
||||
Int16: {2, 2, 2},
|
||||
Int32: {4, 4, 4},
|
||||
Int64: {8, 8, 8},
|
||||
Int8: {1, 1, 1},
|
||||
Interface: {16, 8, 8},
|
||||
Map: {8, 8, 8},
|
||||
Pointer: {8, 8, 8},
|
||||
Slice: {24, 8, 8},
|
||||
String: {16, 8, 8},
|
||||
Uint: {8, 8, 8},
|
||||
Uint16: {2, 2, 2},
|
||||
Uint32: {4, 4, 4},
|
||||
Uint64: {8, 8, 8},
|
||||
Uint8: {1, 1, 1},
|
||||
Uintptr: {8, 8, 8},
|
||||
UnsafePointer: {8, 8, 8},
|
||||
},
|
||||
// go1.19.1
|
||||
{"linux", "arm"}: {
|
||||
Bool: {1, 1, 1},
|
||||
Chan: {4, 4, 4},
|
||||
Complex128: {16, 4, 4},
|
||||
Complex64: {8, 4, 4},
|
||||
Float32: {4, 4, 4},
|
||||
Float64: {8, 4, 4},
|
||||
Function: {4, 4, 4},
|
||||
Int: {4, 4, 4},
|
||||
Int16: {2, 2, 2},
|
||||
Int32: {4, 4, 4},
|
||||
Int64: {8, 4, 4},
|
||||
Int8: {1, 1, 1},
|
||||
Interface: {8, 4, 4},
|
||||
Map: {4, 4, 4},
|
||||
Pointer: {4, 4, 4},
|
||||
Slice: {12, 4, 4},
|
||||
String: {8, 4, 4},
|
||||
Uint: {4, 4, 4},
|
||||
Uint16: {2, 2, 2},
|
||||
Uint32: {4, 4, 4},
|
||||
Uint64: {8, 4, 4},
|
||||
Uint8: {1, 1, 1},
|
||||
Uintptr: {4, 4, 4},
|
||||
UnsafePointer: {4, 4, 4},
|
||||
},
|
||||
// go1.19.1
|
||||
{"linux", "arm64"}: {
|
||||
Bool: {1, 1, 1},
|
||||
Chan: {8, 8, 8},
|
||||
Complex128: {16, 8, 8},
|
||||
Complex64: {8, 4, 4},
|
||||
Float32: {4, 4, 4},
|
||||
Float64: {8, 8, 8},
|
||||
Function: {8, 8, 8},
|
||||
Int: {8, 8, 8},
|
||||
Int16: {2, 2, 2},
|
||||
Int32: {4, 4, 4},
|
||||
Int64: {8, 8, 8},
|
||||
Int8: {1, 1, 1},
|
||||
Interface: {16, 8, 8},
|
||||
Map: {8, 8, 8},
|
||||
Pointer: {8, 8, 8},
|
||||
Slice: {24, 8, 8},
|
||||
String: {16, 8, 8},
|
||||
Uint: {8, 8, 8},
|
||||
Uint16: {2, 2, 2},
|
||||
Uint32: {4, 4, 4},
|
||||
Uint64: {8, 8, 8},
|
||||
Uint8: {1, 1, 1},
|
||||
Uintptr: {8, 8, 8},
|
||||
UnsafePointer: {8, 8, 8},
|
||||
},
|
||||
// go1.19.1
|
||||
{"linux", "s390x"}: {
|
||||
Bool: {1, 1, 1},
|
||||
Chan: {8, 8, 8},
|
||||
Complex128: {16, 8, 8},
|
||||
Complex64: {8, 4, 4},
|
||||
Float32: {4, 4, 4},
|
||||
Float64: {8, 8, 8},
|
||||
Function: {8, 8, 8},
|
||||
Int: {8, 8, 8},
|
||||
Int16: {2, 2, 2},
|
||||
Int32: {4, 4, 4},
|
||||
Int64: {8, 8, 8},
|
||||
Int8: {1, 1, 1},
|
||||
Interface: {16, 8, 8},
|
||||
Map: {8, 8, 8},
|
||||
Pointer: {8, 8, 8},
|
||||
Slice: {24, 8, 8},
|
||||
String: {16, 8, 8},
|
||||
Uint: {8, 8, 8},
|
||||
Uint16: {2, 2, 2},
|
||||
Uint32: {4, 4, 4},
|
||||
Uint64: {8, 8, 8},
|
||||
Uint8: {1, 1, 1},
|
||||
Uintptr: {8, 8, 8},
|
||||
UnsafePointer: {8, 8, 8},
|
||||
},
|
||||
// go1.19.1
|
||||
{"linux", "ppc64le"}: {
|
||||
Bool: {1, 1, 1},
|
||||
Chan: {8, 8, 8},
|
||||
Complex128: {16, 8, 8},
|
||||
Complex64: {8, 4, 4},
|
||||
Float32: {4, 4, 4},
|
||||
Float64: {8, 8, 8},
|
||||
Function: {8, 8, 8},
|
||||
Int: {8, 8, 8},
|
||||
Int16: {2, 2, 2},
|
||||
Int32: {4, 4, 4},
|
||||
Int64: {8, 8, 8},
|
||||
Int8: {1, 1, 1},
|
||||
Interface: {16, 8, 8},
|
||||
Map: {8, 8, 8},
|
||||
Pointer: {8, 8, 8},
|
||||
Slice: {24, 8, 8},
|
||||
String: {16, 8, 8},
|
||||
Uint: {8, 8, 8},
|
||||
Uint16: {2, 2, 2},
|
||||
Uint32: {4, 4, 4},
|
||||
Uint64: {8, 8, 8},
|
||||
Uint8: {1, 1, 1},
|
||||
Uintptr: {8, 8, 8},
|
||||
UnsafePointer: {8, 8, 8},
|
||||
},
|
||||
// go1.19.1
|
||||
{"linux", "riscv64"}: {
|
||||
Bool: {1, 1, 1},
|
||||
Chan: {8, 8, 8},
|
||||
Complex128: {16, 8, 8},
|
||||
Complex64: {8, 4, 4},
|
||||
Float32: {4, 4, 4},
|
||||
Float64: {8, 8, 8},
|
||||
Function: {8, 8, 8},
|
||||
Int: {8, 8, 8},
|
||||
Int16: {2, 2, 2},
|
||||
Int32: {4, 4, 4},
|
||||
Int64: {8, 8, 8},
|
||||
Int8: {1, 1, 1},
|
||||
Interface: {16, 8, 8},
|
||||
Map: {8, 8, 8},
|
||||
Pointer: {8, 8, 8},
|
||||
Slice: {24, 8, 8},
|
||||
String: {16, 8, 8},
|
||||
Uint: {8, 8, 8},
|
||||
Uint16: {2, 2, 2},
|
||||
Uint32: {4, 4, 4},
|
||||
Uint64: {8, 8, 8},
|
||||
Uint8: {1, 1, 1},
|
||||
Uintptr: {8, 8, 8},
|
||||
UnsafePointer: {8, 8, 8},
|
||||
},
|
||||
// go1.18.3
|
||||
{"netbsd", "386"}: {
|
||||
Bool: {1, 1, 1},
|
||||
Chan: {4, 4, 4},
|
||||
Complex128: {16, 4, 4},
|
||||
Complex64: {8, 4, 4},
|
||||
Float32: {4, 4, 4},
|
||||
Float64: {8, 4, 4},
|
||||
Function: {4, 4, 4},
|
||||
Int: {4, 4, 4},
|
||||
Int16: {2, 2, 2},
|
||||
Int32: {4, 4, 4},
|
||||
Int64: {8, 4, 4},
|
||||
Int8: {1, 1, 1},
|
||||
Interface: {8, 4, 4},
|
||||
Map: {4, 4, 4},
|
||||
Pointer: {4, 4, 4},
|
||||
Slice: {12, 4, 4},
|
||||
String: {8, 4, 4},
|
||||
Uint: {4, 4, 4},
|
||||
Uint16: {2, 2, 2},
|
||||
Uint32: {4, 4, 4},
|
||||
Uint64: {8, 4, 4},
|
||||
Uint8: {1, 1, 1},
|
||||
Uintptr: {4, 4, 4},
|
||||
UnsafePointer: {4, 4, 4},
|
||||
},
|
||||
// go1.18.3
|
||||
{"netbsd", "amd64"}: {
|
||||
Bool: {1, 1, 1},
|
||||
Chan: {8, 8, 8},
|
||||
Complex128: {16, 8, 8},
|
||||
Complex64: {8, 4, 4},
|
||||
Float32: {4, 4, 4},
|
||||
Float64: {8, 8, 8},
|
||||
Function: {8, 8, 8},
|
||||
Int: {8, 8, 8},
|
||||
Int16: {2, 2, 2},
|
||||
Int32: {4, 4, 4},
|
||||
Int64: {8, 8, 8},
|
||||
Int8: {1, 1, 1},
|
||||
Interface: {16, 8, 8},
|
||||
Map: {8, 8, 8},
|
||||
Pointer: {8, 8, 8},
|
||||
Slice: {24, 8, 8},
|
||||
String: {16, 8, 8},
|
||||
Uint: {8, 8, 8},
|
||||
Uint16: {2, 2, 2},
|
||||
Uint32: {4, 4, 4},
|
||||
Uint64: {8, 8, 8},
|
||||
Uint8: {1, 1, 1},
|
||||
Uintptr: {8, 8, 8},
|
||||
UnsafePointer: {8, 8, 8},
|
||||
},
|
||||
// go1.18.3
|
||||
{"netbsd", "arm"}: {
|
||||
Bool: {1, 1, 1},
|
||||
Chan: {4, 4, 4},
|
||||
Complex128: {16, 4, 4},
|
||||
Complex64: {8, 4, 4},
|
||||
Float32: {4, 4, 4},
|
||||
Float64: {8, 4, 4},
|
||||
Function: {4, 4, 4},
|
||||
Int: {4, 4, 4},
|
||||
Int16: {2, 2, 2},
|
||||
Int32: {4, 4, 4},
|
||||
Int64: {8, 4, 4},
|
||||
Int8: {1, 1, 1},
|
||||
Interface: {8, 4, 4},
|
||||
Map: {4, 4, 4},
|
||||
Pointer: {4, 4, 4},
|
||||
Slice: {12, 4, 4},
|
||||
String: {8, 4, 4},
|
||||
Uint: {4, 4, 4},
|
||||
Uint16: {2, 2, 2},
|
||||
Uint32: {4, 4, 4},
|
||||
Uint64: {8, 4, 4},
|
||||
Uint8: {1, 1, 1},
|
||||
Uintptr: {4, 4, 4},
|
||||
UnsafePointer: {4, 4, 4},
|
||||
},
|
||||
// go1.19
|
||||
{"openbsd", "amd64"}: {
|
||||
Bool: {1, 1, 1},
|
||||
Chan: {8, 8, 8},
|
||||
Complex128: {16, 8, 8},
|
||||
Complex64: {8, 4, 4},
|
||||
Float32: {4, 4, 4},
|
||||
Float64: {8, 8, 8},
|
||||
Function: {8, 8, 8},
|
||||
Int: {8, 8, 8},
|
||||
Int16: {2, 2, 2},
|
||||
Int32: {4, 4, 4},
|
||||
Int64: {8, 8, 8},
|
||||
Int8: {1, 1, 1},
|
||||
Interface: {16, 8, 8},
|
||||
Map: {8, 8, 8},
|
||||
Pointer: {8, 8, 8},
|
||||
Slice: {24, 8, 8},
|
||||
String: {16, 8, 8},
|
||||
Uint: {8, 8, 8},
|
||||
Uint16: {2, 2, 2},
|
||||
Uint32: {4, 4, 4},
|
||||
Uint64: {8, 8, 8},
|
||||
Uint8: {1, 1, 1},
|
||||
Uintptr: {8, 8, 8},
|
||||
UnsafePointer: {8, 8, 8},
|
||||
},
|
||||
// go1.19
|
||||
{"openbsd", "arm64"}: {
|
||||
Bool: {1, 1, 1},
|
||||
Chan: {8, 8, 8},
|
||||
Complex128: {16, 8, 8},
|
||||
Complex64: {8, 4, 4},
|
||||
Float32: {4, 4, 4},
|
||||
Float64: {8, 8, 8},
|
||||
Function: {8, 8, 8},
|
||||
Int: {8, 8, 8},
|
||||
Int16: {2, 2, 2},
|
||||
Int32: {4, 4, 4},
|
||||
Int64: {8, 8, 8},
|
||||
Int8: {1, 1, 1},
|
||||
Interface: {16, 8, 8},
|
||||
Map: {8, 8, 8},
|
||||
Pointer: {8, 8, 8},
|
||||
Slice: {24, 8, 8},
|
||||
String: {16, 8, 8},
|
||||
Uint: {8, 8, 8},
|
||||
Uint16: {2, 2, 2},
|
||||
Uint32: {4, 4, 4},
|
||||
Uint64: {8, 8, 8},
|
||||
Uint8: {1, 1, 1},
|
||||
Uintptr: {8, 8, 8},
|
||||
UnsafePointer: {8, 8, 8},
|
||||
},
|
||||
// go1.19
|
||||
{"openbsd", "386"}: {
|
||||
Bool: {1, 1, 1},
|
||||
Chan: {4, 4, 4},
|
||||
Complex128: {16, 4, 4},
|
||||
Complex64: {8, 4, 4},
|
||||
Float32: {4, 4, 4},
|
||||
Float64: {8, 4, 4},
|
||||
Function: {4, 4, 4},
|
||||
Int: {4, 4, 4},
|
||||
Int16: {2, 2, 2},
|
||||
Int32: {4, 4, 4},
|
||||
Int64: {8, 4, 4},
|
||||
Int8: {1, 1, 1},
|
||||
Interface: {8, 4, 4},
|
||||
Map: {4, 4, 4},
|
||||
Pointer: {4, 4, 4},
|
||||
Slice: {12, 4, 4},
|
||||
String: {8, 4, 4},
|
||||
Uint: {4, 4, 4},
|
||||
Uint16: {2, 2, 2},
|
||||
Uint32: {4, 4, 4},
|
||||
Uint64: {8, 4, 4},
|
||||
Uint8: {1, 1, 1},
|
||||
Uintptr: {4, 4, 4},
|
||||
UnsafePointer: {4, 4, 4},
|
||||
},
|
||||
// go1.19.1
|
||||
{"windows", "386"}: {
|
||||
Bool: {1, 1, 1},
|
||||
Chan: {4, 4, 4},
|
||||
Complex128: {16, 4, 4},
|
||||
Complex64: {8, 4, 4},
|
||||
Float32: {4, 4, 4},
|
||||
Float64: {8, 4, 4},
|
||||
Function: {4, 4, 4},
|
||||
Int: {4, 4, 4},
|
||||
Int16: {2, 2, 2},
|
||||
Int32: {4, 4, 4},
|
||||
Int64: {8, 4, 4},
|
||||
Int8: {1, 1, 1},
|
||||
Interface: {8, 4, 4},
|
||||
Map: {4, 4, 4},
|
||||
Pointer: {4, 4, 4},
|
||||
Slice: {12, 4, 4},
|
||||
String: {8, 4, 4},
|
||||
Uint: {4, 4, 4},
|
||||
Uint16: {2, 2, 2},
|
||||
Uint32: {4, 4, 4},
|
||||
Uint64: {8, 4, 4},
|
||||
Uint8: {1, 1, 1},
|
||||
Uintptr: {4, 4, 4},
|
||||
UnsafePointer: {4, 4, 4},
|
||||
},
|
||||
// go1.19.1
|
||||
{"windows", "amd64"}: {
|
||||
Bool: {1, 1, 1},
|
||||
Chan: {8, 8, 8},
|
||||
Complex128: {16, 8, 8},
|
||||
Complex64: {8, 4, 4},
|
||||
Float32: {4, 4, 4},
|
||||
Float64: {8, 8, 8},
|
||||
Function: {8, 8, 8},
|
||||
Int: {8, 8, 8},
|
||||
Int16: {2, 2, 2},
|
||||
Int32: {4, 4, 4},
|
||||
Int64: {8, 8, 8},
|
||||
Int8: {1, 1, 1},
|
||||
Interface: {16, 8, 8},
|
||||
Map: {8, 8, 8},
|
||||
Pointer: {8, 8, 8},
|
||||
Slice: {24, 8, 8},
|
||||
String: {16, 8, 8},
|
||||
Uint: {8, 8, 8},
|
||||
Uint16: {2, 2, 2},
|
||||
Uint32: {4, 4, 4},
|
||||
Uint64: {8, 8, 8},
|
||||
Uint8: {1, 1, 1},
|
||||
Uintptr: {8, 8, 8},
|
||||
UnsafePointer: {8, 8, 8},
|
||||
},
|
||||
// go1.19.1
|
||||
{"windows", "arm64"}: {
|
||||
Bool: {1, 1, 1},
|
||||
Chan: {8, 8, 8},
|
||||
Complex128: {16, 8, 8},
|
||||
Complex64: {8, 4, 4},
|
||||
Float32: {4, 4, 4},
|
||||
Float64: {8, 8, 8},
|
||||
Function: {8, 8, 8},
|
||||
Int: {8, 8, 8},
|
||||
Int16: {2, 2, 2},
|
||||
Int32: {4, 4, 4},
|
||||
Int64: {8, 8, 8},
|
||||
Int8: {1, 1, 1},
|
||||
Interface: {16, 8, 8},
|
||||
Map: {8, 8, 8},
|
||||
Pointer: {8, 8, 8},
|
||||
Slice: {24, 8, 8},
|
||||
String: {16, 8, 8},
|
||||
Uint: {8, 8, 8},
|
||||
Uint16: {2, 2, 2},
|
||||
Uint32: {4, 4, 4},
|
||||
Uint64: {8, 8, 8},
|
||||
Uint8: {1, 1, 1},
|
||||
Uintptr: {8, 8, 8},
|
||||
UnsafePointer: {8, 8, 8},
|
||||
},
|
||||
// go1.19.3
|
||||
{"illumos", "amd64"}: {
|
||||
Bool: {1, 1, 1},
|
||||
Chan: {8, 8, 8},
|
||||
Complex128: {16, 8, 8},
|
||||
Complex64: {8, 4, 4},
|
||||
Float32: {4, 4, 4},
|
||||
Float64: {8, 8, 8},
|
||||
Function: {8, 8, 8},
|
||||
Int: {8, 8, 8},
|
||||
Int16: {2, 2, 2},
|
||||
Int32: {4, 4, 4},
|
||||
Int64: {8, 8, 8},
|
||||
Int8: {1, 1, 1},
|
||||
Interface: {16, 8, 8},
|
||||
Map: {8, 8, 8},
|
||||
Pointer: {8, 8, 8},
|
||||
Slice: {24, 8, 8},
|
||||
String: {16, 8, 8},
|
||||
Uint: {8, 8, 8},
|
||||
Uint16: {2, 2, 2},
|
||||
Uint32: {4, 4, 4},
|
||||
Uint64: {8, 8, 8},
|
||||
Uint8: {1, 1, 1},
|
||||
Uintptr: {8, 8, 8},
|
||||
UnsafePointer: {8, 8, 8},
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
// ABI describes selected parts of the Application Binary Interface.
|
||||
type ABI struct {
|
||||
ByteOrder binary.ByteOrder
|
||||
goarch string
|
||||
goos string
|
||||
Types map[Kind]ABIType
|
||||
}
|
||||
|
||||
type ABIType struct {
|
||||
Size int64
|
||||
Align int64
|
||||
FieldAlign int64
|
||||
}
|
||||
|
||||
// NewABI creates an ABI based on the os+arch pair.
|
||||
func NewABI(os, arch string) (*ABI, error) {
|
||||
byteOrder, ok := byteOrders[arch]
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("unsupported arch: %s", arch)
|
||||
}
|
||||
|
||||
types0, ok := abiTypes[[2]string{os, arch}]
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("unsupported os/arch: %s/%s", os, arch)
|
||||
}
|
||||
|
||||
types := make(map[Kind]ABIType, len(types0))
|
||||
for k, v := range types0 {
|
||||
types[k] = v
|
||||
}
|
||||
return &ABI{
|
||||
ByteOrder: byteOrder,
|
||||
Types: types,
|
||||
}, nil
|
||||
}
|
598
vendor/modernc.org/gc/v3/check.go
generated
vendored
Normal file
598
vendor/modernc.org/gc/v3/check.go
generated
vendored
Normal file
|
@ -0,0 +1,598 @@
|
|||
// Copyright 2022 The Gc Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package gc // modernc.org/gc/v3
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"go/constant"
|
||||
"go/token"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"sync"
|
||||
)
|
||||
|
||||
type ctx struct {
|
||||
ast *AST
|
||||
cfg *Config
|
||||
errs errList
|
||||
iota int64
|
||||
pkg *Package
|
||||
|
||||
int32 Type // Set by newCtx
|
||||
untypedFloat Type // Set by newCtx
|
||||
untypedInt Type // Set by newCtx
|
||||
untypedString Type // Set by newCtx
|
||||
}
|
||||
|
||||
func newCtx(cfg *Config) (r *ctx) {
|
||||
r = &ctx{
|
||||
cfg: cfg,
|
||||
iota: -1, // -> Invalid
|
||||
}
|
||||
r.int32 = r.newPredeclaredType(znode, Int32)
|
||||
r.untypedFloat = r.newPredeclaredType(znode, UntypedFloat)
|
||||
r.untypedInt = r.newPredeclaredType(znode, UntypedInt)
|
||||
r.untypedString = r.newPredeclaredType(znode, UntypedString)
|
||||
return r
|
||||
}
|
||||
|
||||
func (c *ctx) err(n Node, msg string, args ...interface{}) {
|
||||
var pos token.Position
|
||||
if n != nil {
|
||||
pos = n.Position()
|
||||
}
|
||||
s := fmt.Sprintf(msg, args...)
|
||||
if trcTODOs && strings.HasPrefix(s, "TODO") {
|
||||
fmt.Fprintf(os.Stderr, "%v: %s (%v)\n", pos, s, origin(2))
|
||||
os.Stderr.Sync()
|
||||
}
|
||||
switch {
|
||||
case extendedErrors:
|
||||
c.errs.err(pos, "%s (%v: %v: %v)", s, origin(4), origin(3), origin(2))
|
||||
default:
|
||||
c.errs.err(pos, s)
|
||||
}
|
||||
}
|
||||
|
||||
func (c *ctx) isBuiltin() bool { return c.pkg.Scope.kind == UniverseScope }
|
||||
func (c *ctx) isUnsafe() bool { return c.pkg.isUnsafe }
|
||||
|
||||
func (c *ctx) lookup(sc *Scope, id Token) (pkg *Package, in *Scope, r named) {
|
||||
sc0 := sc
|
||||
pkg = c.pkg
|
||||
for {
|
||||
switch in, nm := sc.lookup(id); x := nm.n.(type) {
|
||||
case *TypeDefNode:
|
||||
if sc.kind == UniverseScope {
|
||||
if sc0.kind != UniverseScope && token.IsExported(id.Src()) {
|
||||
// trc("%v: %q %v %v", id.Position(), id.Src(), sc0.kind, sc.kind)
|
||||
return nil, nil, r
|
||||
}
|
||||
}
|
||||
|
||||
return x.pkg, in, nm
|
||||
default:
|
||||
panic(todo("%v: %q %T", id.Position(), id.Src(), x))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (n *Package) check(c *ctx) (err error) {
|
||||
if n == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
c.pkg = n
|
||||
// trc("PKG %q", n.ImportPath)
|
||||
// defer func() { trc("PKG %q -> err: %v", n.ImportPath, err) }()
|
||||
for _, v := range n.GoFiles {
|
||||
path := filepath.Join(n.FSPath, v.Name())
|
||||
n.AST[path].check(c)
|
||||
}
|
||||
return c.errs.Err()
|
||||
}
|
||||
|
||||
func (n *AST) check(c *ctx) {
|
||||
if n == nil {
|
||||
return
|
||||
}
|
||||
|
||||
c.ast = n
|
||||
n.SourceFile.check(c)
|
||||
}
|
||||
|
||||
func (n *SourceFileNode) check(c *ctx) {
|
||||
if n == nil {
|
||||
return
|
||||
}
|
||||
|
||||
n.PackageClause.check(c)
|
||||
for l := n.ImportDeclList; l != nil; l = l.List {
|
||||
l.ImportDecl.check(c)
|
||||
}
|
||||
for l := n.TopLevelDeclList; l != nil; l = l.List {
|
||||
switch x := l.TopLevelDecl.(type) {
|
||||
case *TypeDeclNode:
|
||||
x.check(c)
|
||||
case *ConstDeclNode:
|
||||
x.check(c)
|
||||
case *VarDeclNode:
|
||||
x.check(c)
|
||||
case *FunctionDeclNode:
|
||||
x.check(c)
|
||||
case *MethodDeclNode:
|
||||
x.check(c)
|
||||
default:
|
||||
panic(todo("%v: %T %s", x.Position(), x, x.Source(false)))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (n *MethodDeclNode) check(c *ctx) {
|
||||
if n == nil {
|
||||
return
|
||||
}
|
||||
|
||||
n.Receiver.check(c)
|
||||
n.Signature.check(c)
|
||||
}
|
||||
|
||||
func (n *FunctionDeclNode) check(c *ctx) {
|
||||
if n == nil {
|
||||
return
|
||||
}
|
||||
|
||||
if c.isBuiltin() {
|
||||
switch nm := n.FunctionName.IDENT.Src(); nm {
|
||||
case
|
||||
"append",
|
||||
"cap",
|
||||
"close",
|
||||
"complex",
|
||||
"copy",
|
||||
"delete",
|
||||
"imag",
|
||||
"len",
|
||||
"make",
|
||||
"new",
|
||||
"panic",
|
||||
"print",
|
||||
"println",
|
||||
"real",
|
||||
"recover",
|
||||
|
||||
// Go 1.21
|
||||
"max",
|
||||
"min",
|
||||
"clear":
|
||||
|
||||
n.Signature.t = c.newPredeclaredType(n, Function)
|
||||
default:
|
||||
panic(todo("%v: %q %s", n.Position(), nm, n.Source(false)))
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
n.Signature.check(c)
|
||||
if n.TypeParameters != nil {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
}
|
||||
|
||||
func (n *SignatureNode) check(c *ctx) Type {
|
||||
if n == nil {
|
||||
return Invalid
|
||||
}
|
||||
|
||||
if !n.enter(c, n) {
|
||||
return n.Type()
|
||||
}
|
||||
|
||||
in := n.Parameters.check(c)
|
||||
out := n.Result.check(c)
|
||||
return n.setType(newTupleType(n.Parameters, []Type{in, out}))
|
||||
}
|
||||
|
||||
func (n *ResultNode) check(c *ctx) Type {
|
||||
if n == nil {
|
||||
return Invalid
|
||||
}
|
||||
|
||||
switch {
|
||||
case n.Parameters != nil:
|
||||
return n.Parameters.check(c)
|
||||
case n.TypeNode != nil:
|
||||
return n.TypeNode.check(c)
|
||||
default:
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
}
|
||||
|
||||
func (n *ParametersNode) check(c *ctx) Type {
|
||||
if n == nil {
|
||||
return Invalid
|
||||
}
|
||||
|
||||
r := newTupleType(n, nil)
|
||||
for l := n.ParameterDeclList; l != nil; l = l.List {
|
||||
r.Types = append(r.Types, l.ParameterDecl.check(c)...)
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
func (n *ParameterDeclNode) check(c *ctx) (r []Type) {
|
||||
if n == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
t := n.TypeNode.check(c)
|
||||
for l := n.IdentifierList; l != nil; l = l.List {
|
||||
r = append(r, t)
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
func (n *VarDeclNode) check(c *ctx) {
|
||||
if n == nil {
|
||||
return
|
||||
}
|
||||
|
||||
switch x := n.VarSpec.(type) {
|
||||
case *VarSpecNode:
|
||||
x.check(c)
|
||||
default:
|
||||
panic(todo("%v: %T %s", n.Position(), x, n.Source(false)))
|
||||
}
|
||||
}
|
||||
|
||||
func (n *VarSpecNode) check(c *ctx) {
|
||||
if n == nil {
|
||||
return
|
||||
}
|
||||
|
||||
if c.isBuiltin() {
|
||||
switch nm := n.IDENT.Src(); nm {
|
||||
case "nil":
|
||||
n.TypeNode = c.newPredeclaredType(n, UntypedNil)
|
||||
default:
|
||||
panic(todo("%v: %q", n.IDENT.Position(), nm))
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
if n.TypeNode != nil {
|
||||
c.err(n, "TODO %v", n.TypeNode.Source(false))
|
||||
}
|
||||
var e []Expression
|
||||
for l := n.ExpressionList; l != nil; l = l.List {
|
||||
e = append(e, l.Expression.checkExpr(c))
|
||||
}
|
||||
switch len(e) {
|
||||
default:
|
||||
panic(todo("", len(e)))
|
||||
c.err(n, "TODO %v", len(e))
|
||||
}
|
||||
}
|
||||
|
||||
func (n *ConstDeclNode) check(c *ctx) {
|
||||
if n == nil {
|
||||
return
|
||||
}
|
||||
|
||||
switch x := n.ConstSpec.(type) {
|
||||
case *ConstSpecListNode:
|
||||
var prev Node
|
||||
for l := x; l != nil; l = l.List {
|
||||
switch y := l.ConstSpec.(type) {
|
||||
case *ConstSpecNode:
|
||||
y.check(c, prev)
|
||||
if y.Expression != nil || y.TypeNode != nil {
|
||||
prev = y
|
||||
}
|
||||
default:
|
||||
panic(todo("%v: %T %s", n.Position(), y, n.Source(false)))
|
||||
}
|
||||
}
|
||||
case *ConstSpecNode:
|
||||
x.check(c, nil)
|
||||
default:
|
||||
panic(todo("%v: %T %s", n.Position(), x, n.Source(false)))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func (n *ConstSpecNode) check(c *ctx, prev Node) {
|
||||
if n == nil {
|
||||
return
|
||||
}
|
||||
|
||||
if !n.enter(c, n) {
|
||||
if n.guard == guardChecking {
|
||||
panic(todo("")) // report recursive
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
defer func() { n.guard = guardChecked }()
|
||||
|
||||
if c.isBuiltin() {
|
||||
switch n.IDENT.Src() {
|
||||
case "true":
|
||||
switch x := n.Expression.(type) {
|
||||
case *BinaryExpressionNode:
|
||||
x.setValue(trueVal)
|
||||
x.setType(c.newPredeclaredType(x, UntypedBool))
|
||||
default:
|
||||
panic(todo("%v: %T %s", n.Position(), x, n.Source(false)))
|
||||
}
|
||||
case "false":
|
||||
switch x := n.Expression.(type) {
|
||||
case *BinaryExpressionNode:
|
||||
x.setValue(falseVal)
|
||||
x.setType(c.newPredeclaredType(x, UntypedBool))
|
||||
default:
|
||||
panic(todo("%v: %T %s", n.Position(), x, n.Source(false)))
|
||||
}
|
||||
case "iota":
|
||||
switch x := n.Expression.(type) {
|
||||
case *BasicLitNode:
|
||||
// ok
|
||||
default:
|
||||
panic(todo("%v: %T %s", n.Position(), x, n.Source(false)))
|
||||
}
|
||||
default:
|
||||
panic(todo("", n.Position(), n.Source(false)))
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
save := c.iota
|
||||
c.iota = n.iota
|
||||
|
||||
defer func() { c.iota = save }()
|
||||
|
||||
switch {
|
||||
case n.Expression != nil:
|
||||
n.Expression = n.Expression.checkExpr(c)
|
||||
if n.TypeNode == nil {
|
||||
n.TypeNode = n.Expression.Type()
|
||||
return
|
||||
}
|
||||
|
||||
t := n.TypeNode.check(c)
|
||||
trc("", t)
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
default:
|
||||
// var e Expression
|
||||
// var pe *Expression
|
||||
// switch {
|
||||
// case n.Expression != nil:
|
||||
// e = n.Expression
|
||||
// pe = &n.Expression
|
||||
// default:
|
||||
// switch x := prev.(type) {
|
||||
// case *ConstSpecNode:
|
||||
// e = x.Expression.clone()
|
||||
// pe = &e
|
||||
// default:
|
||||
// panic(todo("%v: %T %s", n.Position(), x, n.Source(false)))
|
||||
// }
|
||||
// }
|
||||
// ev, et := e.checkExpr(c, pe)
|
||||
// e = *pe
|
||||
// if ev.Kind() == constant.Unknown {
|
||||
// c.err(e, "%s is not a constant", e.Source(false))
|
||||
// n.t = Invalid
|
||||
// n.setValue(unknown)
|
||||
// return Invalid
|
||||
// }
|
||||
// switch {
|
||||
// case n.t == nil:
|
||||
// n.t = et
|
||||
// default:
|
||||
|
||||
// c.err(n.Expression, "cannot assign %v (type %v) to type %v", ev, et, n.Type())
|
||||
// return Invalid
|
||||
// } else {
|
||||
// n.setValue(convertValue(c, e, ev, n.Type()))
|
||||
// }
|
||||
// }
|
||||
// return n.Type()
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func (n *TypeDeclNode) check(c *ctx) {
|
||||
if n == nil {
|
||||
return
|
||||
}
|
||||
|
||||
for l := n.TypeSpecList; l != nil; l = l.List {
|
||||
switch x := l.TypeSpec.(type) {
|
||||
case *TypeDefNode:
|
||||
switch {
|
||||
case c.isBuiltin():
|
||||
x.pkg = c.pkg
|
||||
switch nm := x.IDENT.Src(); nm {
|
||||
case "bool":
|
||||
x.TypeNode = c.newPredeclaredType(x, Bool)
|
||||
case "int":
|
||||
x.TypeNode = c.newPredeclaredType(x, Int)
|
||||
c.cfg.int = x.TypeNode
|
||||
case "int8":
|
||||
x.TypeNode = c.newPredeclaredType(x, Int8)
|
||||
case "int16":
|
||||
x.TypeNode = c.newPredeclaredType(x, Int16)
|
||||
case "int32":
|
||||
x.TypeNode = c.newPredeclaredType(x, Int32)
|
||||
case "int64":
|
||||
x.TypeNode = c.newPredeclaredType(x, Int64)
|
||||
case "uint":
|
||||
x.TypeNode = c.newPredeclaredType(x, Uint)
|
||||
c.cfg.uint = x.TypeNode
|
||||
case "uint8":
|
||||
x.TypeNode = c.newPredeclaredType(x, Uint8)
|
||||
case "uint16":
|
||||
x.TypeNode = c.newPredeclaredType(x, Uint16)
|
||||
case "uint32":
|
||||
x.TypeNode = c.newPredeclaredType(x, Uint32)
|
||||
case "uint64":
|
||||
x.TypeNode = c.newPredeclaredType(x, Uint64)
|
||||
case "uintptr":
|
||||
x.TypeNode = c.newPredeclaredType(x, Uintptr)
|
||||
case "string":
|
||||
x.TypeNode = c.newPredeclaredType(x, String)
|
||||
case "float32":
|
||||
x.TypeNode = c.newPredeclaredType(x, Float32)
|
||||
case "float64":
|
||||
x.TypeNode = c.newPredeclaredType(x, Float64)
|
||||
case "complex64":
|
||||
x.TypeNode = c.newPredeclaredType(x, Complex64)
|
||||
case "complex128":
|
||||
x.TypeNode = c.newPredeclaredType(x, Complex128)
|
||||
case "comparable":
|
||||
x.TypeNode = c.newPredeclaredType(x, Interface)
|
||||
case "error":
|
||||
x.check(c)
|
||||
default:
|
||||
if token.IsExported(nm) {
|
||||
delete(c.pkg.Scope.nodes, nm)
|
||||
return
|
||||
}
|
||||
|
||||
panic(todo("%v: %T %s", x.Position(), x, x.Source(false)))
|
||||
}
|
||||
case c.isUnsafe():
|
||||
switch nm := x.IDENT.Src(); nm {
|
||||
case "ArbitraryType", "IntegerType", "Pointer":
|
||||
x.TypeNode.check(c)
|
||||
default:
|
||||
panic(todo("%v: %T %s", x.Position(), x, x.Source(false)))
|
||||
}
|
||||
default:
|
||||
switch {
|
||||
case x.TypeParameters != nil:
|
||||
panic(todo("%v: %T %s", x.Position(), x, x.Source(false)))
|
||||
default:
|
||||
x.check(c)
|
||||
}
|
||||
}
|
||||
case *AliasDeclNode:
|
||||
x.check(c)
|
||||
default:
|
||||
panic(todo("%v: %T %s", x.Position(), x, x.Source(false)))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (n *AliasDeclNode) check(c *ctx) {
|
||||
if n == nil {
|
||||
return
|
||||
}
|
||||
|
||||
n.TypeNode.check(c)
|
||||
}
|
||||
|
||||
func (n *ImportDeclNode) check(c *ctx) {
|
||||
if n == nil {
|
||||
return
|
||||
}
|
||||
|
||||
type result struct {
|
||||
spec *ImportSpecNode
|
||||
pkg *Package
|
||||
err error
|
||||
}
|
||||
var a []*result
|
||||
var wg sync.WaitGroup
|
||||
for l := n.ImportSpecList; l != nil; l = l.List {
|
||||
r := &result{}
|
||||
a = append(a, r)
|
||||
wg.Add(1)
|
||||
go func(isln *ImportSpecListNode, r *result) {
|
||||
|
||||
defer wg.Done()
|
||||
|
||||
r.spec = isln.ImportSpec
|
||||
r.pkg, r.err = r.spec.check(c)
|
||||
r.spec.pkg = r.pkg
|
||||
}(l, r)
|
||||
}
|
||||
wg.Wait()
|
||||
fileScope := c.ast.FileScope
|
||||
pkgScope := c.pkg.Scope
|
||||
for _, v := range a {
|
||||
switch x := v.err.(type) {
|
||||
case nil:
|
||||
// ok
|
||||
default:
|
||||
panic(todo("%v: %T: %s", v.spec.Position(), x, x))
|
||||
}
|
||||
if c.pkg.ImportPath == "builtin" && v.spec.ImportPath.Src() == `"cmp"` {
|
||||
continue
|
||||
}
|
||||
|
||||
switch ex := fileScope.declare(v.pkg.Name, v.spec, 0, nil, true); {
|
||||
case ex.declTok.IsValid():
|
||||
c.err(n, "%s redeclared, previous declaration at %v:", v.pkg.Name.Src(), ex.declTok.Position())
|
||||
continue
|
||||
}
|
||||
|
||||
switch ex := pkgScope.declare(v.pkg.Name, v.spec, 0, nil, true); {
|
||||
case ex.declTok.IsValid():
|
||||
c.err(n, "%s redeclared, previous declaration at %v:", v.pkg.Name.Src(), ex.declTok.Position())
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (n *ImportSpecNode) check(c *ctx) (*Package, error) {
|
||||
if n == nil {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
switch {
|
||||
case n.PERIOD.IsValid():
|
||||
panic(todo("", n.Position(), n.Source(false)))
|
||||
case n.PackageName.IsValid():
|
||||
//TODO version
|
||||
check := c.pkg.typeCheck
|
||||
switch check {
|
||||
case TypeCheckAll:
|
||||
// nop
|
||||
default:
|
||||
panic(todo("", check))
|
||||
}
|
||||
return c.cfg.newPackage(c.pkg.FSPath, constant.StringVal(n.ImportPath.Value()), "", nil, false, check, c.pkg.guard)
|
||||
default:
|
||||
//TODO version
|
||||
check := c.pkg.typeCheck
|
||||
switch check {
|
||||
case TypeCheckAll:
|
||||
// nop
|
||||
default:
|
||||
if c.pkg.ImportPath == "builtin" && n.ImportPath.Src() == `"cmp"` {
|
||||
return nil, nil
|
||||
}
|
||||
}
|
||||
return c.cfg.newPackage(c.pkg.FSPath, constant.StringVal(n.ImportPath.Value()), "", nil, false, check, c.pkg.guard)
|
||||
}
|
||||
}
|
||||
|
||||
func (n *PackageClauseNode) check(c *ctx) {
|
||||
if n == nil {
|
||||
return
|
||||
}
|
||||
|
||||
nm := n.PackageName.Src()
|
||||
if ex := c.pkg.Name; ex.IsValid() && ex.Src() != nm {
|
||||
c.err(n.PackageName, "found different packages %q and %q", ex.Src(), nm)
|
||||
return
|
||||
}
|
||||
|
||||
c.pkg.Name = n.PackageName
|
||||
}
|
559
vendor/modernc.org/gc/v3/etc.go
generated
vendored
Normal file
559
vendor/modernc.org/gc/v3/etc.go
generated
vendored
Normal file
|
@ -0,0 +1,559 @@
|
|||
// Copyright 2022 The Gc Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package gc // modernc.org/gc/v3
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"go/token"
|
||||
"math"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/dustin/go-humanize"
|
||||
)
|
||||
|
||||
// The list of tokens.
|
||||
const (
|
||||
// Special tokens
|
||||
ILLEGAL = token.ILLEGAL
|
||||
EOF = token.EOF
|
||||
COMMENT = token.COMMENT
|
||||
|
||||
// Identifiers and basic type literals
|
||||
// (these tokens stand for classes of literals)
|
||||
IDENT = token.IDENT // main
|
||||
INT = token.INT // 12345
|
||||
FLOAT = token.FLOAT // 123.45
|
||||
IMAG = token.IMAG // 123.45i
|
||||
CHAR = token.CHAR // 'a'
|
||||
STRING = token.STRING // "abc"
|
||||
|
||||
// Operators and delimiters
|
||||
ADD = token.ADD // +
|
||||
SUB = token.SUB // -
|
||||
MUL = token.MUL // *
|
||||
QUO = token.QUO // /
|
||||
REM = token.REM // %
|
||||
|
||||
AND = token.AND // &
|
||||
OR = token.OR // |
|
||||
XOR = token.XOR // ^
|
||||
SHL = token.SHL // <<
|
||||
SHR = token.SHR // >>
|
||||
AND_NOT = token.AND_NOT // &^
|
||||
|
||||
ADD_ASSIGN = token.ADD_ASSIGN // +=
|
||||
SUB_ASSIGN = token.SUB_ASSIGN // -=
|
||||
MUL_ASSIGN = token.MUL_ASSIGN // *=
|
||||
QUO_ASSIGN = token.QUO_ASSIGN // /=
|
||||
REM_ASSIGN = token.REM_ASSIGN // %=
|
||||
|
||||
AND_ASSIGN = token.AND_ASSIGN // &=
|
||||
OR_ASSIGN = token.OR_ASSIGN // |=
|
||||
XOR_ASSIGN = token.XOR_ASSIGN // ^=
|
||||
SHL_ASSIGN = token.SHL_ASSIGN // <<=
|
||||
SHR_ASSIGN = token.SHR_ASSIGN // >>=
|
||||
AND_NOT_ASSIGN = token.AND_NOT_ASSIGN // &^=
|
||||
|
||||
LAND = token.LAND // &&
|
||||
LOR = token.LOR // ||
|
||||
ARROW = token.ARROW // <-
|
||||
INC = token.INC // ++
|
||||
DEC = token.DEC // --
|
||||
|
||||
EQL = token.EQL // ==
|
||||
LSS = token.LSS // <
|
||||
GTR = token.GTR // >
|
||||
ASSIGN = token.ASSIGN // =
|
||||
NOT = token.NOT // !
|
||||
|
||||
NEQ = token.NEQ // !=
|
||||
LEQ = token.LEQ // <=
|
||||
GEQ = token.GEQ // >=
|
||||
DEFINE = token.DEFINE // :=
|
||||
ELLIPSIS = token.ELLIPSIS // ...
|
||||
|
||||
LPAREN = token.LPAREN // (
|
||||
LBRACK = token.LBRACK // [
|
||||
LBRACE = token.LBRACE // {
|
||||
COMMA = token.COMMA // ,
|
||||
PERIOD = token.PERIOD // .
|
||||
|
||||
RPAREN = token.RPAREN // )
|
||||
RBRACK = token.RBRACK // ]
|
||||
RBRACE = token.RBRACE // }
|
||||
SEMICOLON = token.SEMICOLON // ;
|
||||
COLON = token.COLON // :
|
||||
|
||||
// Keywords
|
||||
BREAK = token.BREAK
|
||||
CASE = token.CASE
|
||||
CHAN = token.CHAN
|
||||
CONST = token.CONST
|
||||
CONTINUE = token.CONTINUE
|
||||
|
||||
DEFAULT = token.DEFAULT
|
||||
DEFER = token.DEFER
|
||||
ELSE = token.ELSE
|
||||
FALLTHROUGH = token.FALLTHROUGH
|
||||
FOR = token.FOR
|
||||
|
||||
FUNC = token.FUNC
|
||||
GO = token.GO
|
||||
GOTO = token.GOTO
|
||||
IF = token.IF
|
||||
IMPORT = token.IMPORT
|
||||
|
||||
INTERFACE = token.INTERFACE
|
||||
MAP = token.MAP
|
||||
PACKAGE = token.PACKAGE
|
||||
RANGE = token.RANGE
|
||||
RETURN = token.RETURN
|
||||
|
||||
SELECT = token.SELECT
|
||||
STRUCT = token.STRUCT
|
||||
SWITCH = token.SWITCH
|
||||
TYPE = token.TYPE
|
||||
VAR = token.VAR
|
||||
|
||||
// additional tokens, handled in an ad-hoc manner
|
||||
TILDE = token.TILDE
|
||||
)
|
||||
|
||||
var (
|
||||
trcTODOs bool
|
||||
extendedErrors bool
|
||||
)
|
||||
|
||||
// origin returns caller's short position, skipping skip frames.
|
||||
func origin(skip int) string {
|
||||
pc, fn, fl, _ := runtime.Caller(skip)
|
||||
f := runtime.FuncForPC(pc)
|
||||
var fns string
|
||||
if f != nil {
|
||||
fns = f.Name()
|
||||
if x := strings.LastIndex(fns, "."); x > 0 {
|
||||
fns = fns[x+1:]
|
||||
}
|
||||
if strings.HasPrefix(fns, "func") {
|
||||
num := true
|
||||
for _, c := range fns[len("func"):] {
|
||||
if c < '0' || c > '9' {
|
||||
num = false
|
||||
break
|
||||
}
|
||||
}
|
||||
if num {
|
||||
return origin(skip + 2)
|
||||
}
|
||||
}
|
||||
}
|
||||
return fmt.Sprintf("%s:%d:%s", filepath.Base(fn), fl, fns)
|
||||
}
|
||||
|
||||
// todo prints and returns caller's position and an optional message tagged with TODO. Output goes to stderr.
|
||||
//
|
||||
//lint:ignore U1000 whatever
|
||||
func todo(s string, args ...interface{}) string {
|
||||
switch {
|
||||
case s == "":
|
||||
s = fmt.Sprintf(strings.Repeat("%v ", len(args)), args...)
|
||||
default:
|
||||
s = fmt.Sprintf(s, args...)
|
||||
}
|
||||
r := fmt.Sprintf("%s\n\tTODO (%s)", origin(2), s)
|
||||
// fmt.Fprintf(os.Stderr, "%s\n", r)
|
||||
// os.Stdout.Sync()
|
||||
return r
|
||||
}
|
||||
|
||||
// trc prints and returns caller's position and an optional message tagged with TRC. Output goes to stderr.
|
||||
//
|
||||
//lint:ignore U1000 whatever
|
||||
func trc(s string, args ...interface{}) string {
|
||||
switch {
|
||||
case s == "":
|
||||
s = fmt.Sprintf(strings.Repeat("%v ", len(args)), args...)
|
||||
default:
|
||||
s = fmt.Sprintf(s, args...)
|
||||
}
|
||||
r := fmt.Sprintf("%s: TRC (%s)", origin(2), s)
|
||||
fmt.Fprintf(os.Stderr, "%s\n", r)
|
||||
os.Stderr.Sync()
|
||||
return r
|
||||
}
|
||||
|
||||
func extractPos(s string) (p token.Position, ok bool) {
|
||||
var prefix string
|
||||
if len(s) > 1 && s[1] == ':' { // c:\foo
|
||||
prefix = s[:2]
|
||||
s = s[2:]
|
||||
}
|
||||
// "testdata/parser/bug/001.c:1193: ..."
|
||||
a := strings.Split(s, ":")
|
||||
// ["testdata/parser/bug/001.c" "1193" "..."]
|
||||
if len(a) < 2 {
|
||||
return p, false
|
||||
}
|
||||
|
||||
line, err := strconv.Atoi(a[1])
|
||||
if err != nil {
|
||||
return p, false
|
||||
}
|
||||
|
||||
col, err := strconv.Atoi(a[2])
|
||||
if err != nil {
|
||||
col = 1
|
||||
}
|
||||
|
||||
return token.Position{Filename: prefix + a[0], Line: line, Column: col}, true
|
||||
}
|
||||
|
||||
// errorf constructs an error value. If extendedErrors is true, the error will
|
||||
// contain its origin.
|
||||
func errorf(s string, args ...interface{}) error {
|
||||
switch {
|
||||
case s == "":
|
||||
s = fmt.Sprintf(strings.Repeat("%v ", len(args)), args...)
|
||||
default:
|
||||
s = fmt.Sprintf(s, args...)
|
||||
}
|
||||
if trcTODOs && strings.HasPrefix(s, "TODO") {
|
||||
fmt.Fprintf(os.Stderr, "%s (%v)\n", s, origin(2))
|
||||
os.Stderr.Sync()
|
||||
}
|
||||
switch {
|
||||
case extendedErrors:
|
||||
return fmt.Errorf("%s (%v: %v: %v)", s, origin(4), origin(3), origin(2))
|
||||
default:
|
||||
return fmt.Errorf("%s", s)
|
||||
}
|
||||
}
|
||||
|
||||
func tokSource(t token.Token) string {
|
||||
switch t {
|
||||
case ILLEGAL:
|
||||
return "ILLEGAL"
|
||||
case EOF:
|
||||
return "EOF"
|
||||
case COMMENT:
|
||||
return "COMMENT"
|
||||
case IDENT:
|
||||
return "IDENT"
|
||||
case INT:
|
||||
return "INT"
|
||||
case FLOAT:
|
||||
return "FLOAT"
|
||||
case IMAG:
|
||||
return "IMAG"
|
||||
case CHAR:
|
||||
return "CHAR"
|
||||
case STRING:
|
||||
return "STRING"
|
||||
case ADD:
|
||||
return "ADD"
|
||||
case SUB:
|
||||
return "SUB"
|
||||
case MUL:
|
||||
return "MUL"
|
||||
case QUO:
|
||||
return "QUO"
|
||||
case REM:
|
||||
return "REM"
|
||||
case AND:
|
||||
return "AND"
|
||||
case OR:
|
||||
return "OR"
|
||||
case XOR:
|
||||
return "XOR"
|
||||
case SHL:
|
||||
return "SHL"
|
||||
case SHR:
|
||||
return "SHR"
|
||||
case AND_NOT:
|
||||
return "AND_NOT"
|
||||
case ADD_ASSIGN:
|
||||
return "ADD_ASSIGN"
|
||||
case SUB_ASSIGN:
|
||||
return "SUB_ASSIGN"
|
||||
case MUL_ASSIGN:
|
||||
return "MUL_ASSIGN"
|
||||
case QUO_ASSIGN:
|
||||
return "QUO_ASSIGN"
|
||||
case REM_ASSIGN:
|
||||
return "REM_ASSIGN"
|
||||
case AND_ASSIGN:
|
||||
return "AND_ASSIGN"
|
||||
case OR_ASSIGN:
|
||||
return "OR_ASSIGN"
|
||||
case XOR_ASSIGN:
|
||||
return "XOR_ASSIGN"
|
||||
case SHL_ASSIGN:
|
||||
return "SHL_ASSIGN"
|
||||
case SHR_ASSIGN:
|
||||
return "SHR_ASSIGN"
|
||||
case AND_NOT_ASSIGN:
|
||||
return "AND_NOT_ASSIGN"
|
||||
case LAND:
|
||||
return "LAND"
|
||||
case LOR:
|
||||
return "LOR"
|
||||
case ARROW:
|
||||
return "ARROW"
|
||||
case INC:
|
||||
return "INC"
|
||||
case DEC:
|
||||
return "DEC"
|
||||
case EQL:
|
||||
return "EQL"
|
||||
case LSS:
|
||||
return "LSS"
|
||||
case GTR:
|
||||
return "GTR"
|
||||
case ASSIGN:
|
||||
return "ASSIGN"
|
||||
case NOT:
|
||||
return "NOT"
|
||||
case NEQ:
|
||||
return "NEQ"
|
||||
case LEQ:
|
||||
return "LEQ"
|
||||
case GEQ:
|
||||
return "GEQ"
|
||||
case DEFINE:
|
||||
return "DEFINE"
|
||||
case ELLIPSIS:
|
||||
return "ELLIPSIS"
|
||||
case LPAREN:
|
||||
return "LPAREN"
|
||||
case LBRACK:
|
||||
return "LBRACK"
|
||||
case LBRACE:
|
||||
return "LBRACE"
|
||||
case COMMA:
|
||||
return "COMMA"
|
||||
case PERIOD:
|
||||
return "PERIOD"
|
||||
case RPAREN:
|
||||
return "RPAREN"
|
||||
case RBRACK:
|
||||
return "RBRACK"
|
||||
case RBRACE:
|
||||
return "RBRACE"
|
||||
case SEMICOLON:
|
||||
return "SEMICOLON"
|
||||
case COLON:
|
||||
return "COLON"
|
||||
case BREAK:
|
||||
return "BREAK"
|
||||
case CASE:
|
||||
return "CASE"
|
||||
case CHAN:
|
||||
return "CHAN"
|
||||
case CONST:
|
||||
return "CONST"
|
||||
case CONTINUE:
|
||||
return "CONTINUE"
|
||||
case DEFAULT:
|
||||
return "DEFAULT"
|
||||
case DEFER:
|
||||
return "DEFER"
|
||||
case ELSE:
|
||||
return "ELSE"
|
||||
case FALLTHROUGH:
|
||||
return "FALLTHROUGH"
|
||||
case FOR:
|
||||
return "FOR"
|
||||
case FUNC:
|
||||
return "FUNC"
|
||||
case GO:
|
||||
return "GO"
|
||||
case GOTO:
|
||||
return "GOTO"
|
||||
case IF:
|
||||
return "IF"
|
||||
case IMPORT:
|
||||
return "IMPORT"
|
||||
case INTERFACE:
|
||||
return "INTERFACE"
|
||||
case MAP:
|
||||
return "MAP"
|
||||
case PACKAGE:
|
||||
return "PACKAGE"
|
||||
case RANGE:
|
||||
return "RANGE"
|
||||
case RETURN:
|
||||
return "RETURN"
|
||||
case SELECT:
|
||||
return "SELECT"
|
||||
case STRUCT:
|
||||
return "STRUCT"
|
||||
case SWITCH:
|
||||
return "SWITCH"
|
||||
case TYPE:
|
||||
return "TYPE"
|
||||
case VAR:
|
||||
return "VAR"
|
||||
case TILDE:
|
||||
return "TILDE"
|
||||
default:
|
||||
panic(todo("", int(t), t))
|
||||
}
|
||||
}
|
||||
|
||||
type data struct {
|
||||
line int
|
||||
cases int
|
||||
cnt int
|
||||
}
|
||||
|
||||
type analyzer struct {
|
||||
sync.Mutex
|
||||
m map[int]*data // line: data
|
||||
}
|
||||
|
||||
func newAnalyzer() *analyzer {
|
||||
return &analyzer{m: map[int]*data{}}
|
||||
}
|
||||
|
||||
func (a *analyzer) record(line, cnt int) {
|
||||
d := a.m[line]
|
||||
if d == nil {
|
||||
d = &data{line: line}
|
||||
a.m[line] = d
|
||||
}
|
||||
d.cases++
|
||||
d.cnt += cnt
|
||||
}
|
||||
|
||||
func (a *analyzer) merge(b *analyzer) {
|
||||
a.Lock()
|
||||
defer a.Unlock()
|
||||
|
||||
for k, v := range b.m {
|
||||
d := a.m[k]
|
||||
if d == nil {
|
||||
d = &data{line: k}
|
||||
a.m[k] = d
|
||||
}
|
||||
d.cases += v.cases
|
||||
d.cnt += v.cnt
|
||||
}
|
||||
}
|
||||
|
||||
func (a *analyzer) report() string {
|
||||
var rows []*data
|
||||
for _, v := range a.m {
|
||||
rows = append(rows, v)
|
||||
}
|
||||
sort.Slice(rows, func(i, j int) bool {
|
||||
a := rows[i]
|
||||
b := rows[j]
|
||||
if a.cases < b.cases {
|
||||
return true
|
||||
}
|
||||
|
||||
if a.cases > b.cases {
|
||||
return false
|
||||
}
|
||||
|
||||
// a.cases == b.cases
|
||||
if a.cnt < b.cnt {
|
||||
return true
|
||||
}
|
||||
|
||||
if a.cnt > b.cnt {
|
||||
return false
|
||||
}
|
||||
|
||||
// a.cnt == b.cnt
|
||||
return a.line < b.line
|
||||
})
|
||||
var b strings.Builder
|
||||
var cases, cnt int
|
||||
for _, row := range rows {
|
||||
cases += row.cases
|
||||
cnt += row.cnt
|
||||
avg := float64(row.cnt) / float64(row.cases)
|
||||
fmt.Fprintf(&b, "parser.go:%d:\t%16s %16s %8.1f\n", row.line, h(row.cases), h(row.cnt), avg)
|
||||
}
|
||||
avg := float64(cnt) / float64(cases)
|
||||
fmt.Fprintf(&b, "<total>\t\t%16s %16s %8.1f\n", h(cases), h(cnt), avg)
|
||||
return b.String()
|
||||
}
|
||||
|
||||
func h(v interface{}) string {
|
||||
switch x := v.(type) {
|
||||
case int:
|
||||
return humanize.Comma(int64(x))
|
||||
case int32:
|
||||
return humanize.Comma(int64(x))
|
||||
case int64:
|
||||
return humanize.Comma(x)
|
||||
case uint32:
|
||||
return humanize.Comma(int64(x))
|
||||
case uint64:
|
||||
if x <= math.MaxInt64 {
|
||||
return humanize.Comma(int64(x))
|
||||
}
|
||||
|
||||
return "-" + humanize.Comma(-int64(x))
|
||||
}
|
||||
return fmt.Sprint(v)
|
||||
}
|
||||
|
||||
type parallel struct {
|
||||
limiter chan struct{}
|
||||
}
|
||||
|
||||
func newParallel() *parallel {
|
||||
return ¶llel{
|
||||
limiter: make(chan struct{}, runtime.GOMAXPROCS(0)),
|
||||
}
|
||||
}
|
||||
|
||||
func (p *parallel) throttle(f func()) {
|
||||
p.limiter <- struct{}{}
|
||||
|
||||
defer func() {
|
||||
<-p.limiter
|
||||
}()
|
||||
|
||||
f()
|
||||
}
|
||||
|
||||
func extraTags(verMajor, verMinor int, goos, goarch string) (r []string) {
|
||||
// https://github.com/golang/go/commit/eeb7899137cda1c2cd60dab65ff41f627436db5b
|
||||
//
|
||||
// In Go 1.17 we added register ABI on AMD64 on Linux/macOS/Windows
|
||||
// as a GOEXPERIMENT, on by default. In Go 1.18, we commit to always
|
||||
// enabling register ABI on AMD64.
|
||||
//
|
||||
// Now "go build" for AMD64 always have goexperiment.regabi* tags
|
||||
// set. However, at bootstrapping cmd/dist does not set the tags
|
||||
// when building go_bootstrap. For this to work, unfortunately, we
|
||||
// need to hard-code AMD64 to use register ABI in runtime code.
|
||||
if verMajor == 1 {
|
||||
switch {
|
||||
case verMinor == 17:
|
||||
switch goos {
|
||||
case "linux", "darwin", "windows":
|
||||
if goarch == "amd64" {
|
||||
r = append(r, "goexperiment.regabiargs", "goexperiment.regabiwrappers")
|
||||
}
|
||||
}
|
||||
case verMinor >= 18:
|
||||
if goarch == "amd64" {
|
||||
r = append(r, "goexperiment.regabiargs", "goexperiment.regabiwrappers")
|
||||
}
|
||||
}
|
||||
}
|
||||
return r
|
||||
}
|
761
vendor/modernc.org/gc/v3/gc.go
generated
vendored
Normal file
761
vendor/modernc.org/gc/v3/gc.go
generated
vendored
Normal file
|
@ -0,0 +1,761 @@
|
|||
// Copyright 2022 The Gc Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:generate stringer -output stringer.go -linecomment -type=Kind,ScopeKind,ChanDir,TypeCheck
|
||||
|
||||
package gc // modernc.org/gc/v3
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"go/build"
|
||||
"go/build/constraint"
|
||||
"go/token"
|
||||
"io"
|
||||
"io/fs"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"unicode"
|
||||
|
||||
"github.com/hashicorp/golang-lru/v2"
|
||||
)
|
||||
|
||||
var (
|
||||
trcErrors bool
|
||||
)
|
||||
|
||||
type FileFilter func(cfg *Config, importPath string, matchedFSPaths []string, withTestFiles bool) (pkgFiles []string, err error)
|
||||
|
||||
type TypeCheck int
|
||||
|
||||
const (
|
||||
TypeCheckNone TypeCheck = iota
|
||||
TypeCheckAll
|
||||
)
|
||||
|
||||
type cacheKey struct {
|
||||
buildTagsKey string
|
||||
cfg *Config
|
||||
fsPath string
|
||||
goarch string
|
||||
goos string
|
||||
gopathKey string
|
||||
goroot string
|
||||
importPath string
|
||||
typeCheck TypeCheck
|
||||
|
||||
withTestFiles bool
|
||||
}
|
||||
|
||||
type cacheItem struct {
|
||||
pkg *Package
|
||||
ch chan struct{}
|
||||
}
|
||||
|
||||
func newCacheItem() *cacheItem { return &cacheItem{ch: make(chan struct{})} }
|
||||
|
||||
func (c *cacheItem) set(pkg *Package) {
|
||||
c.pkg = pkg
|
||||
close(c.ch)
|
||||
}
|
||||
|
||||
func (c *cacheItem) wait() *Package {
|
||||
<-c.ch
|
||||
return c.pkg
|
||||
}
|
||||
|
||||
type Cache struct {
|
||||
sync.Mutex
|
||||
lru *lru.TwoQueueCache[cacheKey, *cacheItem]
|
||||
}
|
||||
|
||||
func NewCache(size int) (*Cache, error) {
|
||||
c, err := lru.New2Q[cacheKey, *cacheItem](size)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &Cache{lru: c}, nil
|
||||
}
|
||||
|
||||
func MustNewCache(size int) *Cache {
|
||||
c, err := NewCache(size)
|
||||
if err != nil {
|
||||
panic(todo("", err))
|
||||
}
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
type ConfigOption func(*Config) error
|
||||
|
||||
// Config configures NewPackage
|
||||
//
|
||||
// Config instances can be shared, they are not mutated once created and
|
||||
// configured.
|
||||
type Config struct {
|
||||
abi *ABI
|
||||
buildTagMap map[string]bool
|
||||
buildTags []string
|
||||
buildTagsKey string // Zero byte separated
|
||||
builtin *Package
|
||||
cache *Cache
|
||||
cmp *Package // Go 1.21
|
||||
env map[string]string
|
||||
fs fs.FS
|
||||
goarch string
|
||||
gocompiler string // "gc", "gccgo"
|
||||
goos string
|
||||
gopath string
|
||||
gopathKey string // Zero byte separated
|
||||
goroot string
|
||||
goversion string
|
||||
lookup func(rel, importPath, version string) (fsPath string, err error)
|
||||
parallel *parallel
|
||||
searchGoPaths []string
|
||||
searchGoroot []string
|
||||
|
||||
int Type // Set by NewConfig
|
||||
uint Type // Set by NewConfig
|
||||
|
||||
arch32bit bool
|
||||
configured bool
|
||||
}
|
||||
|
||||
// NewConfig returns a newly created config or an error, if any.
|
||||
func NewConfig(opts ...ConfigOption) (r *Config, err error) {
|
||||
r = &Config{
|
||||
buildTagMap: map[string]bool{},
|
||||
env: map[string]string{},
|
||||
parallel: newParallel(),
|
||||
}
|
||||
|
||||
defer func() {
|
||||
if r != nil {
|
||||
r.configured = true
|
||||
}
|
||||
}()
|
||||
|
||||
r.lookup = r.DefaultLookup
|
||||
ctx := build.Default
|
||||
r.goos = r.getenv("GOOS", ctx.GOOS)
|
||||
r.goarch = r.getenv("GOARCH", ctx.GOARCH)
|
||||
r.goroot = r.getenv("GOROOT", ctx.GOROOT)
|
||||
r.gopath = r.getenv("GOPATH", ctx.GOPATH)
|
||||
r.buildTags = append(r.buildTags, r.goos, r.goarch)
|
||||
r.gocompiler = runtime.Compiler
|
||||
for _, opt := range opts {
|
||||
if err := opt(r); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
if r.abi, err = NewABI(r.goos, r.goarch); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
switch r.goarch {
|
||||
case "386", "arm":
|
||||
r.arch32bit = true
|
||||
}
|
||||
|
||||
// During a particular build, the following build tags are satisfied:
|
||||
//
|
||||
// the target operating system, as spelled by runtime.GOOS, set with the GOOS environment variable.
|
||||
// the target architecture, as spelled by runtime.GOARCH, set with the GOARCH environment variable.
|
||||
// "unix", if GOOS is a Unix or Unix-like system.
|
||||
// the compiler being used, either "gc" or "gccgo"
|
||||
// "cgo", if the cgo command is supported (see CGO_ENABLED in 'go help environment').
|
||||
// a term for each Go major release, through the current version: "go1.1" from Go version 1.1 onward, "go1.12" from Go 1.12, and so on.
|
||||
// any additional tags given by the -tags flag (see 'go help build').
|
||||
// There are no separate build tags for beta or minor releases.
|
||||
if r.goversion == "" {
|
||||
r.goversion = runtime.Version()
|
||||
}
|
||||
if !strings.HasPrefix(r.goversion, "go") || !strings.Contains(r.goversion, ".") {
|
||||
return nil, fmt.Errorf("cannot parse Go version: %s", r.goversion)
|
||||
}
|
||||
|
||||
ver := strings.SplitN(r.goversion[len("go"):], ".", 2)
|
||||
verMajor, err := strconv.Atoi(ver[0])
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("cannot parse Go version %s: %v", r.goversion, err)
|
||||
}
|
||||
|
||||
if verMajor != 1 {
|
||||
return nil, fmt.Errorf("unsupported Go version: %s", r.goversion)
|
||||
}
|
||||
|
||||
switch x, x2 := strings.IndexByte(ver[1], '.'), strings.Index(ver[1], "rc"); {
|
||||
case x >= 0:
|
||||
ver[1] = ver[1][:x]
|
||||
case x2 >= 0:
|
||||
ver[1] = ver[1][:x2]
|
||||
}
|
||||
verMinor, err := strconv.Atoi(ver[1])
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("cannot parse Go version %s: %v", r.goversion, err)
|
||||
}
|
||||
|
||||
for i := 1; i <= verMinor; i++ {
|
||||
r.buildTags = append(r.buildTags, fmt.Sprintf("go%d.%d", verMajor, i))
|
||||
}
|
||||
r.buildTags = append(r.buildTags, r.gocompiler)
|
||||
r.buildTags = append(r.buildTags, extraTags(verMajor, verMinor, r.goos, r.goarch)...)
|
||||
if r.getenv("CGO_ENABLED", "1") == "1" {
|
||||
r.buildTags = append(r.buildTags, "cgo")
|
||||
}
|
||||
for i, v := range r.buildTags {
|
||||
tag := strings.TrimSpace(v)
|
||||
r.buildTags[i] = tag
|
||||
r.buildTagMap[tag] = true
|
||||
}
|
||||
sort.Strings(r.buildTags)
|
||||
r.buildTagsKey = strings.Join(r.buildTags, "\x00")
|
||||
r.searchGoroot = []string{filepath.Join(r.goroot, "src")}
|
||||
r.searchGoPaths = filepath.SplitList(r.gopath)
|
||||
r.gopathKey = strings.Join(r.searchGoPaths, "\x00")
|
||||
for i, v := range r.searchGoPaths {
|
||||
r.searchGoPaths[i] = filepath.Join(v, "src")
|
||||
}
|
||||
|
||||
switch r.cmp, err = r.NewPackage("", "cmp", "", nil, false, TypeCheckNone); {
|
||||
case err != nil:
|
||||
r.cmp = nil
|
||||
default:
|
||||
//TODO r.cmp.Scope.kind = UniverseScope
|
||||
}
|
||||
if r.builtin, err = r.NewPackage("", "builtin", "", nil, false, TypeCheckNone); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
r.builtin.Scope.kind = UniverseScope
|
||||
if err := r.builtin.check(newCtx(r)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return r, nil
|
||||
}
|
||||
|
||||
func (c *Config) universe() *Scope {
|
||||
if c.builtin != nil {
|
||||
return c.builtin.Scope
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *Config) stat(name string) (fs.FileInfo, error) {
|
||||
if c.fs == nil {
|
||||
return os.Stat(name)
|
||||
}
|
||||
|
||||
name = filepath.ToSlash(name)
|
||||
if x, ok := c.fs.(fs.StatFS); ok {
|
||||
return x.Stat(name)
|
||||
}
|
||||
|
||||
f, err := c.fs.Open(name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
defer f.Close()
|
||||
|
||||
return f.Stat()
|
||||
}
|
||||
|
||||
func (c *Config) open(name string) (fs.File, error) {
|
||||
if c.fs == nil {
|
||||
return os.Open(name)
|
||||
}
|
||||
|
||||
name = filepath.ToSlash(name)
|
||||
return c.fs.Open(name)
|
||||
}
|
||||
|
||||
func (c *Config) glob(pattern string) (matches []string, err error) {
|
||||
if c.fs == nil {
|
||||
return filepath.Glob(pattern)
|
||||
}
|
||||
|
||||
pattern = filepath.ToSlash(pattern)
|
||||
return fs.Glob(c.fs, pattern)
|
||||
}
|
||||
|
||||
func (c *Config) checkConstraints(pos token.Position, sep string) (r bool) {
|
||||
if !strings.Contains(sep, "//go:build") && !strings.Contains(sep, "+build") {
|
||||
return true
|
||||
}
|
||||
|
||||
// defer func() { trc("", r) }()
|
||||
|
||||
lines := strings.Split(sep, "\n")
|
||||
var build, plusBuild []string
|
||||
for i, line := range lines {
|
||||
if constraint.IsGoBuild(line) && i < len(lines)-1 && lines[i+1] == "" {
|
||||
build = append(build, line)
|
||||
}
|
||||
if constraint.IsPlusBuild(line) {
|
||||
plusBuild = append(plusBuild, line)
|
||||
}
|
||||
}
|
||||
switch len(build) {
|
||||
case 0:
|
||||
// ok
|
||||
case 1:
|
||||
expr, err := constraint.Parse(build[0])
|
||||
if err != nil {
|
||||
return true
|
||||
}
|
||||
|
||||
return expr.Eval(func(tag string) (r bool) {
|
||||
// defer func() { trc("%q: %v", tag, r) }()
|
||||
switch tag {
|
||||
case "unix":
|
||||
return unixOS[c.goos]
|
||||
default:
|
||||
return c.buildTagMap[tag]
|
||||
}
|
||||
})
|
||||
default:
|
||||
panic(todo("%v: %q", pos, build))
|
||||
}
|
||||
|
||||
for _, line := range plusBuild {
|
||||
expr, err := constraint.Parse(line)
|
||||
if err != nil {
|
||||
return true
|
||||
}
|
||||
|
||||
if !expr.Eval(func(tag string) (r bool) {
|
||||
// defer func() { trc("%q: %v", tag, r) }()
|
||||
switch tag {
|
||||
case "unix":
|
||||
return unixOS[c.goos]
|
||||
default:
|
||||
return c.buildTagMap[tag]
|
||||
}
|
||||
}) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// Default lookup translates import paths, possibly relative to rel, to file system paths.
|
||||
func (c *Config) DefaultLookup(rel, importPath, version string) (fsPath string, err error) {
|
||||
if importPath == "" {
|
||||
return "", fmt.Errorf("import path cannot be emtpy")
|
||||
}
|
||||
|
||||
// Implementation restriction: A compiler may restrict ImportPaths to non-empty
|
||||
// strings using only characters belonging to Unicode's L, M, N, P, and S
|
||||
// general categories (the Graphic characters without spaces) and may also
|
||||
// exclude the characters !"#$%&'()*,:;<=>?[\]^`{|} and the Unicode replacement
|
||||
// character U+FFFD.
|
||||
if strings.ContainsAny(importPath, "!\"#$%&'()*,:;<=>?[\\]^`{|}\ufffd") {
|
||||
return "", fmt.Errorf("invalid import path: %s", importPath)
|
||||
}
|
||||
|
||||
for _, r := range importPath {
|
||||
if !unicode.Is(unicode.L, r) &&
|
||||
!unicode.Is(unicode.M, r) &&
|
||||
!unicode.Is(unicode.N, r) &&
|
||||
!unicode.Is(unicode.P, r) &&
|
||||
!unicode.Is(unicode.S, r) {
|
||||
return "", fmt.Errorf("invalid import path: %s", importPath)
|
||||
}
|
||||
}
|
||||
var search []string
|
||||
ip0 := importPath
|
||||
switch slash := strings.IndexByte(importPath, '/'); {
|
||||
case strings.HasPrefix(importPath, "./"):
|
||||
if rel != "" {
|
||||
panic(todo(""))
|
||||
}
|
||||
|
||||
return "", fmt.Errorf("invalid import path: %s", importPath)
|
||||
case strings.HasPrefix(importPath, "/"):
|
||||
return importPath, nil
|
||||
case slash > 0:
|
||||
ip0 = importPath[:slash]
|
||||
default:
|
||||
ip0 = importPath
|
||||
}
|
||||
if ip0 != "" {
|
||||
switch {
|
||||
case strings.Contains(ip0, "."):
|
||||
search = c.searchGoPaths
|
||||
default:
|
||||
search = c.searchGoroot
|
||||
}
|
||||
}
|
||||
for _, v := range search {
|
||||
fsPath = filepath.Join(v, importPath)
|
||||
dir, err := c.open(fsPath)
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
|
||||
fi, err := dir.Stat()
|
||||
dir.Close()
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
|
||||
if fi.IsDir() {
|
||||
return fsPath, nil
|
||||
}
|
||||
}
|
||||
|
||||
return "", fmt.Errorf("cannot find package %s, searched %v", importPath, search)
|
||||
}
|
||||
|
||||
func (c *Config) getenv(nm, deflt string) (r string) {
|
||||
if r = c.env[nm]; r != "" {
|
||||
return r
|
||||
}
|
||||
|
||||
if r = os.Getenv(nm); r != "" {
|
||||
return r
|
||||
}
|
||||
|
||||
return deflt
|
||||
}
|
||||
|
||||
func DefaultFileFilter(cfg *Config, importPath string, matchedFSPaths []string, withTestFiles bool) (pkgFiles []string, err error) {
|
||||
w := 0
|
||||
for _, v := range matchedFSPaths {
|
||||
base := filepath.Base(v)
|
||||
base = base[:len(base)-len(filepath.Ext(base))]
|
||||
const testSuffix = "_test"
|
||||
if strings.HasSuffix(base, testSuffix) {
|
||||
if !withTestFiles {
|
||||
continue
|
||||
}
|
||||
|
||||
base = base[:len(base)-len(testSuffix)]
|
||||
}
|
||||
if x := strings.LastIndexByte(base, '_'); x > 0 {
|
||||
last := base[x+1:]
|
||||
base = base[:x]
|
||||
var prevLast string
|
||||
if x := strings.LastIndexByte(base, '_'); x > 0 {
|
||||
prevLast = base[x+1:]
|
||||
}
|
||||
if last != "" && prevLast != "" {
|
||||
// *_GOOS_GOARCH
|
||||
if knownOS[prevLast] && prevLast != cfg.goos {
|
||||
continue
|
||||
}
|
||||
|
||||
if knownArch[last] && last != cfg.goarch {
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
if last != "" {
|
||||
// *_GOOS or *_GOARCH
|
||||
if knownOS[last] && last != cfg.goos {
|
||||
continue
|
||||
}
|
||||
|
||||
if knownArch[last] && last != cfg.goarch {
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
matchedFSPaths[w] = v
|
||||
w++
|
||||
}
|
||||
return matchedFSPaths[:w], nil
|
||||
}
|
||||
|
||||
// ConfigBuildTags configures build tags.
|
||||
func ConfigBuildTags(tags []string) ConfigOption {
|
||||
return func(cfg *Config) error {
|
||||
if cfg.configured {
|
||||
return fmt.Errorf("ConfigBuildTags: Config instance already configured")
|
||||
}
|
||||
|
||||
cfg.buildTags = append(cfg.buildTags, tags...)
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// ConfigEnviron configures environment variables.
|
||||
func ConfigEnviron(env []string) ConfigOption {
|
||||
return func(cfg *Config) error {
|
||||
if cfg.configured {
|
||||
return fmt.Errorf("ConfigEnviron: Config instance already configured")
|
||||
}
|
||||
|
||||
for _, v := range env {
|
||||
switch x := strings.IndexByte(v, '='); {
|
||||
case x < 0:
|
||||
cfg.env[v] = ""
|
||||
default:
|
||||
cfg.env[v[:x]] = v[x+1:]
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// ConfigFS configures a file system used for opening Go source files. If not
|
||||
// explicitly configured, a default os.DirFS("/") is used on Unix-like
|
||||
// operating systems. On Windows it will be rooted on the volume where
|
||||
// runtime.GOROOT() is.
|
||||
func ConfigFS(fs fs.FS) ConfigOption {
|
||||
return func(cfg *Config) error {
|
||||
if cfg.configured {
|
||||
return fmt.Errorf("ConfigFS: Config instance already configured")
|
||||
}
|
||||
|
||||
cfg.fs = fs
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// ConfigLookup configures a lookup function.
|
||||
func ConfigLookup(f func(dir, importPath, version string) (fsPath string, err error)) ConfigOption {
|
||||
return func(cfg *Config) error {
|
||||
if cfg.configured {
|
||||
return fmt.Errorf("ConfigLookup: Config instance already configured")
|
||||
}
|
||||
|
||||
cfg.lookup = f
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// ConfigCache configures a cache.
|
||||
func ConfigCache(c *Cache) ConfigOption {
|
||||
return func(cfg *Config) error {
|
||||
if cfg.configured {
|
||||
return fmt.Errorf("ConfigCache: Config instance already configured")
|
||||
}
|
||||
|
||||
cfg.cache = c
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
type importGuard struct {
|
||||
m map[string]struct{}
|
||||
stack []string
|
||||
}
|
||||
|
||||
func newImportGuard() *importGuard { return &importGuard{m: map[string]struct{}{}} }
|
||||
|
||||
// Package represents a Go package. The instance must not be mutated.
|
||||
type Package struct {
|
||||
AST map[string]*AST // AST maps fsPaths of individual files to their respective ASTs
|
||||
FSPath string
|
||||
GoFiles []fs.FileInfo
|
||||
ImportPath string
|
||||
InvalidGoFiles map[string]error // errors for particular files, if any
|
||||
Name Token
|
||||
Scope *Scope // Package scope.
|
||||
Version string
|
||||
cfg *Config
|
||||
guard *importGuard
|
||||
mu sync.Mutex
|
||||
typeCheck TypeCheck
|
||||
|
||||
isUnsafe bool // ImportPath == "usnafe"
|
||||
// isChecked bool
|
||||
}
|
||||
|
||||
// NewPackage returns a Package, possibly cached, for importPath@version or an
|
||||
// error, if any. The fileFilter argument can be nil, in such case
|
||||
// DefaultFileFilter is used, which ignores Files with suffix _test.go unless
|
||||
// withTestFiles is true.
|
||||
//
|
||||
// NewPackage is safe for concurrent use by multiple goroutines.
|
||||
func (c *Config) NewPackage(dir, importPath, version string, fileFilter FileFilter, withTestFiles bool, typeCheck TypeCheck) (pkg *Package, err error) {
|
||||
return c.newPackage(dir, importPath, version, fileFilter, withTestFiles, typeCheck, newImportGuard())
|
||||
}
|
||||
|
||||
func (c *Config) newPackage(dir, importPath, version string, fileFilter FileFilter, withTestFiles bool, typeCheck TypeCheck, guard *importGuard) (pkg *Package, err error) {
|
||||
if _, ok := guard.m[importPath]; ok {
|
||||
return nil, fmt.Errorf("import cycle %v", guard.stack)
|
||||
}
|
||||
|
||||
guard.stack = append(guard.stack, importPath)
|
||||
fsPath, err := c.lookup(dir, importPath, version)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("lookup %s: %v", importPath, err)
|
||||
}
|
||||
|
||||
pat := filepath.Join(fsPath, "*.go")
|
||||
matches, err := c.glob(pat)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("glob %s: %v", pat, err)
|
||||
}
|
||||
|
||||
if len(matches) == 0 {
|
||||
return nil, fmt.Errorf("no Go files in %s", fsPath)
|
||||
}
|
||||
|
||||
if fileFilter == nil {
|
||||
fileFilter = DefaultFileFilter
|
||||
}
|
||||
if matches, err = fileFilter(c, importPath, matches, withTestFiles); err != nil {
|
||||
return nil, fmt.Errorf("matching Go files in %s: %v", fsPath, err)
|
||||
}
|
||||
|
||||
var k cacheKey
|
||||
if c.cache != nil {
|
||||
k = cacheKey{
|
||||
buildTagsKey: c.buildTagsKey,
|
||||
cfg: c,
|
||||
fsPath: fsPath,
|
||||
goarch: c.goarch,
|
||||
goos: c.goos,
|
||||
gopathKey: c.gopathKey,
|
||||
goroot: c.goroot,
|
||||
importPath: importPath,
|
||||
typeCheck: typeCheck,
|
||||
withTestFiles: withTestFiles,
|
||||
}
|
||||
|
||||
c.cache.Lock() // ---------------------------------------- lock
|
||||
item, ok := c.cache.lru.Get(k)
|
||||
if ok {
|
||||
c.cache.Unlock() // ---------------------------- unlock
|
||||
if pkg = item.wait(); pkg != nil && pkg.matches(&k, matches) {
|
||||
return pkg, nil
|
||||
}
|
||||
}
|
||||
|
||||
item = newCacheItem()
|
||||
c.cache.lru.Add(k, item)
|
||||
c.cache.Unlock() // ------------------------------------ unlock
|
||||
|
||||
defer func() {
|
||||
if pkg != nil && err == nil {
|
||||
item.set(pkg)
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
r := &Package{
|
||||
AST: map[string]*AST{},
|
||||
FSPath: fsPath,
|
||||
ImportPath: importPath,
|
||||
Scope: newScope(c.universe(), PackageScope),
|
||||
Version: version,
|
||||
cfg: c,
|
||||
guard: guard,
|
||||
isUnsafe: importPath == "unsafe",
|
||||
typeCheck: typeCheck,
|
||||
}
|
||||
|
||||
defer func() { r.guard = nil }()
|
||||
|
||||
sort.Strings(matches)
|
||||
|
||||
defer func() {
|
||||
sort.Slice(r.GoFiles, func(i, j int) bool { return r.GoFiles[i].Name() < r.GoFiles[j].Name() })
|
||||
if err != nil || len(r.InvalidGoFiles) != 0 || typeCheck == TypeCheckNone {
|
||||
return
|
||||
}
|
||||
|
||||
//TODO err = r.check(newCtx(c))
|
||||
}()
|
||||
|
||||
c.parallel.throttle(func() {
|
||||
for _, path := range matches {
|
||||
if err = c.newPackageFile(r, path); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
})
|
||||
return r, err
|
||||
}
|
||||
|
||||
func (c *Config) newPackageFile(pkg *Package, path string) (err error) {
|
||||
f, err := c.open(path)
|
||||
if err != nil {
|
||||
return fmt.Errorf("opening file %q: %v", path, err)
|
||||
}
|
||||
|
||||
defer func() {
|
||||
f.Close()
|
||||
if err != nil {
|
||||
if pkg.InvalidGoFiles == nil {
|
||||
pkg.InvalidGoFiles = map[string]error{}
|
||||
}
|
||||
pkg.InvalidGoFiles[path] = err
|
||||
}
|
||||
}()
|
||||
|
||||
var fi fs.FileInfo
|
||||
if fi, err = f.Stat(); err != nil {
|
||||
return fmt.Errorf("stat %s: %v", path, err)
|
||||
}
|
||||
|
||||
if !fi.Mode().IsRegular() {
|
||||
return nil
|
||||
}
|
||||
|
||||
var b []byte
|
||||
if b, err = io.ReadAll(f); err != nil {
|
||||
return fmt.Errorf("reading %s: %v", path, err)
|
||||
}
|
||||
|
||||
p := newParser(pkg.Scope, path, b, false)
|
||||
if p.peek(0) == PACKAGE {
|
||||
tok := Token{p.s.source, p.s.toks[p.ix].ch, int32(p.ix)}
|
||||
if !c.checkConstraints(tok.Position(), tok.Sep()) {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
pkg.GoFiles = append(pkg.GoFiles, fi)
|
||||
var ast *AST
|
||||
if ast, err = p.parse(); err != nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
pkg.AST[path] = ast
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *Package) matches(k *cacheKey, matches []string) bool {
|
||||
matched := map[string]struct{}{}
|
||||
for _, match := range matches {
|
||||
matched[match] = struct{}{}
|
||||
}
|
||||
for _, cachedInfo := range p.GoFiles {
|
||||
name := cachedInfo.Name()
|
||||
path := filepath.Join(p.FSPath, name)
|
||||
if _, ok := matched[path]; !ok {
|
||||
return false
|
||||
}
|
||||
|
||||
info, err := k.cfg.stat(path)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
if info.IsDir() ||
|
||||
info.Size() != cachedInfo.Size() ||
|
||||
info.ModTime().After(cachedInfo.ModTime()) ||
|
||||
info.Mode() != cachedInfo.Mode() {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// ParseFile parses 'b', assuming it comes from 'path' and returns an AST or error, if any.
|
||||
func ParseFile(path string, b []byte) (*AST, error) {
|
||||
return newParser(newScope(nil, PackageScope), path, b, false).parse()
|
||||
}
|
9415
vendor/modernc.org/gc/v3/parser.go
generated
vendored
Normal file
9415
vendor/modernc.org/gc/v3/parser.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
1446
vendor/modernc.org/gc/v3/scanner.go
generated
vendored
Normal file
1446
vendor/modernc.org/gc/v3/scanner.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
115
vendor/modernc.org/gc/v3/stringer.go
generated
vendored
Normal file
115
vendor/modernc.org/gc/v3/stringer.go
generated
vendored
Normal file
|
@ -0,0 +1,115 @@
|
|||
// Code generated by "stringer -output stringer.go -linecomment -type=Kind,ScopeKind,ChanDir,TypeCheck"; DO NOT EDIT.
|
||||
|
||||
package gc
|
||||
|
||||
import "strconv"
|
||||
|
||||
func _() {
|
||||
// An "invalid array index" compiler error signifies that the constant values have changed.
|
||||
// Re-run the stringer command to generate them again.
|
||||
var x [1]struct{}
|
||||
_ = x[InvalidKind-0]
|
||||
_ = x[Array-1]
|
||||
_ = x[Bool-2]
|
||||
_ = x[Chan-3]
|
||||
_ = x[Complex128-4]
|
||||
_ = x[Complex64-5]
|
||||
_ = x[Float32-6]
|
||||
_ = x[Float64-7]
|
||||
_ = x[Function-8]
|
||||
_ = x[Int-9]
|
||||
_ = x[Int16-10]
|
||||
_ = x[Int32-11]
|
||||
_ = x[Int64-12]
|
||||
_ = x[Int8-13]
|
||||
_ = x[Interface-14]
|
||||
_ = x[Map-15]
|
||||
_ = x[Pointer-16]
|
||||
_ = x[Slice-17]
|
||||
_ = x[String-18]
|
||||
_ = x[Struct-19]
|
||||
_ = x[Tuple-20]
|
||||
_ = x[Uint-21]
|
||||
_ = x[Uint16-22]
|
||||
_ = x[Uint32-23]
|
||||
_ = x[Uint64-24]
|
||||
_ = x[Uint8-25]
|
||||
_ = x[Uintptr-26]
|
||||
_ = x[UnsafePointer-27]
|
||||
_ = x[UntypedBool-28]
|
||||
_ = x[UntypedComplex-29]
|
||||
_ = x[UntypedFloat-30]
|
||||
_ = x[UntypedInt-31]
|
||||
_ = x[UntypedNil-32]
|
||||
_ = x[UntypedRune-33]
|
||||
_ = x[UntypedString-34]
|
||||
}
|
||||
|
||||
const _Kind_name = "<invalid type>arrayboolchancomplex128complex64float32float64functionintint16int32int64int8interfacemappointerslicestringstructtupleuintuint16uint32uint64uint8uintptrunsafe.Pointeruntyped booluntyped complexuntyped floatuntyped intuntyped niluntyped runeuntyped string"
|
||||
|
||||
var _Kind_index = [...]uint16{0, 14, 19, 23, 27, 37, 46, 53, 60, 68, 71, 76, 81, 86, 90, 99, 102, 109, 114, 120, 126, 131, 135, 141, 147, 153, 158, 165, 179, 191, 206, 219, 230, 241, 253, 267}
|
||||
|
||||
func (i Kind) String() string {
|
||||
if i >= Kind(len(_Kind_index)-1) {
|
||||
return "Kind(" + strconv.FormatInt(int64(i), 10) + ")"
|
||||
}
|
||||
return _Kind_name[_Kind_index[i]:_Kind_index[i+1]]
|
||||
}
|
||||
func _() {
|
||||
// An "invalid array index" compiler error signifies that the constant values have changed.
|
||||
// Re-run the stringer command to generate them again.
|
||||
var x [1]struct{}
|
||||
_ = x[scZero-0]
|
||||
_ = x[UniverseScope-1]
|
||||
_ = x[PackageScope-2]
|
||||
_ = x[FileScope-3]
|
||||
_ = x[OtherScope-4]
|
||||
}
|
||||
|
||||
const _ScopeKind_name = "scZeroUniverseScopePackageScopeFileScopeOtherScope"
|
||||
|
||||
var _ScopeKind_index = [...]uint8{0, 6, 19, 31, 40, 50}
|
||||
|
||||
func (i ScopeKind) String() string {
|
||||
if i < 0 || i >= ScopeKind(len(_ScopeKind_index)-1) {
|
||||
return "ScopeKind(" + strconv.FormatInt(int64(i), 10) + ")"
|
||||
}
|
||||
return _ScopeKind_name[_ScopeKind_index[i]:_ScopeKind_index[i+1]]
|
||||
}
|
||||
func _() {
|
||||
// An "invalid array index" compiler error signifies that the constant values have changed.
|
||||
// Re-run the stringer command to generate them again.
|
||||
var x [1]struct{}
|
||||
_ = x[SendRecv-0]
|
||||
_ = x[SendOnly-1]
|
||||
_ = x[RecvOnly-2]
|
||||
}
|
||||
|
||||
const _ChanDir_name = "SendRecvSendOnlyRecvOnly"
|
||||
|
||||
var _ChanDir_index = [...]uint8{0, 8, 16, 24}
|
||||
|
||||
func (i ChanDir) String() string {
|
||||
if i < 0 || i >= ChanDir(len(_ChanDir_index)-1) {
|
||||
return "ChanDir(" + strconv.FormatInt(int64(i), 10) + ")"
|
||||
}
|
||||
return _ChanDir_name[_ChanDir_index[i]:_ChanDir_index[i+1]]
|
||||
}
|
||||
func _() {
|
||||
// An "invalid array index" compiler error signifies that the constant values have changed.
|
||||
// Re-run the stringer command to generate them again.
|
||||
var x [1]struct{}
|
||||
_ = x[TypeCheckNone-0]
|
||||
_ = x[TypeCheckAll-1]
|
||||
}
|
||||
|
||||
const _TypeCheck_name = "TypeCheckNoneTypeCheckAll"
|
||||
|
||||
var _TypeCheck_index = [...]uint8{0, 13, 25}
|
||||
|
||||
func (i TypeCheck) String() string {
|
||||
if i < 0 || i >= TypeCheck(len(_TypeCheck_index)-1) {
|
||||
return "TypeCheck(" + strconv.FormatInt(int64(i), 10) + ")"
|
||||
}
|
||||
return _TypeCheck_name[_TypeCheck_index[i]:_TypeCheck_index[i+1]]
|
||||
}
|
90
vendor/modernc.org/gc/v3/syslist.go
generated
vendored
Normal file
90
vendor/modernc.org/gc/v3/syslist.go
generated
vendored
Normal file
|
@ -0,0 +1,90 @@
|
|||
// Copyright 2011 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the GO-LICENSE file.
|
||||
|
||||
// Modifications
|
||||
//
|
||||
// Copyright 2022 The Gc Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// package build // /usr/local/go/src/go/build/syslist.go
|
||||
|
||||
package gc // import "modernc.org/gc/v3"
|
||||
|
||||
// Go 1.19.3
|
||||
|
||||
// Note that this file is read by internal/goarch/gengoarch.go and by
|
||||
// internal/goos/gengoos.go. If you change this file, look at those
|
||||
// files as well.
|
||||
|
||||
// knownOS is the list of past, present, and future known GOOS values.
|
||||
// Do not remove from this list, as it is used for filename matching.
|
||||
// If you add an entry to this list, look at unixOS, below.
|
||||
var knownOS = map[string]bool{
|
||||
"aix": true,
|
||||
"android": true,
|
||||
"darwin": true,
|
||||
"dragonfly": true,
|
||||
"freebsd": true,
|
||||
"hurd": true,
|
||||
"illumos": true,
|
||||
"ios": true,
|
||||
"js": true,
|
||||
"linux": true,
|
||||
"nacl": true,
|
||||
"netbsd": true,
|
||||
"openbsd": true,
|
||||
"plan9": true,
|
||||
"solaris": true,
|
||||
"windows": true,
|
||||
"zos": true,
|
||||
}
|
||||
|
||||
// unixOS is the set of GOOS values matched by the "unix" build tag.
|
||||
// This is not used for filename matching.
|
||||
// This list also appears in cmd/dist/build.go and
|
||||
// cmd/go/internal/imports/build.go.
|
||||
var unixOS = map[string]bool{
|
||||
"aix": true,
|
||||
"android": true,
|
||||
"darwin": true,
|
||||
"dragonfly": true,
|
||||
"freebsd": true,
|
||||
"hurd": true,
|
||||
"illumos": true,
|
||||
"ios": true,
|
||||
"linux": true,
|
||||
"netbsd": true,
|
||||
"openbsd": true,
|
||||
"solaris": true,
|
||||
}
|
||||
|
||||
// knownArch is the list of past, present, and future known GOARCH values.
|
||||
// Do not remove from this list, as it is used for filename matching.
|
||||
var knownArch = map[string]bool{
|
||||
"386": true,
|
||||
"amd64": true,
|
||||
"amd64p32": true,
|
||||
"arm": true,
|
||||
"armbe": true,
|
||||
"arm64": true,
|
||||
"arm64be": true,
|
||||
"loong64": true,
|
||||
"mips": true,
|
||||
"mipsle": true,
|
||||
"mips64": true,
|
||||
"mips64le": true,
|
||||
"mips64p32": true,
|
||||
"mips64p32le": true,
|
||||
"ppc": true,
|
||||
"ppc64": true,
|
||||
"ppc64le": true,
|
||||
"riscv": true,
|
||||
"riscv64": true,
|
||||
"s390": true,
|
||||
"s390x": true,
|
||||
"sparc": true,
|
||||
"sparc64": true,
|
||||
"wasm": true,
|
||||
}
|
813
vendor/modernc.org/gc/v3/type.go
generated
vendored
Normal file
813
vendor/modernc.org/gc/v3/type.go
generated
vendored
Normal file
|
@ -0,0 +1,813 @@
|
|||
// Copyright 2022 The Gc Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package gc // modernc.org/gc/v3
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"go/token"
|
||||
"strings"
|
||||
)
|
||||
|
||||
var (
|
||||
Invalid = &InvalidType{}
|
||||
)
|
||||
|
||||
var (
|
||||
_ Type = (*ArrayTypeNode)(nil)
|
||||
_ Type = (*ChannelTypeNode)(nil)
|
||||
_ Type = (*FunctionTypeNode)(nil)
|
||||
_ Type = (*InterfaceTypeNode)(nil)
|
||||
_ Type = (*InvalidType)(nil)
|
||||
_ Type = (*MapTypeNode)(nil)
|
||||
_ Type = (*ParenthesizedTypeNode)(nil)
|
||||
_ Type = (*PointerTypeNode)(nil)
|
||||
_ Type = (*PredeclaredType)(nil)
|
||||
_ Type = (*SliceTypeNode)(nil)
|
||||
_ Type = (*StructTypeNode)(nil)
|
||||
_ Type = (*TupleType)(nil)
|
||||
_ Type = (*TypeDefNode)(nil)
|
||||
_ Type = (*TypeNameNode)(nil)
|
||||
_ Type = (*TypeNode)(nil)
|
||||
|
||||
invalidRecursiveType = &InvalidType{}
|
||||
)
|
||||
|
||||
// A Kind represents the specific kind of type that a Type represents. The zero
|
||||
// Kind is not a valid kind.
|
||||
type Kind byte
|
||||
|
||||
// Values of type Kind
|
||||
const (
|
||||
InvalidKind Kind = iota // <invalid type>
|
||||
|
||||
Array // array
|
||||
Bool // bool
|
||||
Chan // chan
|
||||
Complex128 // complex128
|
||||
Complex64 // complex64
|
||||
Float32 // float32
|
||||
Float64 // float64
|
||||
Function // function
|
||||
Int // int
|
||||
Int16 // int16
|
||||
Int32 // int32
|
||||
Int64 // int64
|
||||
Int8 // int8
|
||||
Interface // interface
|
||||
Map // map
|
||||
Pointer // pointer
|
||||
Slice // slice
|
||||
String // string
|
||||
Struct // struct
|
||||
Tuple // tuple
|
||||
Uint // uint
|
||||
Uint16 // uint16
|
||||
Uint32 // uint32
|
||||
Uint64 // uint64
|
||||
Uint8 // uint8
|
||||
Uintptr // uintptr
|
||||
UnsafePointer // unsafe.Pointer
|
||||
UntypedBool // untyped bool
|
||||
UntypedComplex // untyped complex
|
||||
UntypedFloat // untyped float
|
||||
UntypedInt // untyped int
|
||||
UntypedNil // untyped nil
|
||||
UntypedRune // untyped rune
|
||||
UntypedString // untyped string
|
||||
)
|
||||
|
||||
type typeSetter interface {
|
||||
setType(t Type) Type
|
||||
}
|
||||
|
||||
type typeCache struct {
|
||||
t Type
|
||||
}
|
||||
|
||||
func (n *typeCache) Type() Type {
|
||||
if n.t != nil {
|
||||
return n.t
|
||||
}
|
||||
|
||||
n.t = Invalid
|
||||
return Invalid
|
||||
}
|
||||
|
||||
func (n *typeCache) setType(t Type) Type {
|
||||
n.t = t
|
||||
return t
|
||||
}
|
||||
|
||||
func (n *typeCache) enter(c *ctx, nd Node) bool {
|
||||
switch {
|
||||
case n.t == nil:
|
||||
n.t = invalidRecursiveType
|
||||
return true
|
||||
case n.t == invalidRecursiveType:
|
||||
n.t = Invalid
|
||||
c.err(nd, "invalid recursive type")
|
||||
return false
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
type typer interface {
|
||||
Type() Type
|
||||
}
|
||||
|
||||
type Type interface {
|
||||
Node
|
||||
|
||||
// Align returns the alignment in bytes of a value of this type when allocated
|
||||
// in memory.
|
||||
Align() int
|
||||
|
||||
// FieldAlign returns the alignment in bytes of a value of this type when used
|
||||
// as a field in a struct.
|
||||
FieldAlign() int
|
||||
|
||||
// Kind returns the specific kind of this type.
|
||||
Kind() Kind
|
||||
|
||||
// Size returns the number of bytes needed to store a value of the given type;
|
||||
// it is analogous to unsafe.Sizeof.
|
||||
Size() int64
|
||||
|
||||
// String returns a string representation of the type. The string
|
||||
// representation is not guaranteed to be unique among types.
|
||||
String() string
|
||||
|
||||
check(c *ctx) Type
|
||||
}
|
||||
|
||||
func (n *ArrayTypeNode) Align() int { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
func (n *ArrayTypeNode) FieldAlign() int { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
func (n *ArrayTypeNode) Kind() Kind { return Array }
|
||||
func (n *ArrayTypeNode) Size() int64 { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
func (n *ArrayTypeNode) String() string {
|
||||
return fmt.Sprintf("[%v]%v", n.ArrayLength.Value(), n.ElementType)
|
||||
}
|
||||
|
||||
func (n *ArrayTypeNode) check(c *ctx) Type {
|
||||
if n == nil {
|
||||
return Invalid
|
||||
}
|
||||
|
||||
n.ArrayLength = n.ArrayLength.checkExpr(c)
|
||||
v := c.convertValue(n.ArrayLength, n.ArrayLength.Value(), c.cfg.int)
|
||||
if !known(v) {
|
||||
return Invalid
|
||||
}
|
||||
|
||||
n.ElementType.check(c)
|
||||
return n
|
||||
}
|
||||
|
||||
// ChanDir represents a channel direction.
|
||||
type ChanDir int
|
||||
|
||||
// Values of type ChanDir.
|
||||
const (
|
||||
SendRecv ChanDir = iota
|
||||
SendOnly
|
||||
RecvOnly
|
||||
)
|
||||
|
||||
func (n *ChannelTypeNode) Align() int { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
|
||||
func (n *ChannelTypeNode) FieldAlign() int {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *ChannelTypeNode) Kind() Kind { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
func (n *ChannelTypeNode) Size() int64 { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
func (n *ChannelTypeNode) String() string { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
func (n *ChannelTypeNode) check(c *ctx) Type {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *FunctionTypeNode) Align() int { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
|
||||
func (n *FunctionTypeNode) FieldAlign() int {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *FunctionTypeNode) Kind() Kind { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
func (n *FunctionTypeNode) Size() int64 { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
func (n *FunctionTypeNode) String() string {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
func (n *FunctionTypeNode) check(c *ctx) Type {
|
||||
if !n.enter(c, n) {
|
||||
if n.guard == guardChecking {
|
||||
return Invalid
|
||||
}
|
||||
|
||||
return n
|
||||
}
|
||||
|
||||
defer func() { n.guard = guardChecked }()
|
||||
|
||||
n.Signature.check(c)
|
||||
return n
|
||||
}
|
||||
|
||||
func (n *InterfaceTypeNode) Align() int { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
|
||||
func (n *InterfaceTypeNode) FieldAlign() int {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *InterfaceTypeNode) Kind() Kind { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
func (n *InterfaceTypeNode) Size() int64 { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
func (n *InterfaceTypeNode) String() string {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
func (n *InterfaceTypeNode) check(c *ctx) Type {
|
||||
if !n.enter(c, n) {
|
||||
if n.guard == guardChecking {
|
||||
return Invalid
|
||||
}
|
||||
|
||||
return n
|
||||
}
|
||||
|
||||
defer func() { n.guard = guardChecked }()
|
||||
|
||||
n.InterfaceElemList.check(c, n)
|
||||
return n
|
||||
}
|
||||
|
||||
func (n *InterfaceElemListNode) check(c *ctx, t *InterfaceTypeNode) {
|
||||
if n == nil {
|
||||
return
|
||||
}
|
||||
|
||||
for l := n; l != nil; l = l.List {
|
||||
l.InterfaceElem.check(c, t)
|
||||
}
|
||||
}
|
||||
|
||||
func (n *InterfaceElemNode) check(c *ctx, t *InterfaceTypeNode) {
|
||||
if n == nil {
|
||||
return
|
||||
}
|
||||
|
||||
n.MethodElem.check(c, t)
|
||||
n.TypeElem.check(c)
|
||||
}
|
||||
|
||||
func (n *MethodElemNode) check(c *ctx, t *InterfaceTypeNode) {
|
||||
if n == nil {
|
||||
return
|
||||
}
|
||||
|
||||
nm := n.MethodName.Src()
|
||||
if ex := t.methods[nm]; ex != nil {
|
||||
panic(todo(""))
|
||||
}
|
||||
|
||||
if t.methods == nil {
|
||||
t.methods = map[string]*MethodElemNode{}
|
||||
}
|
||||
t.methods[nm] = n
|
||||
n.typ = n.Signature.check(c)
|
||||
}
|
||||
|
||||
func (n *TypeElemListNode) check(c *ctx) {
|
||||
if n == nil {
|
||||
return
|
||||
}
|
||||
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
type InvalidType struct{}
|
||||
|
||||
func (n *InvalidType) Align() int { return 1 }
|
||||
func (n *InvalidType) FieldAlign() int { return 1 }
|
||||
func (n *InvalidType) Kind() Kind { return InvalidKind }
|
||||
func (n *InvalidType) Position() (r token.Position) { return r }
|
||||
func (n *InvalidType) Size() int64 { return 1 }
|
||||
func (n *InvalidType) Source(full bool) string { return "<invalid type>" }
|
||||
func (n *InvalidType) String() string { return "<invalid type>" }
|
||||
func (n *InvalidType) check(c *ctx) Type { return n }
|
||||
|
||||
func (n *MapTypeNode) Align() int { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
func (n *MapTypeNode) FieldAlign() int { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
func (n *MapTypeNode) Kind() Kind { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
func (n *MapTypeNode) Size() int64 { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
func (n *MapTypeNode) String() string { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
func (n *MapTypeNode) check(c *ctx) Type { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
|
||||
func (n *ParenthesizedTypeNode) Align() int {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *ParenthesizedTypeNode) FieldAlign() int {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *ParenthesizedTypeNode) Kind() Kind {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *ParenthesizedTypeNode) Size() int64 {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *ParenthesizedTypeNode) String() string {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *ParenthesizedTypeNode) check(c *ctx) Type {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *PointerTypeNode) Align() int { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
|
||||
func (n *PointerTypeNode) FieldAlign() int {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *PointerTypeNode) Kind() Kind { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
func (n *PointerTypeNode) Size() int64 { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
func (n *PointerTypeNode) String() string { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
|
||||
func (n *PointerTypeNode) check(c *ctx) Type {
|
||||
if !n.enter(c, n) {
|
||||
if n.guard == guardChecking {
|
||||
return Invalid
|
||||
}
|
||||
|
||||
return n
|
||||
}
|
||||
|
||||
defer func() { n.guard = guardChecked }()
|
||||
|
||||
switch x := n.BaseType.(type) {
|
||||
case *TypeNameNode:
|
||||
x.checkDefined(c)
|
||||
default:
|
||||
panic(todo("%v: %T %s", n.Position(), x, n.Source(false)))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
type PredeclaredType struct {
|
||||
Node
|
||||
kind Kind
|
||||
t ABIType
|
||||
}
|
||||
|
||||
func (c *ctx) newPredeclaredType(n Node, kind Kind) *PredeclaredType {
|
||||
t, ok := c.cfg.abi.Types[kind]
|
||||
if !ok && !isAnyUntypedKind(kind) {
|
||||
panic(todo("%v: internal error %s: %s", n.Position(), n.Source(false), kind))
|
||||
}
|
||||
|
||||
return &PredeclaredType{
|
||||
Node: n,
|
||||
kind: kind,
|
||||
t: t,
|
||||
}
|
||||
}
|
||||
|
||||
func (n *PredeclaredType) Align() int { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
|
||||
func (n *PredeclaredType) FieldAlign() int {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *PredeclaredType) Kind() Kind { return n.kind }
|
||||
func (n *PredeclaredType) Size() int64 { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
|
||||
func (n *PredeclaredType) String() string {
|
||||
switch n.Kind() {
|
||||
case
|
||||
String,
|
||||
UntypedInt:
|
||||
|
||||
return n.Kind().String()
|
||||
default:
|
||||
panic(todo("%v: %s %s", n.Position(), n.Kind(), n.Source(false)))
|
||||
}
|
||||
}
|
||||
|
||||
func (n *PredeclaredType) check(c *ctx) Type {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *SliceTypeNode) Align() int { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
func (n *SliceTypeNode) FieldAlign() int { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
func (n *SliceTypeNode) Kind() Kind { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
func (n *SliceTypeNode) Size() int64 { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
func (n *SliceTypeNode) String() string { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
|
||||
func (n *SliceTypeNode) check(c *ctx) Type {
|
||||
if !n.enter(c, n) {
|
||||
if n.guard == guardChecking {
|
||||
return Invalid
|
||||
}
|
||||
|
||||
return n
|
||||
}
|
||||
|
||||
defer func() { n.guard = guardChecked }()
|
||||
|
||||
switch x := n.ElementType.(type) {
|
||||
case *TypeNameNode:
|
||||
x.checkDefined(c)
|
||||
default:
|
||||
panic(todo("%v: %T %s", n.Position(), x, n.Source(false)))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
type Field struct {
|
||||
Declaration *FieldDeclNode
|
||||
Name string
|
||||
}
|
||||
|
||||
func (n *StructTypeNode) Align() int { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
func (n *StructTypeNode) FieldAlign() int { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
func (n *StructTypeNode) Kind() Kind { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
func (n *StructTypeNode) Size() int64 { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
func (n *StructTypeNode) String() string { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
|
||||
func (n *StructTypeNode) check(c *ctx) Type {
|
||||
if !n.enter(c, n) {
|
||||
if n.guard == guardChecking {
|
||||
return Invalid
|
||||
}
|
||||
|
||||
return n
|
||||
}
|
||||
|
||||
defer func() { n.guard = guardChecked }()
|
||||
|
||||
for l := n.FieldDeclList; l != nil; l = l.List {
|
||||
n.fields = append(n.fields, l.check(c)...)
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func (n *FieldDeclListNode) check(c *ctx) []Field {
|
||||
return n.FieldDecl.check(c)
|
||||
}
|
||||
|
||||
func (n *FieldDeclNode) check(c *ctx) (r []Field) {
|
||||
switch {
|
||||
case n.EmbeddedField != nil:
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
default:
|
||||
n.TypeNode.check(c)
|
||||
for l := n.IdentifierList; l != nil; l = l.List {
|
||||
r = append(r, Field{n, l.IDENT.Src()})
|
||||
}
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
type TupleType struct {
|
||||
Node
|
||||
Types []Type
|
||||
}
|
||||
|
||||
func newTupleType(n Node, types []Type) *TupleType { return &TupleType{n, types} }
|
||||
|
||||
func (n *TupleType) Align() int { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
func (n *TupleType) FieldAlign() int { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
func (n *TupleType) Kind() Kind { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
|
||||
func (n *TupleType) Size() int64 { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
|
||||
func (n *TupleType) Source(full bool) (r string) {
|
||||
if n.Node != nil {
|
||||
r = n.Node.Source(full)
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
func (n *TupleType) String() string {
|
||||
var a []string
|
||||
for _, v := range n.Types {
|
||||
a = append(a, v.String())
|
||||
}
|
||||
return fmt.Sprintf("(%s)", strings.Join(a, ", "))
|
||||
}
|
||||
|
||||
func (n *TupleType) check(c *ctx) Type {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *TypeDefNode) Align() int { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
func (n *TypeDefNode) FieldAlign() int { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
func (n *TypeDefNode) Kind() Kind { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
func (n *TypeDefNode) Size() int64 { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
func (n *TypeDefNode) String() string { return fmt.Sprintf("%s.%s", n.pkg.ImportPath, n.IDENT.Src()) }
|
||||
|
||||
func (n *TypeDefNode) check(c *ctx) Type {
|
||||
if n == nil {
|
||||
return Invalid
|
||||
}
|
||||
|
||||
if n.pkg != nil {
|
||||
return n
|
||||
}
|
||||
|
||||
n.pkg = c.pkg
|
||||
if n.TypeParameters != nil {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
switch x := n.TypeNode.check(c).(type) {
|
||||
case *PredeclaredType:
|
||||
n.TypeNode = x
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func (n *TypeNameNode) Align() int { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
func (n *TypeNameNode) FieldAlign() int { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
func (n *TypeNameNode) Kind() Kind { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
func (n *TypeNameNode) Size() int64 { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
func (n *TypeNameNode) String() string { return n.Name.Source(false) }
|
||||
|
||||
func (n *TypeNameNode) checkDefined(c *ctx) bool {
|
||||
switch x := n.Name.(type) {
|
||||
case Token:
|
||||
switch _, nmd := n.LexicalScope().lookup(x); y := nmd.n.(type) {
|
||||
case *TypeDefNode, *AliasDeclNode:
|
||||
return true
|
||||
default:
|
||||
panic(todo("%v: type=%T %s", y.Position(), y, y.Source(false)))
|
||||
}
|
||||
case *QualifiedIdentNode:
|
||||
if !token.IsExported(x.IDENT.Src()) {
|
||||
panic(todo(""))
|
||||
}
|
||||
|
||||
switch _, nmd := n.LexicalScope().lookup(x.PackageName); y := nmd.n.(type) {
|
||||
case *ImportSpecNode:
|
||||
if y.pkg == nil {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
switch _, nmd := y.pkg.Scope.lookup(x.IDENT); z := nmd.n.(type) {
|
||||
case *TypeDefNode, *AliasDeclNode:
|
||||
return true
|
||||
default:
|
||||
panic(todo("%v: type=%T %s", z.Position(), z, z.Source(false)))
|
||||
}
|
||||
default:
|
||||
panic(todo("%v: type=%T %s", y.Position(), y, y.Source(false)))
|
||||
}
|
||||
default:
|
||||
panic(todo("%v: type=%T %s", n.Position(), x, n.Source(false)))
|
||||
}
|
||||
}
|
||||
|
||||
func (n *TypeNameNode) check(c *ctx) Type {
|
||||
if n == nil {
|
||||
return Invalid
|
||||
}
|
||||
|
||||
switch x := n.Name.(type) {
|
||||
case Token:
|
||||
nm := x.Src()
|
||||
if c.isBuiltin() {
|
||||
switch nm {
|
||||
case "bool":
|
||||
return c.newPredeclaredType(n, Bool)
|
||||
case "uint8":
|
||||
return c.newPredeclaredType(n, Uint8)
|
||||
case "uint16":
|
||||
return c.newPredeclaredType(n, Uint16)
|
||||
case "uint32":
|
||||
return c.newPredeclaredType(n, Uint32)
|
||||
case "uint64":
|
||||
return c.newPredeclaredType(n, Uint64)
|
||||
case "int8":
|
||||
return c.newPredeclaredType(n, Int8)
|
||||
case "int16":
|
||||
return c.newPredeclaredType(n, Int16)
|
||||
case "int32":
|
||||
return c.newPredeclaredType(n, Int32)
|
||||
case "int64":
|
||||
return c.newPredeclaredType(n, Int64)
|
||||
case "float32":
|
||||
return c.newPredeclaredType(n, Float32)
|
||||
case "float64":
|
||||
return c.newPredeclaredType(n, Float64)
|
||||
case "complex64":
|
||||
return c.newPredeclaredType(n, Complex64)
|
||||
case "complex128":
|
||||
return c.newPredeclaredType(n, Complex128)
|
||||
case "string":
|
||||
return c.newPredeclaredType(n, String)
|
||||
case "int":
|
||||
return c.newPredeclaredType(n, Int)
|
||||
case "uint":
|
||||
return c.newPredeclaredType(n, Uint)
|
||||
case "uintptr":
|
||||
return c.newPredeclaredType(n, Uintptr)
|
||||
case "Type":
|
||||
// ok
|
||||
default:
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
}
|
||||
|
||||
pkg, _, nmd := c.lookup(n.LexicalScope(), x)
|
||||
switch y := nmd.n.(type) {
|
||||
case *TypeDefNode:
|
||||
if pkg != c.pkg {
|
||||
return y
|
||||
}
|
||||
|
||||
return y.check(c)
|
||||
case nil:
|
||||
panic(todo("%v: %T %s", x.Position(), y, x.Source(false)))
|
||||
default:
|
||||
panic(todo("%v: %T %s", y.Position(), y, y.Source(false)))
|
||||
}
|
||||
default:
|
||||
panic(todo("%v: %T %s", n.Position(), x, n.Source(false)))
|
||||
}
|
||||
}
|
||||
|
||||
func (n *TypeNode) Align() int { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
func (n *TypeNode) FieldAlign() int { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
func (n *TypeNode) Kind() Kind { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
func (n *TypeNode) Size() int64 { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
func (n *TypeNode) String() string { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
func (n *TypeNode) check(c *ctx) Type { panic(todo("%v: %T %s", n.Position(), n, n.Source(false))) }
|
||||
|
||||
func isAnyUntypedType(t Type) bool { return isAnyUntypedKind(t.Kind()) }
|
||||
|
||||
func isAnyUntypedKind(k Kind) bool {
|
||||
switch k {
|
||||
case UntypedBool, UntypedComplex, UntypedFloat, UntypedInt, UntypedNil, UntypedRune, UntypedString:
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
const (
|
||||
guardUnchecked guard = iota
|
||||
guardChecking
|
||||
guardChecked
|
||||
)
|
||||
|
||||
type guard byte
|
||||
|
||||
func (n *guard) enter(c *ctx, nd Node) bool {
|
||||
switch *n {
|
||||
case guardUnchecked:
|
||||
*n = guardChecking
|
||||
return true
|
||||
case guardChecking:
|
||||
c.err(nd, "invalid recursive type")
|
||||
return false
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
func isAnyArithmeticType(t Type) bool { return isArithmeticType(t) || isUntypedArithmeticType(t) }
|
||||
|
||||
func isUntypedArithmeticType(t Type) bool {
|
||||
switch t.Kind() {
|
||||
case UntypedInt, UntypedFloat, UntypedComplex:
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
func isArithmeticType(t Type) bool {
|
||||
return isIntegerType(t) || isFloatType(t) || isComplexType(t)
|
||||
}
|
||||
|
||||
func isComplexType(t Type) bool {
|
||||
switch t.Kind() {
|
||||
case Complex64, Complex128:
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
func isFloatType(t Type) bool {
|
||||
switch t.Kind() {
|
||||
case Float32, Float64:
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
func isIntegerType(t Type) bool {
|
||||
switch t.Kind() {
|
||||
case Int, Int8, Int16, Int32, Int64, Uint, Uint8, Uint16, Uint32, Uint64, Uintptr:
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
func (c *ctx) isIdentical(n Node, t, u Type) bool {
|
||||
tk := t.Kind()
|
||||
uk := u.Kind()
|
||||
if tk != uk {
|
||||
return false
|
||||
}
|
||||
|
||||
if t == u {
|
||||
return true
|
||||
}
|
||||
|
||||
if isAnyUntypedKind(tk) && isAnyUntypedKind(uk) && tk == uk {
|
||||
return true
|
||||
}
|
||||
|
||||
switch x := t.(type) {
|
||||
// case *ArrayTypeNode:
|
||||
// switch y := u.(type) {
|
||||
// case *ArrayTypeNode:
|
||||
// return x.Len == y.Len && c.isIdentical(n, x.Elem, y.Elem)
|
||||
// }
|
||||
// case *StructType:
|
||||
// switch y := u.(type) {
|
||||
// case *StructType:
|
||||
// if len(x.Fields) != len(y.Fields) {
|
||||
// return false
|
||||
// }
|
||||
|
||||
// for i, v := range x.Fields {
|
||||
// w := y.Fields[i]
|
||||
// if v.Name != w.Name || !c.isIdentical(n, v.Type(), w.Type()) {
|
||||
// return false
|
||||
// }
|
||||
// }
|
||||
|
||||
// return true
|
||||
// }
|
||||
// case *FunctionType:
|
||||
// switch y := u.(type) {
|
||||
// case *FunctionType:
|
||||
// in, out := x.Parameters.Types, x.Result.Types
|
||||
// in2, out2 := y.Parameters.Types, y.Result.Types
|
||||
// if len(in) != len(in2) || len(out) != len(out2) {
|
||||
// return false
|
||||
// }
|
||||
|
||||
// for i, v := range in {
|
||||
// if !c.isIdentical(n, v, in2[i]) {
|
||||
// return false
|
||||
// }
|
||||
// }
|
||||
|
||||
// for i, v := range out {
|
||||
// if !c.isIdentical(n, v, out2[i]) {
|
||||
// return false
|
||||
// }
|
||||
// }
|
||||
|
||||
// return true
|
||||
// }
|
||||
// case *PointerType:
|
||||
// switch y := u.(type) {
|
||||
// case *PointerType:
|
||||
// return c.isIdentical(n, x.Elem, y.Elem)
|
||||
// }
|
||||
default:
|
||||
c.err(n, "TODO %v %v", x, u)
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
func (c *ctx) mustIdentical(n Node, t, u Type) bool {
|
||||
if !c.isIdentical(n, t, u) {
|
||||
c.err(n, "incompatible types: %v and %v", t, u)
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
func (c *ctx) checkType(n Node) Type {
|
||||
switch x := n.(type) {
|
||||
case *ArrayTypeNode:
|
||||
return x.check(c)
|
||||
default:
|
||||
c.err(n, "TODO %T", x)
|
||||
return Invalid
|
||||
}
|
||||
}
|
716
vendor/modernc.org/gc/v3/value.go
generated
vendored
Normal file
716
vendor/modernc.org/gc/v3/value.go
generated
vendored
Normal file
|
@ -0,0 +1,716 @@
|
|||
// Copyright 2022 The Gc Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package gc // modernc.org/gc/v3
|
||||
|
||||
import (
|
||||
"go/constant"
|
||||
"math"
|
||||
)
|
||||
|
||||
var (
|
||||
_ Expression = (*BasicLitNode)(nil)
|
||||
_ Expression = (*BinaryExpressionNode)(nil)
|
||||
_ Expression = (*CompositeLitNode)(nil)
|
||||
_ Expression = (*ConversionNode)(nil)
|
||||
_ Expression = (*FunctionLitNode)(nil)
|
||||
_ Expression = (*KeyedElementNode)(nil)
|
||||
_ Expression = (*LiteralValueNode)(nil)
|
||||
_ Expression = (*MethodExprNode)(nil)
|
||||
_ Expression = (*OperandNameNode)(nil)
|
||||
_ Expression = (*OperandNode)(nil)
|
||||
_ Expression = (*OperandQualifiedNameNode)(nil)
|
||||
_ Expression = (*ParenthesizedExpressionNode)(nil)
|
||||
_ Expression = (*PrimaryExprNode)(nil)
|
||||
_ Expression = (*UnaryExprNode)(nil)
|
||||
_ Expression = (*ValueExpression)(nil)
|
||||
|
||||
falseVal = constant.MakeBool(false)
|
||||
trueVal = constant.MakeBool(true)
|
||||
unknown = constant.MakeUnknown()
|
||||
)
|
||||
|
||||
func known(v constant.Value) bool { return v != nil && v.Kind() != constant.Unknown }
|
||||
|
||||
type valueCache struct {
|
||||
v constant.Value
|
||||
}
|
||||
|
||||
func (n *valueCache) Value() constant.Value {
|
||||
if n.v != nil {
|
||||
return n.v
|
||||
}
|
||||
|
||||
return unknown
|
||||
}
|
||||
|
||||
func (n *valueCache) setValue(v constant.Value) constant.Value {
|
||||
n.v = v
|
||||
return v
|
||||
}
|
||||
|
||||
type valuer interface {
|
||||
Value() constant.Value
|
||||
}
|
||||
|
||||
type Expression interface {
|
||||
Node
|
||||
checkExpr(c *ctx) Expression
|
||||
clone() Expression
|
||||
typer
|
||||
valuer
|
||||
}
|
||||
|
||||
type ValueExpression struct {
|
||||
Node
|
||||
typeCache
|
||||
valueCache
|
||||
}
|
||||
|
||||
func (n *ValueExpression) checkExpr(c *ctx) Expression {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *ValueExpression) clone() Expression {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *BasicLitNode) Type() Type {
|
||||
switch n.Ch() {
|
||||
case CHAR:
|
||||
return n.ctx.int32
|
||||
case INT:
|
||||
return n.ctx.untypedInt
|
||||
case FLOAT:
|
||||
return n.ctx.untypedFloat
|
||||
case STRING:
|
||||
return n.ctx.untypedString
|
||||
default:
|
||||
panic(todo("%v: %T %s %v", n.Position(), n, n.Source(false), n.Ch()))
|
||||
}
|
||||
}
|
||||
|
||||
func (n *BasicLitNode) Value() constant.Value {
|
||||
return constant.MakeFromLiteral(n.Src(), n.Ch(), 0)
|
||||
}
|
||||
|
||||
func (n *BasicLitNode) checkExpr(c *ctx) Expression {
|
||||
n.ctx = c
|
||||
if !known(n.Value()) {
|
||||
c.err(n, "invalid literal: %s", n.Source(false))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func (n *BasicLitNode) clone() Expression {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *OperandNameNode) Type() Type {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *OperandNameNode) Value() constant.Value {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *OperandNameNode) checkExpr(c *ctx) Expression {
|
||||
in, named := n.LexicalScope().lookup(n.Name)
|
||||
switch x := named.n.(type) {
|
||||
case *ConstSpecNode:
|
||||
switch in.kind {
|
||||
case UniverseScope:
|
||||
switch n.Name.Src() {
|
||||
case "iota":
|
||||
if c.iota < 0 {
|
||||
panic(todo("%v: %T %s", n.Position(), x, n.Source(false)))
|
||||
}
|
||||
|
||||
r := &ValueExpression{Node: x}
|
||||
r.t = c.untypedInt
|
||||
r.v = constant.MakeInt64(c.iota)
|
||||
return r
|
||||
default:
|
||||
panic(todo("%v: %T %s", n.Position(), x, n.Source(false)))
|
||||
}
|
||||
default:
|
||||
return x.Expression
|
||||
}
|
||||
default:
|
||||
panic(todo("%v: %T %s", n.Position(), x, n.Source(false)))
|
||||
}
|
||||
}
|
||||
|
||||
func (n *OperandNameNode) clone() Expression {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *ParenthesizedExpressionNode) Type() Type {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *ParenthesizedExpressionNode) Value() constant.Value {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *ParenthesizedExpressionNode) checkExpr(c *ctx) Expression {
|
||||
return n.Expression.checkExpr(c)
|
||||
}
|
||||
|
||||
func (n *ParenthesizedExpressionNode) clone() Expression {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *LiteralValueNode) Type() Type {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *LiteralValueNode) Value() constant.Value {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *LiteralValueNode) checkExpr(c *ctx) Expression {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *LiteralValueNode) clone() Expression {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *KeyedElementNode) Type() Type {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *KeyedElementNode) Value() constant.Value {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *KeyedElementNode) checkExpr(c *ctx) Expression {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *KeyedElementNode) clone() Expression {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *CompositeLitNode) Type() Type {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *CompositeLitNode) Value() constant.Value {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *CompositeLitNode) checkExpr(c *ctx) Expression {
|
||||
if n == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
if !n.enter(c, n) {
|
||||
return n
|
||||
}
|
||||
|
||||
t := n.setType(c.checkType(n.LiteralType))
|
||||
n.LiteralValue.check(c, t)
|
||||
return n
|
||||
}
|
||||
|
||||
func (n *CompositeLitNode) clone() Expression {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *LiteralValueNode) check(c *ctx, t Type) {
|
||||
if n == nil {
|
||||
return
|
||||
}
|
||||
|
||||
switch t.Kind() {
|
||||
case Array:
|
||||
n.checkArray(c, t.(*ArrayTypeNode))
|
||||
default:
|
||||
panic(todo("%v: %T %s %v", n.Position(), n, n.Source(false), t.Kind()))
|
||||
}
|
||||
}
|
||||
|
||||
func (n *LiteralValueNode) checkArray(c *ctx, t *ArrayTypeNode) {
|
||||
panic(todo("%v: %T %s %s", n.Position(), n, t, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *FunctionLitNode) Type() Type {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *FunctionLitNode) Value() constant.Value {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *FunctionLitNode) checkExpr(c *ctx) Expression {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *FunctionLitNode) clone() Expression {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *OperandNode) Type() Type {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *OperandNode) Value() constant.Value {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *OperandNode) checkExpr(c *ctx) Expression {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *OperandNode) clone() Expression {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *OperandQualifiedNameNode) Type() Type {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *OperandQualifiedNameNode) Value() constant.Value {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *OperandQualifiedNameNode) checkExpr(c *ctx) Expression {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *OperandQualifiedNameNode) clone() Expression {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *ConversionNode) Type() Type {
|
||||
return n.TypeNode
|
||||
}
|
||||
|
||||
func (n *ConversionNode) checkExpr(c *ctx) Expression {
|
||||
t := n.TypeNode.check(c)
|
||||
n.Expression = n.Expression.checkExpr(c)
|
||||
v := n.Expression.Value()
|
||||
n.v = c.convertValue(n.Expression, v, t)
|
||||
return n
|
||||
}
|
||||
|
||||
func (n *ConversionNode) clone() Expression {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *MethodExprNode) Type() Type {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *MethodExprNode) Value() constant.Value {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *MethodExprNode) checkExpr(c *ctx) Expression {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *MethodExprNode) clone() Expression {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *PrimaryExprNode) Type() Type {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *PrimaryExprNode) Value() constant.Value {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *PrimaryExprNode) checkExpr(c *ctx) Expression {
|
||||
switch x := n.PrimaryExpr.(type) {
|
||||
case *OperandNameNode:
|
||||
_, named := x.LexicalScope().lookup(x.Name)
|
||||
switch y := named.n.(type) {
|
||||
case *TypeDefNode:
|
||||
switch z := n.Postfix.(type) {
|
||||
case *ArgumentsNode:
|
||||
cnv := &ConversionNode{
|
||||
TypeNode: &TypeNameNode{
|
||||
Name: x.Name,
|
||||
lexicalScoper: x.lexicalScoper,
|
||||
},
|
||||
LPAREN: z.LPAREN,
|
||||
Expression: z.Expression,
|
||||
RPAREN: z.RPAREN,
|
||||
}
|
||||
return cnv.checkExpr(c)
|
||||
default:
|
||||
panic(todo("%v: %T %s", n.Position(), z, n.Source(false)))
|
||||
}
|
||||
default:
|
||||
panic(todo("%v: %T %s", n.Position(), y, n.Source(false)))
|
||||
}
|
||||
default:
|
||||
panic(todo("%v: %T %s", n.Position(), x, n.Source(false)))
|
||||
}
|
||||
|
||||
n.PrimaryExpr = n.PrimaryExpr.checkExpr(c)
|
||||
switch x := n.Postfix.(type) {
|
||||
default:
|
||||
panic(todo("%v: %T %s", n.Position(), x, n.Source(false)))
|
||||
}
|
||||
}
|
||||
|
||||
func (n *PrimaryExprNode) clone() Expression {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *BinaryExpressionNode) checkExpr(c *ctx) (r Expression) {
|
||||
if n == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
if n.typeCache.Type() != Invalid {
|
||||
return n
|
||||
}
|
||||
|
||||
n.LHS = n.LHS.checkExpr(c)
|
||||
n.RHS = n.RHS.checkExpr(c)
|
||||
lv := n.LHS.Value()
|
||||
lt := n.LHS.Type()
|
||||
rv := n.RHS.Value()
|
||||
rt := n.RHS.Type()
|
||||
|
||||
defer func() {
|
||||
if known(lv) && known(rv) && r != nil && !known(r.Value()) {
|
||||
c.err(n.Op, "operation value not determined: %v %s %v", lv, n.Op.Src(), rv)
|
||||
}
|
||||
}()
|
||||
|
||||
switch n.Op.Ch() {
|
||||
case SHL, SHR:
|
||||
var u uint64
|
||||
var uOk bool
|
||||
n.t = lt
|
||||
// The right operand in a shift expression must have integer type or be an
|
||||
// untyped constant representable by a value of type uint.
|
||||
switch {
|
||||
case isIntegerType(rt):
|
||||
// ok
|
||||
case known(rv):
|
||||
if isAnyArithmeticType(rt) {
|
||||
rv = c.convertValue(n.RHS, rv, c.cfg.uint)
|
||||
if known(rv) {
|
||||
u, uOk = constant.Uint64Val(rv)
|
||||
}
|
||||
break
|
||||
}
|
||||
|
||||
c.err(n.Op, "TODO %v", n.Op.Src())
|
||||
return n
|
||||
default:
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
return n
|
||||
}
|
||||
|
||||
// If the left operand of a non-constant shift expression is an untyped
|
||||
// constant, it is first implicitly converted to the type it would assume if
|
||||
// the shift expression were replaced by its left operand alone.
|
||||
switch {
|
||||
case known(lv) && !known(rv):
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
// c.err(n.Op, "TODO %v", n.Op.Ch.str())
|
||||
// return n
|
||||
case known(lv) && known(rv):
|
||||
if !uOk {
|
||||
panic(todo(""))
|
||||
}
|
||||
|
||||
n.t = lt
|
||||
n.v = constant.Shift(lv, n.Op.Ch(), uint(u))
|
||||
default:
|
||||
trc("", known(lv), known(rv), u, uOk)
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
// n.t = lt
|
||||
// n.v = constant.BinaryOp(lv, n.Op.Ch(), rv)
|
||||
}
|
||||
case ADD, SUB, MUL, QUO, REM:
|
||||
if !isAnyArithmeticType(lt) || !isAnyArithmeticType(rt) {
|
||||
c.err(n.Op, "TODO %v %v", lt, rt)
|
||||
break
|
||||
}
|
||||
|
||||
// For other binary operators, the operand types must be identical unless the
|
||||
// operation involves shifts or untyped constants.
|
||||
//
|
||||
// Except for shift operations, if one operand is an untyped constant and the
|
||||
// other operand is not, the constant is implicitly converted to the type of
|
||||
// the other operand.
|
||||
switch {
|
||||
case isAnyUntypedType(lt) && isAnyUntypedType(rt):
|
||||
n.v = constant.BinaryOp(lv, n.Op.Ch(), rv)
|
||||
switch n.v.Kind() {
|
||||
case constant.Int:
|
||||
n.t = c.untypedInt
|
||||
case constant.Float:
|
||||
n.t = c.untypedFloat
|
||||
default:
|
||||
c.err(n.Op, "TODO %v %v %q %v %v -> %v %v", lv, lt, n.Op.Src(), rv, rt, n.v, n.v.Kind())
|
||||
}
|
||||
case isAnyUntypedType(lt) && !isAnyUntypedType(rt):
|
||||
c.err(n.Op, "TODO %v %v %q %v %v", lv, lt, n.Op.Src(), rv, rt)
|
||||
case !isAnyUntypedType(lt) && isAnyUntypedType(rt):
|
||||
c.err(n.Op, "TODO %v %v %q %v %v", lv, lt, n.Op.Src(), rv, rt)
|
||||
default: // case !isAnyUntypedType(lt) && !isAnyUntypedType(rt):
|
||||
c.err(n.Op, "TODO %v %v %q %v %v", lv, lt, n.Op.Src(), rv, rt)
|
||||
}
|
||||
default:
|
||||
c.err(n.Op, "TODO %v %v %q %v %v", lv, lt, n.Op.Src(), rv, rt)
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func (n *BinaryExpressionNode) clone() Expression {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (n *UnaryExprNode) checkExpr(c *ctx) Expression {
|
||||
if n == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
if n.typeCache.Type() != Invalid {
|
||||
return n
|
||||
}
|
||||
|
||||
n.UnaryExpr = n.UnaryExpr.checkExpr(c)
|
||||
v := n.UnaryExpr.Value()
|
||||
t := n.UnaryExpr.Type()
|
||||
switch n.Op.Ch() {
|
||||
default:
|
||||
trc("", v, t)
|
||||
panic(todo("%v: %T %s", n.Op.Position(), n, n.Source(false)))
|
||||
}
|
||||
}
|
||||
|
||||
func (n *UnaryExprNode) clone() Expression {
|
||||
panic(todo("%v: %T %s", n.Position(), n, n.Source(false)))
|
||||
}
|
||||
|
||||
func (c *ctx) convertValue(n Node, v constant.Value, to Type) (r constant.Value) {
|
||||
if !known(v) {
|
||||
return unknown
|
||||
}
|
||||
|
||||
switch to.Kind() {
|
||||
case
|
||||
Complex128,
|
||||
Complex64,
|
||||
Function,
|
||||
Interface,
|
||||
Map,
|
||||
Pointer,
|
||||
Slice,
|
||||
String,
|
||||
Struct,
|
||||
Tuple,
|
||||
UnsafePointer,
|
||||
UntypedBool,
|
||||
UntypedComplex,
|
||||
UntypedFloat,
|
||||
UntypedInt,
|
||||
UntypedNil,
|
||||
UntypedRune,
|
||||
UntypedString:
|
||||
|
||||
c.err(n, "TODO %v -> %v", v, to)
|
||||
case Int:
|
||||
w := constant.ToInt(v)
|
||||
if !known(w) {
|
||||
c.err(n, "cannot convert %s to %s", v, to)
|
||||
return unknown
|
||||
}
|
||||
|
||||
i64, ok := constant.Int64Val(w)
|
||||
if !ok {
|
||||
c.err(n, "value %s overflows %s", v, to)
|
||||
return unknown
|
||||
}
|
||||
|
||||
switch c.cfg.goarch {
|
||||
case "386", "arm":
|
||||
if i64 < math.MinInt32 || i64 > math.MaxInt32 {
|
||||
c.err(n, "value %s overflows %s", v, to)
|
||||
return unknown
|
||||
}
|
||||
}
|
||||
return w
|
||||
case Int8:
|
||||
w := constant.ToInt(v)
|
||||
if !known(w) {
|
||||
c.err(n, "cannot convert %s to %s", v, to)
|
||||
return unknown
|
||||
}
|
||||
|
||||
i64, ok := constant.Int64Val(w)
|
||||
if !ok {
|
||||
c.err(n, "value %s overflows %s", v, to)
|
||||
return unknown
|
||||
}
|
||||
|
||||
if i64 < math.MinInt8 || i64 > math.MaxInt8 {
|
||||
c.err(n, "value %s overflows %s", v, to)
|
||||
return unknown
|
||||
}
|
||||
|
||||
return w
|
||||
case Int16:
|
||||
w := constant.ToInt(v)
|
||||
if !known(w) {
|
||||
c.err(n, "cannot convert %s to %s", v, to)
|
||||
return unknown
|
||||
}
|
||||
|
||||
i64, ok := constant.Int64Val(w)
|
||||
if !ok {
|
||||
c.err(n, "value %s overflows %s", v, to)
|
||||
return unknown
|
||||
}
|
||||
|
||||
if i64 < math.MinInt16 || i64 > math.MaxInt16 {
|
||||
c.err(n, "value %s overflows %s", v, to)
|
||||
return unknown
|
||||
}
|
||||
|
||||
return w
|
||||
case Int32:
|
||||
w := constant.ToInt(v)
|
||||
if !known(w) {
|
||||
c.err(n, "cannot convert %s to %s", v, to)
|
||||
return unknown
|
||||
}
|
||||
|
||||
i64, ok := constant.Int64Val(w)
|
||||
if !ok {
|
||||
c.err(n, "value %s overflows %s", v, to)
|
||||
return unknown
|
||||
}
|
||||
|
||||
if i64 < math.MinInt32 || i64 > math.MaxInt32 {
|
||||
c.err(n, "value %s overflows %s", v, to)
|
||||
return unknown
|
||||
}
|
||||
|
||||
return w
|
||||
case Int64:
|
||||
w := constant.ToInt(v)
|
||||
if !known(w) {
|
||||
c.err(n, "cannot convert %s to %s", v, to)
|
||||
return unknown
|
||||
}
|
||||
|
||||
if _, ok := constant.Int64Val(w); !ok {
|
||||
c.err(n, "value %s overflows %s", v, to)
|
||||
return unknown
|
||||
}
|
||||
|
||||
return w
|
||||
case Uint, Uintptr:
|
||||
w := constant.ToInt(v)
|
||||
if !known(w) {
|
||||
c.err(n, "cannot convert %s to %s", v, to)
|
||||
return unknown
|
||||
}
|
||||
|
||||
u64, ok := constant.Uint64Val(w)
|
||||
if !ok {
|
||||
c.err(n, "value %s overflows %s", v, to)
|
||||
return unknown
|
||||
}
|
||||
|
||||
switch c.cfg.goarch {
|
||||
case "386", "arm":
|
||||
if u64 > math.MaxUint32 {
|
||||
c.err(n, "value %s overflows %s", v, to)
|
||||
return unknown
|
||||
}
|
||||
}
|
||||
return w
|
||||
case Uint8:
|
||||
w := constant.ToInt(v)
|
||||
if !known(w) {
|
||||
c.err(n, "cannot convert %s to %s", v, to)
|
||||
return unknown
|
||||
}
|
||||
|
||||
u64, ok := constant.Uint64Val(w)
|
||||
if !ok {
|
||||
c.err(n, "value %s overflows %s", v, to)
|
||||
return unknown
|
||||
}
|
||||
|
||||
if u64 > math.MaxUint8 {
|
||||
c.err(n, "value %s overflows %s", v, to)
|
||||
return unknown
|
||||
}
|
||||
|
||||
return w
|
||||
case Uint16:
|
||||
w := constant.ToInt(v)
|
||||
if !known(w) {
|
||||
c.err(n, "cannot convert %s to %s", v, to)
|
||||
return unknown
|
||||
}
|
||||
|
||||
u64, ok := constant.Uint64Val(w)
|
||||
if !ok {
|
||||
c.err(n, "value %s overflows %s", v, to)
|
||||
return unknown
|
||||
}
|
||||
|
||||
if u64 > math.MaxUint16 {
|
||||
c.err(n, "value %s overflows %s", v, to)
|
||||
return unknown
|
||||
}
|
||||
|
||||
return w
|
||||
case Uint32:
|
||||
w := constant.ToInt(v)
|
||||
if !known(w) {
|
||||
c.err(n, "cannot convert %s to %s", v, to)
|
||||
return unknown
|
||||
}
|
||||
|
||||
u64, ok := constant.Uint64Val(w)
|
||||
if !ok {
|
||||
c.err(n, "value %s overflows %s", v, to)
|
||||
return unknown
|
||||
}
|
||||
|
||||
if u64 > math.MaxUint32 {
|
||||
c.err(n, "value %s overflows %s", v, to)
|
||||
return unknown
|
||||
}
|
||||
|
||||
return w
|
||||
case Uint64:
|
||||
w := constant.ToInt(v)
|
||||
if !known(w) {
|
||||
c.err(n, "cannot convert %s to %s", v, to)
|
||||
return unknown
|
||||
}
|
||||
|
||||
if _, ok := constant.Uint64Val(w); !ok {
|
||||
c.err(n, "value %s overflows %s", v, to)
|
||||
return unknown
|
||||
}
|
||||
|
||||
return w
|
||||
case Float32, Float64:
|
||||
return constant.ToFloat(v)
|
||||
case Bool:
|
||||
if v.Kind() == constant.Bool {
|
||||
return v
|
||||
}
|
||||
}
|
||||
return unknown
|
||||
}
|
4
vendor/modernc.org/libc/.gitignore
generated
vendored
Normal file
4
vendor/modernc.org/libc/.gitignore
generated
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
*.gz
|
||||
*.zip
|
||||
go.work
|
||||
go.sum
|
18
vendor/modernc.org/libc/AUTHORS
generated
vendored
Normal file
18
vendor/modernc.org/libc/AUTHORS
generated
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
# This file lists authors for copyright purposes. This file is distinct from
|
||||
# the CONTRIBUTORS files. See the latter for an explanation.
|
||||
#
|
||||
# Names should be added to this file as:
|
||||
# Name or Organization <email address>
|
||||
#
|
||||
# The email address is not required for organizations.
|
||||
#
|
||||
# Please keep the list sorted.
|
||||
|
||||
Dan Kortschak <dan@kortschak.io>
|
||||
Dan Peterson <danp@danp.net>
|
||||
Jan Mercl <0xjnml@gmail.com>
|
||||
Jason DeBettencourt <jasond17@gmail.com>
|
||||
Koichi Shiraishi <zchee.io@gmail.com>
|
||||
Marius Orcsik <marius@federated.id>
|
||||
Scot C Bontrager <scot@indievisible.org>
|
||||
Steffen Butzer <steffen(dot)butzer@outlook.com>
|
18
vendor/modernc.org/libc/CONTRIBUTORS
generated
vendored
Normal file
18
vendor/modernc.org/libc/CONTRIBUTORS
generated
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
# This file lists people who contributed code to this repository. The AUTHORS
|
||||
# file lists the copyright holders; this file lists people.
|
||||
#
|
||||
# Names should be added to this file like so:
|
||||
# Name <email address>
|
||||
#
|
||||
# Please keep the list sorted.
|
||||
|
||||
Dan Kortschak <dan@kortschak.io>
|
||||
Dan Peterson <danp@danp.net>
|
||||
Jaap Aarts <jaap.aarts1@gmail.com>
|
||||
Jan Mercl <0xjnml@gmail.com>
|
||||
Jason DeBettencourt <jasond17@gmail.com>
|
||||
Koichi Shiraishi <zchee.io@gmail.com>
|
||||
Marius Orcsik <marius@federated.id>
|
||||
Scot C Bontrager <scot@indievisible.org>
|
||||
Steffen Butzer <steffen(dot)butzer@outlook.com>
|
||||
ZHU Zijia <piggynl@outlook.com>
|
193
vendor/modernc.org/libc/COPYRIGHT-MUSL
generated
vendored
Normal file
193
vendor/modernc.org/libc/COPYRIGHT-MUSL
generated
vendored
Normal file
|
@ -0,0 +1,193 @@
|
|||
musl as a whole is licensed under the following standard MIT license:
|
||||
|
||||
----------------------------------------------------------------------
|
||||
Copyright © 2005-2020 Rich Felker, et al.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Authors/contributors include:
|
||||
|
||||
A. Wilcox
|
||||
Ada Worcester
|
||||
Alex Dowad
|
||||
Alex Suykov
|
||||
Alexander Monakov
|
||||
Andre McCurdy
|
||||
Andrew Kelley
|
||||
Anthony G. Basile
|
||||
Aric Belsito
|
||||
Arvid Picciani
|
||||
Bartosz Brachaczek
|
||||
Benjamin Peterson
|
||||
Bobby Bingham
|
||||
Boris Brezillon
|
||||
Brent Cook
|
||||
Chris Spiegel
|
||||
Clément Vasseur
|
||||
Daniel Micay
|
||||
Daniel Sabogal
|
||||
Daurnimator
|
||||
David Carlier
|
||||
David Edelsohn
|
||||
Denys Vlasenko
|
||||
Dmitry Ivanov
|
||||
Dmitry V. Levin
|
||||
Drew DeVault
|
||||
Emil Renner Berthing
|
||||
Fangrui Song
|
||||
Felix Fietkau
|
||||
Felix Janda
|
||||
Gianluca Anzolin
|
||||
Hauke Mehrtens
|
||||
He X
|
||||
Hiltjo Posthuma
|
||||
Isaac Dunham
|
||||
Jaydeep Patil
|
||||
Jens Gustedt
|
||||
Jeremy Huntwork
|
||||
Jo-Philipp Wich
|
||||
Joakim Sindholt
|
||||
John Spencer
|
||||
Julien Ramseier
|
||||
Justin Cormack
|
||||
Kaarle Ritvanen
|
||||
Khem Raj
|
||||
Kylie McClain
|
||||
Leah Neukirchen
|
||||
Luca Barbato
|
||||
Luka Perkov
|
||||
M Farkas-Dyck (Strake)
|
||||
Mahesh Bodapati
|
||||
Markus Wichmann
|
||||
Masanori Ogino
|
||||
Michael Clark
|
||||
Michael Forney
|
||||
Mikhail Kremnyov
|
||||
Natanael Copa
|
||||
Nicholas J. Kain
|
||||
orc
|
||||
Pascal Cuoq
|
||||
Patrick Oppenlander
|
||||
Petr Hosek
|
||||
Petr Skocik
|
||||
Pierre Carrier
|
||||
Reini Urban
|
||||
Rich Felker
|
||||
Richard Pennington
|
||||
Ryan Fairfax
|
||||
Samuel Holland
|
||||
Segev Finer
|
||||
Shiz
|
||||
sin
|
||||
Solar Designer
|
||||
Stefan Kristiansson
|
||||
Stefan O'Rear
|
||||
Szabolcs Nagy
|
||||
Timo Teräs
|
||||
Trutz Behn
|
||||
Valentin Ochs
|
||||
Will Dietz
|
||||
William Haddon
|
||||
William Pitcock
|
||||
|
||||
Portions of this software are derived from third-party works licensed
|
||||
under terms compatible with the above MIT license:
|
||||
|
||||
The TRE regular expression implementation (src/regex/reg* and
|
||||
src/regex/tre*) is Copyright © 2001-2008 Ville Laurikari and licensed
|
||||
under a 2-clause BSD license (license text in the source files). The
|
||||
included version has been heavily modified by Rich Felker in 2012, in
|
||||
the interests of size, simplicity, and namespace cleanliness.
|
||||
|
||||
Much of the math library code (src/math/* and src/complex/*) is
|
||||
Copyright © 1993,2004 Sun Microsystems or
|
||||
Copyright © 2003-2011 David Schultz or
|
||||
Copyright © 2003-2009 Steven G. Kargl or
|
||||
Copyright © 2003-2009 Bruce D. Evans or
|
||||
Copyright © 2008 Stephen L. Moshier or
|
||||
Copyright © 2017-2018 Arm Limited
|
||||
and labelled as such in comments in the individual source files. All
|
||||
have been licensed under extremely permissive terms.
|
||||
|
||||
The ARM memcpy code (src/string/arm/memcpy.S) is Copyright © 2008
|
||||
The Android Open Source Project and is licensed under a two-clause BSD
|
||||
license. It was taken from Bionic libc, used on Android.
|
||||
|
||||
The AArch64 memcpy and memset code (src/string/aarch64/*) are
|
||||
Copyright © 1999-2019, Arm Limited.
|
||||
|
||||
The implementation of DES for crypt (src/crypt/crypt_des.c) is
|
||||
Copyright © 1994 David Burren. It is licensed under a BSD license.
|
||||
|
||||
The implementation of blowfish crypt (src/crypt/crypt_blowfish.c) was
|
||||
originally written by Solar Designer and placed into the public
|
||||
domain. The code also comes with a fallback permissive license for use
|
||||
in jurisdictions that may not recognize the public domain.
|
||||
|
||||
The smoothsort implementation (src/stdlib/qsort.c) is Copyright © 2011
|
||||
Valentin Ochs and is licensed under an MIT-style license.
|
||||
|
||||
The x86_64 port was written by Nicholas J. Kain and is licensed under
|
||||
the standard MIT terms.
|
||||
|
||||
The mips and microblaze ports were originally written by Richard
|
||||
Pennington for use in the ellcc project. The original code was adapted
|
||||
by Rich Felker for build system and code conventions during upstream
|
||||
integration. It is licensed under the standard MIT terms.
|
||||
|
||||
The mips64 port was contributed by Imagination Technologies and is
|
||||
licensed under the standard MIT terms.
|
||||
|
||||
The powerpc port was also originally written by Richard Pennington,
|
||||
and later supplemented and integrated by John Spencer. It is licensed
|
||||
under the standard MIT terms.
|
||||
|
||||
All other files which have no copyright comments are original works
|
||||
produced specifically for use as part of this library, written either
|
||||
by Rich Felker, the main author of the library, or by one or more
|
||||
contibutors listed above. Details on authorship of individual files
|
||||
can be found in the git version control history of the project. The
|
||||
omission of copyright and license comments in each file is in the
|
||||
interest of source tree size.
|
||||
|
||||
In addition, permission is hereby granted for all public header files
|
||||
(include/* and arch/*/bits/*) and crt files intended to be linked into
|
||||
applications (crt/*, ldso/dlstart.c, and arch/*/crt_arch.h) to omit
|
||||
the copyright notice and permission notice otherwise required by the
|
||||
license, and to use these files without any requirement of
|
||||
attribution. These files include substantial contributions from:
|
||||
|
||||
Bobby Bingham
|
||||
John Spencer
|
||||
Nicholas J. Kain
|
||||
Rich Felker
|
||||
Richard Pennington
|
||||
Stefan Kristiansson
|
||||
Szabolcs Nagy
|
||||
|
||||
all of whom have explicitly granted such permission.
|
||||
|
||||
This file previously contained text expressing a belief that most of
|
||||
the files covered by the above exception were sufficiently trivial not
|
||||
to be subject to copyright, resulting in confusion over whether it
|
||||
negated the permissions granted in the license. In the spirit of
|
||||
permissive licensing, and of not having licensing issues being an
|
||||
obstacle to adoption, that text has been removed.
|
27
vendor/modernc.org/libc/LICENSE
generated
vendored
Normal file
27
vendor/modernc.org/libc/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,27 @@
|
|||
Copyright (c) 2017 The Libc Authors. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the names of the authors nor the names of the
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
27
vendor/modernc.org/libc/LICENSE-GO
generated
vendored
Normal file
27
vendor/modernc.org/libc/LICENSE-GO
generated
vendored
Normal file
|
@ -0,0 +1,27 @@
|
|||
Copyright (c) 2009 The Go Authors. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of Google Inc. nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
125
vendor/modernc.org/libc/Makefile
generated
vendored
Normal file
125
vendor/modernc.org/libc/Makefile
generated
vendored
Normal file
|
@ -0,0 +1,125 @@
|
|||
# Copyright 2024 The Libc Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style
|
||||
# license that can be found in the LICENSE file.
|
||||
|
||||
.PHONY: all build_all_targets check clean download edit editor generate dev membrk-test test work xtest short-test xlibc libc-test surface
|
||||
|
||||
SHELL=/bin/bash -o pipefail
|
||||
|
||||
DIR = /tmp/libc
|
||||
TAR = musl-7ada6dde6f9dc6a2836c3d92c2f762d35fd229e0.tar.gz
|
||||
URL = https://git.musl-libc.org/cgit/musl/snapshot/$(TAR)
|
||||
|
||||
all: editor
|
||||
golint 2>&1
|
||||
staticcheck 2>&1
|
||||
|
||||
build_all_targets:
|
||||
./build_all_targets.sh
|
||||
echo done
|
||||
|
||||
clean:
|
||||
rm -f log-* cpu.test mem.test *.out
|
||||
git clean -fd
|
||||
find testdata/nsz.repo.hu/ -name \*.go -delete
|
||||
make -C testdata/nsz.repo.hu/libc-test/ cleanall
|
||||
go clean
|
||||
|
||||
check:
|
||||
staticcheck 2>&1 | grep -v U1000
|
||||
|
||||
download:
|
||||
@if [ ! -f $(TAR) ]; then wget $(URL) ; fi
|
||||
|
||||
edit:
|
||||
@touch log
|
||||
@if [ -f "Session.vim" ]; then novim -S & else novim -p Makefile all_musl_test.go generator.go libc.go libc_musl.go & fi
|
||||
|
||||
editor:
|
||||
gofmt -l -s -w *.go 2>&1 | tee log-editor
|
||||
go test -c -o /dev/null 2>&1 | tee -a log-editor
|
||||
go install -v 2>&1 | tee -a log-editor
|
||||
go build -o /dev/null generator*.go
|
||||
|
||||
generate: download
|
||||
mkdir -p $(DIR) || true
|
||||
rm -rf $(DIR)/*
|
||||
GO_GENERATE_DIR=$(DIR) go run generator*.go 2>&1 | tee log-generate
|
||||
go build -v
|
||||
# go install github.com/mdempsky/unconvert@latest
|
||||
go build -v 2>&1 | tee -a log-generate
|
||||
go test -v -short -count=1 ./... | tee -a log-generate
|
||||
git status | tee -a log-generate
|
||||
grep 'TRC\|TODO\|ERRORF\|FAIL' log-generate || true
|
||||
|
||||
dev: download
|
||||
mkdir -p $(DIR) || true
|
||||
rm -rf $(DIR)/*
|
||||
echo -n > /tmp/ccgo.log
|
||||
GO_GENERATE_DIR=$(DIR) GO_GENERATE_DEV=1 go run -tags=ccgo.dmesg,ccgo.assert generator*.go 2>&1 | tee log-generate
|
||||
go build -v | tee -a log-generate
|
||||
go test -v -short -count=1 ./... | tee -a log-generate
|
||||
git status | tee -a log-generate
|
||||
grep 'TRC\|TODO\|ERRORF\|FAIL' log-generate || true
|
||||
grep 'TRC\|TODO\|ERRORF\|FAIL' /tmp/ccgo.log || true
|
||||
|
||||
membrk-test:
|
||||
echo -n > /tmp/ccgo.log
|
||||
touch log-test
|
||||
cp log-test log-test0
|
||||
go test -v -timeout 24h -count=1 -tags=libc.membrk 2>&1 | tee log-test
|
||||
grep -a 'TRC\|TODO\|ERRORF\|FAIL' log-test || true 2>&1 | tee -a log-test
|
||||
|
||||
test:
|
||||
echo -n > /tmp/ccgo.log
|
||||
touch log-test
|
||||
cp log-test log-test0
|
||||
go test -v -timeout 24h -count=1 2>&1 | tee log-test
|
||||
|
||||
short-test:
|
||||
echo -n > /tmp/ccgo.log
|
||||
touch log-test
|
||||
cp log-test log-test0
|
||||
go test -v -timeout 24h -count=1 -short 2>&1 | tee log-test
|
||||
grep -a 'TRC\|TODO\|ERRORF\|FAIL' log-test || true 2>&1 | tee -a log-test
|
||||
|
||||
xlibc:
|
||||
echo -n > /tmp/ccgo.log
|
||||
touch log-test
|
||||
cp log-test log-test0
|
||||
go test -v -timeout 24h -count=1 -tags=ccgo.dmesg,ccgo.assert 2>&1 -run TestLibc | tee log-test
|
||||
grep -a 'TRC\|TODO\|ERRORF\|FAIL' log-test || true 2>&1 | tee -a log-test
|
||||
|
||||
xpthread:
|
||||
echo -n > /tmp/ccgo.log
|
||||
touch log-test
|
||||
cp log-test log-test0
|
||||
go test -v -timeout 24h -count=1 2>&1 -run TestLibc -re pthread | tee log-test
|
||||
grep -a 'TRC\|TODO\|ERRORF\|FAIL' log-test || true 2>&1 | tee -a log-test
|
||||
|
||||
libc-test:
|
||||
echo -n > /tmp/ccgo.log
|
||||
touch log-test
|
||||
cp log-test log-test0
|
||||
go test -v -timeout 24h -count=1 2>&1 -run TestLibc | tee log-test
|
||||
# grep -a 'TRC\|TODO\|ERRORF\|FAIL' log-test || true 2>&1 | tee -a log-test
|
||||
grep -o 'undefined: \<.*\>' log-test | sort -u
|
||||
|
||||
xtest:
|
||||
echo -n > /tmp/ccgo.log
|
||||
touch log-test
|
||||
cp log-test log-test0
|
||||
go test -v -timeout 24h -count=1 -tags=ccgo.dmesg,ccgo.assert 2>&1 | tee log-test
|
||||
grep -a 'TRC\|TODO\|ERRORF\|FAIL' log-test || true 2>&1 | tee -a log-test
|
||||
|
||||
work:
|
||||
rm -f go.work*
|
||||
go work init
|
||||
go work use .
|
||||
go work use ../ccgo/v4
|
||||
go work use ../ccgo/v3
|
||||
go work use ../cc/v4
|
||||
|
||||
surface:
|
||||
surface > surface.new
|
||||
surface surface.old surface.new > log-todo-surface || true
|
20
vendor/modernc.org/libc/README.md
generated
vendored
Normal file
20
vendor/modernc.org/libc/README.md
generated
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
# libc
|
||||
|
||||
Package libc provides C-runtime services. Work in progress.
|
||||
|
||||
This package is a continuation of the Crt package in modernc.org/crt/v3.
|
||||
|
||||
Installation
|
||||
|
||||
$ go get [-u] modernc.org/libc
|
||||
|
||||
Documentation: [godoc.org/modernc.org/libc](http://godoc.org/modernc.org/libc)
|
||||
|
||||
Building with `make` requires the following Go packages
|
||||
|
||||
* github.com/golang/lint/golint
|
||||
* github.com/mdempsky/maligned
|
||||
* github.com/mdempsky/unconvert
|
||||
* honnef.co/go/tools/cmd/unused
|
||||
* honnef.co/go/tools/cmd/gosimple
|
||||
* github.com/client9/misspell/cmd/misspell
|
109
vendor/modernc.org/libc/aliases.go
generated
vendored
Normal file
109
vendor/modernc.org/libc/aliases.go
generated
vendored
Normal file
|
@ -0,0 +1,109 @@
|
|||
// Copyright 2024 The Libc Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build linux && (amd64 || loong64)
|
||||
|
||||
package libc // import "modernc.org/libc"
|
||||
|
||||
func X__vm_wait(tls *TLS) {}
|
||||
|
||||
// static volatile int *const dummy_lockptr = 0;
|
||||
//
|
||||
// weak_alias(dummy_lockptr, __atexit_lockptr);
|
||||
// weak_alias(dummy_lockptr, __bump_lockptr);
|
||||
// weak_alias(dummy_lockptr, __sem_open_lockptr);
|
||||
var X__atexit_lockptr int32
|
||||
var X__bump_lockptr int32
|
||||
var X__sem_open_lockptr int32
|
||||
|
||||
// static int dummy(int fd)
|
||||
//
|
||||
// {
|
||||
// return fd;
|
||||
// }
|
||||
//
|
||||
// weak_alias(dummy, __aio_close);
|
||||
func X__aio_close(tls *TLS, fd int32) int32 {
|
||||
return fd
|
||||
}
|
||||
|
||||
func Xtzset(tls *TLS) {
|
||||
___tzset(tls)
|
||||
}
|
||||
|
||||
type DIR = TDIR
|
||||
|
||||
const DT_DETACHED = _DT_DETACHED
|
||||
|
||||
const DT_EXITING = _DT_EXITING
|
||||
|
||||
const DT_JOINABLE = _DT_JOINABLE
|
||||
|
||||
type FILE = TFILE
|
||||
|
||||
type HEADER = THEADER
|
||||
|
||||
func Xfcntl64(tls *TLS, fd int32, cmd int32, va uintptr) (r int32) {
|
||||
return Xfcntl(tls, fd, cmd, va)
|
||||
}
|
||||
|
||||
func Xfopen64(tls *TLS, filename uintptr, mode uintptr) (r uintptr) {
|
||||
return Xfopen(tls, filename, mode)
|
||||
}
|
||||
|
||||
func Xfstat64(tls *TLS, fd int32, st uintptr) (r int32) {
|
||||
return Xfstat(tls, fd, st)
|
||||
}
|
||||
|
||||
func Xftruncate64(tls *TLS, fd int32, length Toff_t) (r int32) {
|
||||
return Xftruncate(tls, fd, length)
|
||||
}
|
||||
|
||||
func Xgetrlimit64(tls *TLS, resource int32, rlim uintptr) (r int32) {
|
||||
return Xgetrlimit(tls, resource, rlim)
|
||||
}
|
||||
|
||||
func Xlseek64(tls *TLS, fd int32, offset Toff_t, whence int32) (r Toff_t) {
|
||||
return Xlseek(tls, fd, offset, whence)
|
||||
}
|
||||
|
||||
func Xlstat64(tls *TLS, path uintptr, buf uintptr) (r int32) {
|
||||
return Xlstat(tls, path, buf)
|
||||
}
|
||||
|
||||
func Xmkstemp64(tls *TLS, template uintptr) (r int32) {
|
||||
return Xmkstemp(tls, template)
|
||||
}
|
||||
|
||||
func Xmkstemps64(tls *TLS, template uintptr, len1 int32) (r int32) {
|
||||
return Xmkstemps(tls, template, len1)
|
||||
}
|
||||
|
||||
func Xmmap64(tls *TLS, start uintptr, len1 Tsize_t, prot int32, flags int32, fd int32, off Toff_t) (r uintptr) {
|
||||
return Xmmap(tls, start, len1, prot, flags, fd, off)
|
||||
}
|
||||
|
||||
func Xopen64(tls *TLS, filename uintptr, flags int32, va uintptr) (r int32) {
|
||||
return Xopen(tls, filename, flags, va)
|
||||
}
|
||||
|
||||
func Xreaddir64(tls *TLS, dir uintptr) (r uintptr) {
|
||||
return Xreaddir(tls, dir)
|
||||
}
|
||||
|
||||
func Xsetrlimit64(tls *TLS, resource int32, rlim uintptr) (r int32) {
|
||||
return Xsetrlimit(tls, resource, rlim)
|
||||
}
|
||||
|
||||
func Xstat64(tls *TLS, path uintptr, buf uintptr) (r int32) {
|
||||
return Xstat(tls, path, buf)
|
||||
}
|
||||
|
||||
func Xpthread_setcancelstate(tls *TLS, new int32, old uintptr) int32 {
|
||||
return _pthread_setcancelstate(tls, new, old)
|
||||
}
|
||||
|
||||
func Xpthread_sigmask(tls *TLS, now int32, set, old uintptr) int32 {
|
||||
return _pthread_sigmask(tls, now, set, old)
|
||||
}
|
114
vendor/modernc.org/libc/atomic.go
generated
vendored
Normal file
114
vendor/modernc.org/libc/atomic.go
generated
vendored
Normal file
|
@ -0,0 +1,114 @@
|
|||
// Copyright 2024 The Libc Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build linux && (amd64 || loong64)
|
||||
|
||||
package libc // import "modernc.org/libc/v2"
|
||||
|
||||
import (
|
||||
"math"
|
||||
"math/bits"
|
||||
"sync/atomic"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
func a_store_8(addr uintptr, val int8) int8 {
|
||||
*(*int8)(unsafe.Pointer(addr)) = val
|
||||
return val
|
||||
}
|
||||
|
||||
func a_load_8(addr uintptr) (val int8) {
|
||||
return *(*int8)(unsafe.Pointer(addr))
|
||||
}
|
||||
|
||||
func a_load_16(addr uintptr) (val int16) {
|
||||
if addr&1 != 0 {
|
||||
panic("unaligned atomic access")
|
||||
}
|
||||
|
||||
return *(*int16)(unsafe.Pointer(addr))
|
||||
}
|
||||
|
||||
func a_store_16(addr uintptr, val uint16) {
|
||||
if addr&1 != 0 {
|
||||
panic("unaligned atomic access")
|
||||
}
|
||||
|
||||
*(*uint16)(unsafe.Pointer(addr)) = val
|
||||
}
|
||||
|
||||
// static inline int a_ctz_l(unsigned long x)
|
||||
func _a_ctz_l(tls *TLS, x ulong) int32 {
|
||||
if unsafe.Sizeof(x) == 8 {
|
||||
return int32(bits.TrailingZeros64(x))
|
||||
}
|
||||
|
||||
return int32(bits.TrailingZeros32(uint32(x)))
|
||||
}
|
||||
|
||||
// static inline int a_ctz_64(uint64_t x)
|
||||
func _a_ctz_64(tls *TLS, x uint64) int32 {
|
||||
return int32(bits.TrailingZeros64(x))
|
||||
}
|
||||
|
||||
func AtomicAddFloat32(addr *float32, delta float32) (new float32) {
|
||||
v := AtomicLoadFloat32(addr) + delta
|
||||
AtomicStoreFloat32(addr, v)
|
||||
return v
|
||||
}
|
||||
|
||||
func AtomicLoadFloat32(addr *float32) (val float32) {
|
||||
return math.Float32frombits(atomic.LoadUint32((*uint32)(unsafe.Pointer(addr))))
|
||||
}
|
||||
|
||||
func AtomicStoreFloat32(addr *float32, val float32) {
|
||||
atomic.StoreUint32((*uint32)(unsafe.Pointer(addr)), math.Float32bits(val))
|
||||
}
|
||||
|
||||
func AtomicAddFloat64(addr *float64, delta float64) (new float64) {
|
||||
v := AtomicLoadFloat64(addr) + delta
|
||||
AtomicStoreFloat64(addr, v)
|
||||
return v
|
||||
}
|
||||
|
||||
func AtomicLoadFloat64(addr *float64) (val float64) {
|
||||
return math.Float64frombits(atomic.LoadUint64((*uint64)(unsafe.Pointer(addr))))
|
||||
}
|
||||
|
||||
func AtomicStoreFloat64(addr *float64, val float64) {
|
||||
atomic.StoreUint64((*uint64)(unsafe.Pointer(addr)), math.Float64bits(val))
|
||||
}
|
||||
|
||||
func AtomicAddInt32(addr *int32, delta int32) (new int32) { return atomic.AddInt32(addr, delta) }
|
||||
|
||||
func AtomicAddInt64(addr *int64, delta int64) (new int64) { return atomic.AddInt64(addr, delta) }
|
||||
|
||||
func AtomicAddUint32(addr *uint32, delta uint32) (new uint32) { return atomic.AddUint32(addr, delta) }
|
||||
|
||||
func AtomicAddUint64(addr *uint64, delta uint64) (new uint64) { return atomic.AddUint64(addr, delta) }
|
||||
|
||||
func AtomicAddUintptr(addr *uintptr, delta uintptr) (new uintptr) {
|
||||
return atomic.AddUintptr(addr, delta)
|
||||
|
||||
}
|
||||
|
||||
func AtomicLoadInt32(addr *int32) (val int32) { return atomic.LoadInt32(addr) }
|
||||
|
||||
func AtomicLoadInt64(addr *int64) (val int64) { return atomic.LoadInt64(addr) }
|
||||
|
||||
func AtomicLoadUint32(addr *uint32) (val uint32) { return atomic.LoadUint32(addr) }
|
||||
|
||||
func AtomicLoadUint64(addr *uint64) (val uint64) { return atomic.LoadUint64(addr) }
|
||||
|
||||
func AtomicLoadUintptr(addr *uintptr) (val uintptr) { return atomic.LoadUintptr(addr) }
|
||||
|
||||
func AtomicStoreInt32(addr *int32, val int32) { atomic.StoreInt32(addr, val) }
|
||||
|
||||
func AtomicStoreUint32(addr *uint32, val uint32) { atomic.StoreUint32(addr, val) }
|
||||
|
||||
func AtomicStoreUint64(addr *uint64, val uint64) { atomic.StoreUint64(addr, val) }
|
||||
|
||||
func AtomicStoreUintptr(addr *uintptr, val uintptr) { atomic.StoreUintptr(addr, val) }
|
||||
|
||||
func AtomicStoreInt64(addr *int64, val int64) { atomic.StoreInt64(addr, val) }
|
71
vendor/modernc.org/libc/build_all_targets.sh
generated
vendored
Normal file
71
vendor/modernc.org/libc/build_all_targets.sh
generated
vendored
Normal file
|
@ -0,0 +1,71 @@
|
|||
set -e
|
||||
for tag in none libc.dmesg libc.membrk libc.memgrind libc.strace
|
||||
do
|
||||
echo "-tags=$tag"
|
||||
echo "GOOS=darwin GOARCH=amd64"
|
||||
GOOS=darwin GOARCH=amd64 go build -tags=$tag -v ./...
|
||||
GOOS=darwin GOARCH=amd64 go test -tags=$tag -c -o /dev/null
|
||||
echo "GOOS=darwin GOARCH=arm64"
|
||||
GOOS=darwin GOARCH=arm64 go build -tags=$tag -v ./...
|
||||
GOOS=darwin GOARCH=arm64 go test -tags=$tag -c -o /dev/null
|
||||
echo "GOOS=freebsd GOARCH=386"
|
||||
GOOS=freebsd GOARCH=386 go build -tags=$tag -v ./...
|
||||
GOOS=freebsd GOARCH=386 go test -tags=$tag -c -o /dev/null
|
||||
echo "GOOS=freebsd GOARCH=amd64"
|
||||
GOOS=freebsd GOARCH=amd64 go build -tags=$tag -v ./...
|
||||
GOOS=freebsd GOARCH=amd64 go test -tags=$tag -c -o /dev/null
|
||||
echo "GOOS=freebsd GOARCH=arm"
|
||||
GOOS=freebsd GOARCH=arm go build -tags=$tag -v ./...
|
||||
GOOS=freebsd GOARCH=arm go test -tags=$tag -c -o /dev/null
|
||||
echo "GOOS=linux GOARCH=386"
|
||||
GOOS=linux GOARCH=386 go build -tags=$tag -v ./...
|
||||
GOOS=linux GOARCH=386 go test -tags=$tag -c -o /dev/null
|
||||
echo "GOOS=linux GOARCH=amd64"
|
||||
GOOS=linux GOARCH=amd64 go build -tags=$tag -v ./...
|
||||
GOOS=linux GOARCH=amd64 go test -tags=$tag -c -o /dev/null
|
||||
echo "GOOS=linux GOARCH=arm"
|
||||
GOOS=linux GOARCH=arm go build -tags=$tag -v ./...
|
||||
GOOS=linux GOARCH=arm go test -tags=$tag -c -o /dev/null
|
||||
echo "GOOS=linux GOARCH=arm64"
|
||||
GOOS=linux GOARCH=arm64 go build -tags=$tag -v ./...
|
||||
GOOS=linux GOARCH=arm64 go test -tags=$tag -c -o /dev/null
|
||||
echo "GOOS=linux GOARCH=loong64"
|
||||
GOOS=linux GOARCH=loong64 go build -tags=$tag -v ./...
|
||||
GOOS=linux GOARCH=loong64 go test -tags=$tag -c -o /dev/null
|
||||
echo "GOOS=linux GOARCH=mips64le"
|
||||
GOOS=linux GOARCH=mips64le go build -tags=$tag -v ./...
|
||||
GOOS=linux GOARCH=mips64le go test -tags=$tag -c -o /dev/null
|
||||
echo "GOOS=linux GOARCH=ppc64le"
|
||||
GOOS=linux GOARCH=ppc64le go build -tags=$tag -v ./...
|
||||
GOOS=linux GOARCH=ppc64le go test -tags=$tag -c -o /dev/null
|
||||
echo "GOOS=linux GOARCH=riscv64"
|
||||
GOOS=linux GOARCH=riscv64 go build -tags=$tag -v ./...
|
||||
GOOS=linux GOARCH=riscv64 go test -tags=$tag -c -o /dev/null
|
||||
echo "GOOS=linux GOARCH=s390x"
|
||||
GOOS=linux GOARCH=s390x go build -tags=$tag -v ./...
|
||||
GOOS=linux GOARCH=s390x go test -tags=$tag -c -o /dev/null
|
||||
echo "GOOS=netbsd GOARCH=amd64"
|
||||
GOOS=netbsd GOARCH=amd64 go build -tags=$tag -v ./...
|
||||
GOOS=netbsd GOARCH=amd64 go test -tags=$tag -c -o /dev/null
|
||||
echo "GOOS=netbsd GOARCH=arm"
|
||||
GOOS=netbsd GOARCH=arm go build -tags=$tag -v ./...
|
||||
GOOS=netbsd GOARCH=arm go test -tags=$tag -c -o /dev/null
|
||||
echo "GOOS=openbsd GOARCH=386"
|
||||
GOOS=openbsd GOARCH=386 go build -tags=$tag -v ./...
|
||||
GOOS=openbsd GOARCH=386 go test -tags=$tag -c -o /dev/null
|
||||
echo "GOOS=openbsd GOARCH=amd64"
|
||||
GOOS=openbsd GOARCH=amd64 go build -tags=$tag -v ./...
|
||||
GOOS=openbsd GOARCH=amd64 go test -tags=$tag -c -o /dev/null
|
||||
echo "GOOS=openbsd GOARCH=arm64"
|
||||
GOOS=openbsd GOARCH=arm64 go build -tags=$tag -v ./...
|
||||
GOOS=openbsd GOARCH=arm64 go test -tags=$tag -c -o /dev/null
|
||||
echo "GOOS=windows GOARCH=386"
|
||||
GOOS=windows GOARCH=386 go build -tags=$tag -v ./...
|
||||
GOOS=windows GOARCH=386 go test -tags=$tag -c -o /dev/null
|
||||
echo "GOOS=windows GOARCH=amd64"
|
||||
GOOS=windows GOARCH=amd64 go build -tags=$tag -v ./...
|
||||
GOOS=windows GOARCH=amd64 go test -tags=$tag -c -o /dev/null
|
||||
echo "GOOS=windows GOARCH=arm64"
|
||||
GOOS=windows GOARCH=arm64 go build -tags=$tag -v ./...
|
||||
GOOS=windows GOARCH=arm64 go test -tags=$tag -c -o /dev/null
|
||||
done
|
9
vendor/modernc.org/libc/builder.json
generated
vendored
Normal file
9
vendor/modernc.org/libc/builder.json
generated
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"autogen": "linux/(amd64|loong64)",
|
||||
"autoupdate": "",
|
||||
"autotag": "darwin/(amd64|arm64)|freebsd/(amd64|arm64)|linux/(386|amd64|arm|arm64|loong64|ppc64le|riscv64|s390x)|openbsd/(386|amd64|arm64)|windows/(amd64|arm64)",
|
||||
"download": [
|
||||
{"re": "linux/(amd64|loong64)", "files": ["https://git.musl-libc.org/cgit/musl/snapshot/musl-7ada6dde6f9dc6a2836c3d92c2f762d35fd229e0.tar.gz"]}
|
||||
],
|
||||
"test": "darwin/(amd64|arm64)|freebsd/(amd64|arm64)|linux/(386|amd64|arm|arm64|loong64|ppc64le|riscv64|s390x)|openbsd/(386|amd64|arm64)|windows/(amd64|arm64)"
|
||||
}
|
439
vendor/modernc.org/libc/builtin.go
generated
vendored
Normal file
439
vendor/modernc.org/libc/builtin.go
generated
vendored
Normal file
|
@ -0,0 +1,439 @@
|
|||
// Copyright 2024 The Libc Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build linux && (amd64 || loong64)
|
||||
|
||||
package libc // import "modernc.org/libc"
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math"
|
||||
mbits "math/bits"
|
||||
"os"
|
||||
"unsafe"
|
||||
|
||||
"modernc.org/mathutil"
|
||||
)
|
||||
|
||||
func X__builtin_inff(tls *TLS) float32 {
|
||||
return float32(math.Inf(1))
|
||||
}
|
||||
|
||||
func X__builtin_nanf(tls *TLS, s uintptr) float32 {
|
||||
return float32(math.NaN())
|
||||
}
|
||||
|
||||
func X__builtin_printf(tls *TLS, fmt uintptr, va uintptr) (r int32) {
|
||||
return Xprintf(tls, fmt, va)
|
||||
}
|
||||
|
||||
func X__builtin_round(tls *TLS, x float64) (r float64) {
|
||||
return Xround(tls, x)
|
||||
}
|
||||
|
||||
func X__builtin_expect(t *TLS, exp, c long) long {
|
||||
return exp
|
||||
}
|
||||
|
||||
func X__builtin_bzero(t *TLS, s uintptr, n Tsize_t) {
|
||||
Xbzero(t, s, n)
|
||||
}
|
||||
|
||||
func X__builtin_abort(t *TLS) {
|
||||
Xabort(t)
|
||||
}
|
||||
|
||||
func X__builtin_abs(t *TLS, j int32) int32 {
|
||||
return Xabs(t, j)
|
||||
}
|
||||
|
||||
func X__builtin_ctz(t *TLS, n uint32) int32 {
|
||||
return int32(mbits.TrailingZeros32(n))
|
||||
}
|
||||
|
||||
func X__builtin_clz(t *TLS, n uint32) int32 {
|
||||
return int32(mbits.LeadingZeros32(n))
|
||||
}
|
||||
|
||||
func X__builtin_clzl(t *TLS, n ulong) int32 {
|
||||
return int32(mbits.LeadingZeros64(n))
|
||||
}
|
||||
|
||||
func X__builtin_clzll(t *TLS, n uint64) int32 {
|
||||
return int32(mbits.LeadingZeros64(n))
|
||||
}
|
||||
func X__builtin_constant_p_impl() { panic(todo("internal error: should never be called")) }
|
||||
|
||||
func X__builtin_copysign(t *TLS, x, y float64) float64 {
|
||||
return Xcopysign(t, x, y)
|
||||
}
|
||||
|
||||
func X__builtin_copysignf(t *TLS, x, y float32) float32 {
|
||||
return Xcopysignf(t, x, y)
|
||||
}
|
||||
|
||||
func X__builtin_copysignl(t *TLS, x, y float64) float64 {
|
||||
return Xcopysign(t, x, y)
|
||||
}
|
||||
|
||||
func X__builtin_exit(t *TLS, status int32) {
|
||||
Xexit(t, status)
|
||||
}
|
||||
|
||||
func X__builtin_fabs(t *TLS, x float64) float64 {
|
||||
return Xfabs(t, x)
|
||||
}
|
||||
|
||||
func X__builtin_fabsf(t *TLS, x float32) float32 {
|
||||
return Xfabsf(t, x)
|
||||
}
|
||||
|
||||
func X__builtin_fabsl(t *TLS, x float64) float64 {
|
||||
return Xfabsl(t, x)
|
||||
}
|
||||
|
||||
func X__builtin_free(t *TLS, ptr uintptr) {
|
||||
Xfree(t, ptr)
|
||||
}
|
||||
|
||||
func X__builtin_getentropy(t *TLS, buf uintptr, n Tsize_t) int32 {
|
||||
return Xgetentropy(t, buf, n)
|
||||
}
|
||||
|
||||
func X__builtin_huge_val(t *TLS) float64 {
|
||||
return math.Inf(1)
|
||||
}
|
||||
|
||||
func X__builtin_huge_valf(t *TLS) float32 {
|
||||
return float32(math.Inf(1))
|
||||
}
|
||||
|
||||
func X__builtin_inf(t *TLS) float64 {
|
||||
return math.Inf(1)
|
||||
}
|
||||
|
||||
func X__builtin_infl(t *TLS) float64 {
|
||||
return math.Inf(1)
|
||||
}
|
||||
|
||||
func X__builtin_malloc(t *TLS, size Tsize_t) uintptr {
|
||||
return Xmalloc(t, size)
|
||||
}
|
||||
|
||||
func X__builtin_memcmp(t *TLS, s1, s2 uintptr, n Tsize_t) int32 {
|
||||
return Xmemcmp(t, s1, s2, n)
|
||||
}
|
||||
|
||||
func X__builtin_nan(t *TLS, s uintptr) float64 {
|
||||
return math.NaN()
|
||||
}
|
||||
|
||||
func X__builtin_nanl(t *TLS, s uintptr) float64 {
|
||||
return math.NaN()
|
||||
}
|
||||
|
||||
func X__builtin_prefetch(t *TLS, addr, args uintptr) {
|
||||
}
|
||||
|
||||
func X__builtin_strchr(t *TLS, s uintptr, c int32) uintptr {
|
||||
return Xstrchr(t, s, c)
|
||||
}
|
||||
|
||||
func X__builtin_strcmp(t *TLS, s1, s2 uintptr) int32 {
|
||||
return Xstrcmp(t, s1, s2)
|
||||
}
|
||||
|
||||
func X__builtin_strcpy(t *TLS, dest, src uintptr) uintptr {
|
||||
return Xstrcpy(t, dest, src)
|
||||
}
|
||||
|
||||
func X__builtin_strlen(t *TLS, s uintptr) Tsize_t {
|
||||
return Xstrlen(t, s)
|
||||
}
|
||||
|
||||
func X__builtin_trap(t *TLS) {
|
||||
Xabort(t)
|
||||
}
|
||||
|
||||
func X__builtin_popcount(t *TLS, x uint32) int32 {
|
||||
return int32(mbits.OnesCount32(x))
|
||||
}
|
||||
|
||||
// int __builtin_popcountl (unsigned long x)
|
||||
func X__builtin_popcountl(t *TLS, x ulong) int32 {
|
||||
return int32(mbits.OnesCount64(x))
|
||||
}
|
||||
|
||||
// char * __builtin___strcpy_chk (char *dest, const char *src, size_t os);
|
||||
func X__builtin___strcpy_chk(t *TLS, dest, src uintptr, os Tsize_t) uintptr {
|
||||
return Xstrcpy(t, dest, src)
|
||||
}
|
||||
|
||||
func X__builtin_mmap(t *TLS, addr uintptr, length Tsize_t, prot, flags, fd int32, offset Toff_t) uintptr {
|
||||
return Xmmap(t, addr, length, prot, flags, fd, offset)
|
||||
}
|
||||
|
||||
// uint16_t __builtin_bswap16 (uint32_t x)
|
||||
func X__builtin_bswap16(t *TLS, x uint16) uint16 {
|
||||
return x<<8 |
|
||||
x>>8
|
||||
}
|
||||
|
||||
// uint32_t __builtin_bswap32 (uint32_t x)
|
||||
func X__builtin_bswap32(t *TLS, x uint32) uint32 {
|
||||
return x<<24 |
|
||||
x&0xff00<<8 |
|
||||
x&0xff0000>>8 |
|
||||
x>>24
|
||||
}
|
||||
|
||||
// uint64_t __builtin_bswap64 (uint64_t x)
|
||||
func X__builtin_bswap64(t *TLS, x uint64) uint64 {
|
||||
return x<<56 |
|
||||
x&0xff00<<40 |
|
||||
x&0xff0000<<24 |
|
||||
x&0xff000000<<8 |
|
||||
x&0xff00000000>>8 |
|
||||
x&0xff0000000000>>24 |
|
||||
x&0xff000000000000>>40 |
|
||||
x>>56
|
||||
}
|
||||
|
||||
// bool __builtin_add_overflow (type1 a, type2 b, type3 *res)
|
||||
func X__builtin_add_overflowInt64(t *TLS, a, b int64, res uintptr) int32 {
|
||||
r, ovf := mathutil.AddOverflowInt64(a, b)
|
||||
*(*int64)(unsafe.Pointer(res)) = r
|
||||
return Bool32(ovf)
|
||||
}
|
||||
|
||||
// bool __builtin_add_overflow (type1 a, type2 b, type3 *res)
|
||||
func X__builtin_add_overflowUint32(t *TLS, a, b uint32, res uintptr) int32 {
|
||||
r := a + b
|
||||
*(*uint32)(unsafe.Pointer(res)) = r
|
||||
return Bool32(r < a)
|
||||
}
|
||||
|
||||
// bool __builtin_add_overflow (type1 a, type2 b, type3 *res)
|
||||
func X__builtin_add_overflowUint64(t *TLS, a, b uint64, res uintptr) int32 {
|
||||
r := a + b
|
||||
*(*uint64)(unsafe.Pointer(res)) = r
|
||||
return Bool32(r < a)
|
||||
}
|
||||
|
||||
// bool __builtin_sub_overflow (type1 a, type2 b, type3 *res)
|
||||
func X__builtin_sub_overflowInt64(t *TLS, a, b int64, res uintptr) int32 {
|
||||
r, ovf := mathutil.SubOverflowInt64(a, b)
|
||||
*(*int64)(unsafe.Pointer(res)) = r
|
||||
return Bool32(ovf)
|
||||
}
|
||||
|
||||
// bool __builtin_mul_overflow (type1 a, type2 b, type3 *res)
|
||||
func X__builtin_mul_overflowInt64(t *TLS, a, b int64, res uintptr) int32 {
|
||||
r, ovf := mathutil.MulOverflowInt64(a, b)
|
||||
*(*int64)(unsafe.Pointer(res)) = r
|
||||
return Bool32(ovf)
|
||||
}
|
||||
|
||||
// bool __builtin_mul_overflow (type1 a, type2 b, type3 *res)
|
||||
func X__builtin_mul_overflowUint64(t *TLS, a, b uint64, res uintptr) int32 {
|
||||
hi, lo := mbits.Mul64(a, b)
|
||||
*(*uint64)(unsafe.Pointer(res)) = lo
|
||||
return Bool32(hi != 0)
|
||||
}
|
||||
|
||||
// bool __builtin_mul_overflow (type1 a, type2 b, type3 *res)
|
||||
func X__builtin_mul_overflowUint128(t *TLS, a, b Uint128, res uintptr) int32 {
|
||||
r, ovf := a.mulOvf(b)
|
||||
*(*Uint128)(unsafe.Pointer(res)) = r
|
||||
return Bool32(ovf)
|
||||
}
|
||||
|
||||
func X__builtin_unreachable(t *TLS) {
|
||||
fmt.Fprintf(os.Stderr, "unrechable\n")
|
||||
os.Stderr.Sync()
|
||||
Xexit(t, 1)
|
||||
}
|
||||
|
||||
func X__builtin_snprintf(t *TLS, str uintptr, size Tsize_t, format, args uintptr) int32 {
|
||||
return Xsnprintf(t, str, size, format, args)
|
||||
}
|
||||
|
||||
func X__builtin_sprintf(t *TLS, str, format, args uintptr) (r int32) {
|
||||
return Xsprintf(t, str, format, args)
|
||||
}
|
||||
|
||||
func X__builtin_memcpy(t *TLS, dest, src uintptr, n Tsize_t) (r uintptr) {
|
||||
return Xmemcpy(t, dest, src, n)
|
||||
}
|
||||
|
||||
// void * __builtin___memcpy_chk (void *dest, const void *src, size_t n, size_t os);
|
||||
func X__builtin___memcpy_chk(t *TLS, dest, src uintptr, n, os Tsize_t) (r uintptr) {
|
||||
if os != ^Tsize_t(0) && n < os {
|
||||
Xabort(t)
|
||||
}
|
||||
|
||||
return Xmemcpy(t, dest, src, n)
|
||||
}
|
||||
|
||||
func X__builtin_memset(t *TLS, s uintptr, c int32, n Tsize_t) uintptr {
|
||||
return Xmemset(t, s, c, n)
|
||||
}
|
||||
|
||||
// void * __builtin___memset_chk (void *s, int c, size_t n, size_t os);
|
||||
func X__builtin___memset_chk(t *TLS, s uintptr, c int32, n, os Tsize_t) uintptr {
|
||||
if os < n {
|
||||
Xabort(t)
|
||||
}
|
||||
|
||||
return Xmemset(t, s, c, n)
|
||||
}
|
||||
|
||||
// size_t __builtin_object_size (const void * ptr, int type)
|
||||
func X__builtin_object_size(t *TLS, p uintptr, typ int32) Tsize_t {
|
||||
return ^Tsize_t(0) //TODO frontend magic
|
||||
}
|
||||
|
||||
// int __builtin___sprintf_chk (char *s, int flag, size_t os, const char *fmt, ...);
|
||||
func X__builtin___sprintf_chk(t *TLS, s uintptr, flag int32, os Tsize_t, format, args uintptr) (r int32) {
|
||||
return Xsprintf(t, s, format, args)
|
||||
}
|
||||
|
||||
func X__builtin_vsnprintf(t *TLS, str uintptr, size Tsize_t, format, va uintptr) int32 {
|
||||
return Xvsnprintf(t, str, size, format, va)
|
||||
}
|
||||
|
||||
// int __builtin___snprintf_chk(char * str, size_t maxlen, int flag, size_t os, const char * format, ...);
|
||||
func X__builtin___snprintf_chk(t *TLS, str uintptr, maxlen Tsize_t, flag int32, os Tsize_t, format, args uintptr) (r int32) {
|
||||
if os != ^Tsize_t(0) && maxlen > os {
|
||||
Xabort(t)
|
||||
}
|
||||
|
||||
return Xsnprintf(t, str, maxlen, format, args)
|
||||
}
|
||||
|
||||
// int __builtin___vsnprintf_chk (char *s, size_t maxlen, int flag, size_t os, const char *fmt, va_list ap);
|
||||
func X__builtin___vsnprintf_chk(t *TLS, str uintptr, maxlen Tsize_t, flag int32, os Tsize_t, format, args uintptr) (r int32) {
|
||||
if os != ^Tsize_t(0) && maxlen > os {
|
||||
Xabort(t)
|
||||
}
|
||||
|
||||
return Xsnprintf(t, str, maxlen, format, args)
|
||||
}
|
||||
|
||||
func Xisnan(t *TLS, x float64) int32 {
|
||||
return X__builtin_isnan(t, x)
|
||||
}
|
||||
|
||||
func X__isnan(t *TLS, x float64) int32 {
|
||||
return X__builtin_isnan(t, x)
|
||||
}
|
||||
|
||||
func X__builtin_isnan(t *TLS, x float64) int32 {
|
||||
return Bool32(math.IsNaN(x))
|
||||
}
|
||||
|
||||
func Xisnanf(t *TLS, arg float32) int32 {
|
||||
return X__builtin_isnanf(t, arg)
|
||||
}
|
||||
|
||||
func X__isnanf(t *TLS, arg float32) int32 {
|
||||
return X__builtin_isnanf(t, arg)
|
||||
}
|
||||
|
||||
func X__builtin_isnanf(t *TLS, x float32) int32 {
|
||||
return Bool32(math.IsNaN(float64(x)))
|
||||
}
|
||||
|
||||
func Xisnanl(t *TLS, arg float64) int32 {
|
||||
return X__builtin_isnanl(t, arg)
|
||||
}
|
||||
|
||||
func X__isnanl(t *TLS, arg float64) int32 {
|
||||
return X__builtin_isnanl(t, arg)
|
||||
}
|
||||
|
||||
func X__builtin_isnanl(t *TLS, x float64) int32 {
|
||||
return Bool32(math.IsNaN(x))
|
||||
}
|
||||
|
||||
func X__builtin_llabs(tls *TLS, a int64) int64 {
|
||||
return Xllabs(tls, a)
|
||||
}
|
||||
|
||||
func X__builtin_log2(t *TLS, x float64) float64 {
|
||||
return Xlog2(t, x)
|
||||
}
|
||||
|
||||
func X__builtin___strncpy_chk(t *TLS, dest, src uintptr, n, os Tsize_t) (r uintptr) {
|
||||
if n != ^Tsize_t(0) && os < n {
|
||||
Xabort(t)
|
||||
}
|
||||
|
||||
return Xstrncpy(t, dest, src, n)
|
||||
}
|
||||
|
||||
func X__builtin___strcat_chk(t *TLS, dest, src uintptr, os Tsize_t) (r uintptr) {
|
||||
return Xstrcat(t, dest, src)
|
||||
}
|
||||
|
||||
func X__builtin___memmove_chk(t *TLS, dest, src uintptr, n, os Tsize_t) uintptr {
|
||||
if os != ^Tsize_t(0) && os < n {
|
||||
Xabort(t)
|
||||
}
|
||||
|
||||
return Xmemmove(t, dest, src, n)
|
||||
}
|
||||
|
||||
func X__builtin_isunordered(t *TLS, a, b float64) int32 {
|
||||
return Bool32(math.IsNaN(a) || math.IsNaN(b))
|
||||
}
|
||||
|
||||
func X__builtin_ffs(tls *TLS, i int32) (r int32) {
|
||||
return Xffs(tls, i)
|
||||
}
|
||||
|
||||
func X__builtin_rintf(tls *TLS, x float32) (r float32) {
|
||||
return Xrintf(tls, x)
|
||||
}
|
||||
|
||||
func X__builtin_lrintf(tls *TLS, x float32) (r long) {
|
||||
return Xlrintf(tls, x)
|
||||
}
|
||||
|
||||
func X__builtin_lrint(tls *TLS, x float64) (r long) {
|
||||
return Xlrint(tls, x)
|
||||
}
|
||||
|
||||
// double __builtin_fma(double x, double y, double z);
|
||||
func X__builtin_fma(tls *TLS, x, y, z float64) (r float64) {
|
||||
return math.FMA(x, y, z)
|
||||
}
|
||||
|
||||
func X__builtin_alloca(tls *TLS, size Tsize_t) uintptr {
|
||||
return Xalloca(tls, size)
|
||||
}
|
||||
|
||||
func X__builtin_isprint(tls *TLS, c int32) (r int32) {
|
||||
return Xisprint(tls, c)
|
||||
}
|
||||
|
||||
func X__builtin_isblank(tls *TLS, c int32) (r int32) {
|
||||
return Xisblank(tls, c)
|
||||
}
|
||||
|
||||
func X__builtin_trunc(tls *TLS, x float64) (r float64) {
|
||||
return Xtrunc(tls, x)
|
||||
}
|
||||
|
||||
func X__builtin_hypot(tls *TLS, x float64, y float64) (r float64) {
|
||||
return Xhypot(tls, x, y)
|
||||
}
|
||||
|
||||
func X__builtin_fmax(tls *TLS, x float64, y float64) (r float64) {
|
||||
return Xfmax(tls, x, y)
|
||||
}
|
||||
|
||||
func X__builtin_fmin(tls *TLS, x float64, y float64) (r float64) {
|
||||
return Xfmin(tls, x, y)
|
||||
}
|
540
vendor/modernc.org/libc/capi_darwin_amd64.go
generated
vendored
Normal file
540
vendor/modernc.org/libc/capi_darwin_amd64.go
generated
vendored
Normal file
|
@ -0,0 +1,540 @@
|
|||
// Code generated by 'go generate' - DO NOT EDIT.
|
||||
|
||||
package libc // import "modernc.org/libc"
|
||||
|
||||
var CAPI = map[string]struct{}{
|
||||
"_CurrentRuneLocale": {},
|
||||
"_DefaultRuneLocale": {},
|
||||
"_IO_putc": {},
|
||||
"_NSGetEnviron": {},
|
||||
"___errno_location": {},
|
||||
"__assert_fail": {},
|
||||
"__assert_rtn": {},
|
||||
"__builtin___memcpy_chk": {},
|
||||
"__builtin___memmove_chk": {},
|
||||
"__builtin___memset_chk": {},
|
||||
"__builtin___snprintf_chk": {},
|
||||
"__builtin___sprintf_chk": {},
|
||||
"__builtin___strcat_chk": {},
|
||||
"__builtin___strcpy_chk": {},
|
||||
"__builtin___strncpy_chk": {},
|
||||
"__builtin___vsnprintf_chk": {},
|
||||
"__builtin_abort": {},
|
||||
"__builtin_abs": {},
|
||||
"__builtin_add_overflowInt64": {},
|
||||
"__builtin_add_overflowUint32": {},
|
||||
"__builtin_add_overflowUint64": {},
|
||||
"__builtin_bswap16": {},
|
||||
"__builtin_bswap32": {},
|
||||
"__builtin_bswap64": {},
|
||||
"__builtin_bzero": {},
|
||||
"__builtin_clz": {},
|
||||
"__builtin_clzl": {},
|
||||
"__builtin_clzll": {},
|
||||
"__builtin_constant_p_impl": {},
|
||||
"__builtin_copysign": {},
|
||||
"__builtin_copysignf": {},
|
||||
"__builtin_copysignl": {},
|
||||
"__builtin_exit": {},
|
||||
"__builtin_expect": {},
|
||||
"__builtin_fabs": {},
|
||||
"__builtin_fabsf": {},
|
||||
"__builtin_fabsl": {},
|
||||
"__builtin_free": {},
|
||||
"__builtin_getentropy": {},
|
||||
"__builtin_huge_val": {},
|
||||
"__builtin_huge_valf": {},
|
||||
"__builtin_inf": {},
|
||||
"__builtin_inff": {},
|
||||
"__builtin_infl": {},
|
||||
"__builtin_isnan": {},
|
||||
"__builtin_isunordered": {},
|
||||
"__builtin_llabs": {},
|
||||
"__builtin_malloc": {},
|
||||
"__builtin_memcmp": {},
|
||||
"__builtin_memcpy": {},
|
||||
"__builtin_memset": {},
|
||||
"__builtin_mmap": {},
|
||||
"__builtin_mul_overflowInt64": {},
|
||||
"__builtin_mul_overflowUint128": {},
|
||||
"__builtin_mul_overflowUint64": {},
|
||||
"__builtin_nan": {},
|
||||
"__builtin_nanf": {},
|
||||
"__builtin_nanl": {},
|
||||
"__builtin_object_size": {},
|
||||
"__builtin_popcount": {},
|
||||
"__builtin_popcountl": {},
|
||||
"__builtin_prefetch": {},
|
||||
"__builtin_printf": {},
|
||||
"__builtin_snprintf": {},
|
||||
"__builtin_sprintf": {},
|
||||
"__builtin_strchr": {},
|
||||
"__builtin_strcmp": {},
|
||||
"__builtin_strcpy": {},
|
||||
"__builtin_strlen": {},
|
||||
"__builtin_sub_overflowInt64": {},
|
||||
"__builtin_trap": {},
|
||||
"__builtin_unreachable": {},
|
||||
"__ccgo_dmesg": {},
|
||||
"__ccgo_getMutexType": {},
|
||||
"__ccgo_in6addr_anyp": {},
|
||||
"__ccgo_pthreadAttrGetDetachState": {},
|
||||
"__ccgo_pthreadMutexattrGettype": {},
|
||||
"__ccgo_sqlite3_log": {},
|
||||
"__cmsg_nxthdr": {},
|
||||
"__ctype_get_mb_cur_max": {},
|
||||
"__darwin_check_fd_set_overflow": {},
|
||||
"__darwin_fd_clr": {},
|
||||
"__darwin_fd_isset": {},
|
||||
"__darwin_fd_set": {},
|
||||
"__env_rm_add": {},
|
||||
"__errno_location": {},
|
||||
"__error": {},
|
||||
"__floatscan": {},
|
||||
"__fpclassify": {},
|
||||
"__fpclassifyf": {},
|
||||
"__fpclassifyl": {},
|
||||
"__h_errno_location": {},
|
||||
"__inet_aton": {},
|
||||
"__inline_isnand": {},
|
||||
"__inline_isnanf": {},
|
||||
"__inline_isnanl": {},
|
||||
"__intscan": {},
|
||||
"__isctype": {},
|
||||
"__isnan": {},
|
||||
"__isnanf": {},
|
||||
"__isnanl": {},
|
||||
"__isoc99_sscanf": {},
|
||||
"__istype": {},
|
||||
"__lookup_ipliteral": {},
|
||||
"__lookup_name": {},
|
||||
"__lookup_serv": {},
|
||||
"__maskrune": {},
|
||||
"__mb_cur_max": {},
|
||||
"__putenv": {},
|
||||
"__shgetc": {},
|
||||
"__shlim": {},
|
||||
"__sincos_stret": {},
|
||||
"__sincosf_stret": {},
|
||||
"__sincospi_stret": {},
|
||||
"__sincospif_stret": {},
|
||||
"__srget": {},
|
||||
"__stderrp": {},
|
||||
"__stdinp": {},
|
||||
"__stdoutp": {},
|
||||
"__strchrnul": {},
|
||||
"__strncasecmp_l": {},
|
||||
"__svfscanf": {},
|
||||
"__swbuf": {},
|
||||
"__sync_add_and_fetch_uint32": {},
|
||||
"__sync_sub_and_fetch_uint32": {},
|
||||
"__tolower": {},
|
||||
"__toread": {},
|
||||
"__toread_needs_stdio_exit": {},
|
||||
"__toupper": {},
|
||||
"__uflow": {},
|
||||
"__wcwidth": {},
|
||||
"_exit": {},
|
||||
"_longjmp": {},
|
||||
"_obstack_begin": {},
|
||||
"_obstack_newchunk": {},
|
||||
"_setjmp": {},
|
||||
"abort": {},
|
||||
"abs": {},
|
||||
"accept": {},
|
||||
"access": {},
|
||||
"acos": {},
|
||||
"acosh": {},
|
||||
"alarm": {},
|
||||
"arc4random_buf": {},
|
||||
"asin": {},
|
||||
"asinh": {},
|
||||
"atan": {},
|
||||
"atan2": {},
|
||||
"atanh": {},
|
||||
"atexit": {},
|
||||
"atof": {},
|
||||
"atoi": {},
|
||||
"atol": {},
|
||||
"bind": {},
|
||||
"bsearch": {},
|
||||
"bzero": {},
|
||||
"calloc": {},
|
||||
"ceil": {},
|
||||
"ceilf": {},
|
||||
"cfgetospeed": {},
|
||||
"cfsetispeed": {},
|
||||
"cfsetospeed": {},
|
||||
"chdir": {},
|
||||
"chflags": {},
|
||||
"chmod": {},
|
||||
"chown": {},
|
||||
"clock": {},
|
||||
"clock_gettime": {},
|
||||
"close": {},
|
||||
"closedir": {},
|
||||
"confstr": {},
|
||||
"connect": {},
|
||||
"copyfile": {},
|
||||
"copysign": {},
|
||||
"copysignf": {},
|
||||
"copysignl": {},
|
||||
"cos": {},
|
||||
"cosf": {},
|
||||
"cosh": {},
|
||||
"ctime": {},
|
||||
"ctime_r": {},
|
||||
"digittoint": {},
|
||||
"dlclose": {},
|
||||
"dlerror": {},
|
||||
"dlopen": {},
|
||||
"dlsym": {},
|
||||
"dup2": {},
|
||||
"endpwent": {},
|
||||
"environ": {},
|
||||
"exit": {},
|
||||
"exp": {},
|
||||
"fabs": {},
|
||||
"fabsf": {},
|
||||
"fabsl": {},
|
||||
"fchmod": {},
|
||||
"fchown": {},
|
||||
"fclose": {},
|
||||
"fcntl": {},
|
||||
"fcntl64": {},
|
||||
"fdopen": {},
|
||||
"ferror": {},
|
||||
"fflush": {},
|
||||
"fgetc": {},
|
||||
"fgets": {},
|
||||
"fileno": {},
|
||||
"flock": {},
|
||||
"floor": {},
|
||||
"fmod": {},
|
||||
"fmodl": {},
|
||||
"fopen": {},
|
||||
"fopen64": {},
|
||||
"fork": {},
|
||||
"fprintf": {},
|
||||
"fputc": {},
|
||||
"fputs": {},
|
||||
"fread": {},
|
||||
"free": {},
|
||||
"freeaddrinfo": {},
|
||||
"frexp": {},
|
||||
"fsctl": {},
|
||||
"fseek": {},
|
||||
"fstat": {},
|
||||
"fstat64": {},
|
||||
"fstatfs": {},
|
||||
"fsync": {},
|
||||
"ftell": {},
|
||||
"ftruncate": {},
|
||||
"fts_close": {},
|
||||
"fts_open": {},
|
||||
"fts_read": {},
|
||||
"futimes": {},
|
||||
"fwrite": {},
|
||||
"gai_strerror": {},
|
||||
"getaddrinfo": {},
|
||||
"getattrlist": {},
|
||||
"getc": {},
|
||||
"getcwd": {},
|
||||
"getegid": {},
|
||||
"getentropy": {},
|
||||
"getenv": {},
|
||||
"geteuid": {},
|
||||
"getgid": {},
|
||||
"getgrgid": {},
|
||||
"getgrgid_r": {},
|
||||
"getgrnam": {},
|
||||
"getgrnam_r": {},
|
||||
"gethostbyaddr": {},
|
||||
"gethostbyaddr_r": {},
|
||||
"gethostbyname": {},
|
||||
"gethostbyname2": {},
|
||||
"gethostbyname2_r": {},
|
||||
"gethostname": {},
|
||||
"gethostuuid": {},
|
||||
"getnameinfo": {},
|
||||
"getpeername": {},
|
||||
"getpid": {},
|
||||
"getprogname": {},
|
||||
"getpwnam": {},
|
||||
"getpwnam_r": {},
|
||||
"getpwuid": {},
|
||||
"getpwuid_r": {},
|
||||
"getresgid": {},
|
||||
"getresuid": {},
|
||||
"getrusage": {},
|
||||
"getservbyname": {},
|
||||
"getsockname": {},
|
||||
"getsockopt": {},
|
||||
"gettimeofday": {},
|
||||
"getuid": {},
|
||||
"gmtime_r": {},
|
||||
"h_errno": {},
|
||||
"htonl": {},
|
||||
"htons": {},
|
||||
"hypot": {},
|
||||
"inet_ntoa": {},
|
||||
"inet_ntop": {},
|
||||
"inet_pton": {},
|
||||
"initstate": {},
|
||||
"initstate_r": {},
|
||||
"ioctl": {},
|
||||
"isalnum": {},
|
||||
"isalpha": {},
|
||||
"isascii": {},
|
||||
"isatty": {},
|
||||
"isblank": {},
|
||||
"iscntrl": {},
|
||||
"isdigit": {},
|
||||
"isgraph": {},
|
||||
"ishexnumber": {},
|
||||
"isideogram": {},
|
||||
"islower": {},
|
||||
"isnan": {},
|
||||
"isnanf": {},
|
||||
"isnanl": {},
|
||||
"isnumber": {},
|
||||
"isphonogram": {},
|
||||
"isprint": {},
|
||||
"ispunct": {},
|
||||
"isrune": {},
|
||||
"issetugid": {},
|
||||
"isspace": {},
|
||||
"isspecial": {},
|
||||
"isupper": {},
|
||||
"iswalnum": {},
|
||||
"iswspace": {},
|
||||
"isxdigit": {},
|
||||
"kill": {},
|
||||
"ldexp": {},
|
||||
"link": {},
|
||||
"listen": {},
|
||||
"llabs": {},
|
||||
"localeconv": {},
|
||||
"localtime": {},
|
||||
"localtime_r": {},
|
||||
"log": {},
|
||||
"log10": {},
|
||||
"log2": {},
|
||||
"longjmp": {},
|
||||
"lrand48": {},
|
||||
"lseek": {},
|
||||
"lseek64": {},
|
||||
"lstat": {},
|
||||
"lstat64": {},
|
||||
"mach_absolute_time": {},
|
||||
"mach_timebase_info": {},
|
||||
"malloc": {},
|
||||
"mblen": {},
|
||||
"mbstowcs": {},
|
||||
"mbtowc": {},
|
||||
"memchr": {},
|
||||
"memcmp": {},
|
||||
"memcpy": {},
|
||||
"memmove": {},
|
||||
"memset": {},
|
||||
"mkdir": {},
|
||||
"mkfifo": {},
|
||||
"mknod": {},
|
||||
"mkostemp": {},
|
||||
"mkstemp": {},
|
||||
"mkstemp64": {},
|
||||
"mkstemps": {},
|
||||
"mkstemps64": {},
|
||||
"mktime": {},
|
||||
"mmap": {},
|
||||
"modf": {},
|
||||
"munmap": {},
|
||||
"nanf": {},
|
||||
"nl_langinfo": {},
|
||||
"ntohs": {},
|
||||
"obstack_free": {},
|
||||
"obstack_vprintf": {},
|
||||
"open": {},
|
||||
"opendir": {},
|
||||
"openpty": {},
|
||||
"pathconf": {},
|
||||
"pause": {},
|
||||
"pclose": {},
|
||||
"perror": {},
|
||||
"pipe": {},
|
||||
"poll": {},
|
||||
"popen": {},
|
||||
"posix_fadvise": {},
|
||||
"pow": {},
|
||||
"pread": {},
|
||||
"printf": {},
|
||||
"pselect": {},
|
||||
"pthread_attr_destroy": {},
|
||||
"pthread_attr_getdetachstate": {},
|
||||
"pthread_attr_init": {},
|
||||
"pthread_attr_setdetachstate": {},
|
||||
"pthread_attr_setscope": {},
|
||||
"pthread_attr_setstacksize": {},
|
||||
"pthread_cond_broadcast": {},
|
||||
"pthread_cond_destroy": {},
|
||||
"pthread_cond_init": {},
|
||||
"pthread_cond_signal": {},
|
||||
"pthread_cond_timedwait": {},
|
||||
"pthread_cond_wait": {},
|
||||
"pthread_create": {},
|
||||
"pthread_detach": {},
|
||||
"pthread_equal": {},
|
||||
"pthread_exit": {},
|
||||
"pthread_getspecific": {},
|
||||
"pthread_join": {},
|
||||
"pthread_key_create": {},
|
||||
"pthread_key_delete": {},
|
||||
"pthread_mutex_destroy": {},
|
||||
"pthread_mutex_init": {},
|
||||
"pthread_mutex_lock": {},
|
||||
"pthread_mutex_trylock": {},
|
||||
"pthread_mutex_unlock": {},
|
||||
"pthread_mutexattr_destroy": {},
|
||||
"pthread_mutexattr_init": {},
|
||||
"pthread_mutexattr_settype": {},
|
||||
"pthread_self": {},
|
||||
"pthread_setspecific": {},
|
||||
"putc": {},
|
||||
"putchar": {},
|
||||
"putenv": {},
|
||||
"puts": {},
|
||||
"pwrite": {},
|
||||
"qsort": {},
|
||||
"raise": {},
|
||||
"rand": {},
|
||||
"rand_r": {},
|
||||
"random": {},
|
||||
"random_r": {},
|
||||
"read": {},
|
||||
"readdir": {},
|
||||
"readlink": {},
|
||||
"readv": {},
|
||||
"realloc": {},
|
||||
"reallocarray": {},
|
||||
"realpath": {},
|
||||
"recv": {},
|
||||
"recvfrom": {},
|
||||
"recvmsg": {},
|
||||
"remove": {},
|
||||
"rename": {},
|
||||
"rewind": {},
|
||||
"rindex": {},
|
||||
"rint": {},
|
||||
"rmdir": {},
|
||||
"round": {},
|
||||
"scalbn": {},
|
||||
"scalbnl": {},
|
||||
"sched_yield": {},
|
||||
"select": {},
|
||||
"send": {},
|
||||
"sendmsg": {},
|
||||
"sendto": {},
|
||||
"setattrlist": {},
|
||||
"setbuf": {},
|
||||
"setenv": {},
|
||||
"setjmp": {},
|
||||
"setlocale": {},
|
||||
"setsid": {},
|
||||
"setsockopt": {},
|
||||
"setstate": {},
|
||||
"setvbuf": {},
|
||||
"shmat": {},
|
||||
"shmctl": {},
|
||||
"shmdt": {},
|
||||
"shutdown": {},
|
||||
"sigaction": {},
|
||||
"signal": {},
|
||||
"sin": {},
|
||||
"sinf": {},
|
||||
"sinh": {},
|
||||
"sleep": {},
|
||||
"snprintf": {},
|
||||
"socket": {},
|
||||
"sprintf": {},
|
||||
"sqrt": {},
|
||||
"srand48": {},
|
||||
"srandomdev": {},
|
||||
"sscanf": {},
|
||||
"stat": {},
|
||||
"stat64": {},
|
||||
"statfs": {},
|
||||
"stderr": {},
|
||||
"stdin": {},
|
||||
"stdout": {},
|
||||
"strcasecmp": {},
|
||||
"strcat": {},
|
||||
"strchr": {},
|
||||
"strcmp": {},
|
||||
"strcpy": {},
|
||||
"strcspn": {},
|
||||
"strdup": {},
|
||||
"strerror": {},
|
||||
"strerror_r": {},
|
||||
"strlcat": {},
|
||||
"strlcpy": {},
|
||||
"strlen": {},
|
||||
"strncasecmp": {},
|
||||
"strncat": {},
|
||||
"strncmp": {},
|
||||
"strncpy": {},
|
||||
"strnlen": {},
|
||||
"strpbrk": {},
|
||||
"strrchr": {},
|
||||
"strspn": {},
|
||||
"strstr": {},
|
||||
"strtod": {},
|
||||
"strtof": {},
|
||||
"strtoimax": {},
|
||||
"strtok": {},
|
||||
"strtol": {},
|
||||
"strtold": {},
|
||||
"strtoll": {},
|
||||
"strtoul": {},
|
||||
"strtoull": {},
|
||||
"strtoumax": {},
|
||||
"symlink": {},
|
||||
"sysconf": {},
|
||||
"system": {},
|
||||
"tan": {},
|
||||
"tanh": {},
|
||||
"tcgetattr": {},
|
||||
"tcsendbreak": {},
|
||||
"tcsetattr": {},
|
||||
"time": {},
|
||||
"tmpfile": {},
|
||||
"toascii": {},
|
||||
"tolower": {},
|
||||
"toupper": {},
|
||||
"trunc": {},
|
||||
"truncate": {},
|
||||
"tzset": {},
|
||||
"umask": {},
|
||||
"uname": {},
|
||||
"ungetc": {},
|
||||
"unlink": {},
|
||||
"unsetenv": {},
|
||||
"usleep": {},
|
||||
"utime": {},
|
||||
"utimes": {},
|
||||
"uuid_copy": {},
|
||||
"uuid_generate_random": {},
|
||||
"uuid_parse": {},
|
||||
"uuid_unparse": {},
|
||||
"vasprintf": {},
|
||||
"vfprintf": {},
|
||||
"vprintf": {},
|
||||
"vsnprintf": {},
|
||||
"vsprintf": {},
|
||||
"waitpid": {},
|
||||
"wcschr": {},
|
||||
"wctomb": {},
|
||||
"wcwidth": {},
|
||||
"write": {},
|
||||
"writev": {},
|
||||
"zero_struct_address": {},
|
||||
}
|
540
vendor/modernc.org/libc/capi_darwin_arm64.go
generated
vendored
Normal file
540
vendor/modernc.org/libc/capi_darwin_arm64.go
generated
vendored
Normal file
|
@ -0,0 +1,540 @@
|
|||
// Code generated by 'go generate' - DO NOT EDIT.
|
||||
|
||||
package libc // import "modernc.org/libc"
|
||||
|
||||
var CAPI = map[string]struct{}{
|
||||
"_CurrentRuneLocale": {},
|
||||
"_DefaultRuneLocale": {},
|
||||
"_IO_putc": {},
|
||||
"_NSGetEnviron": {},
|
||||
"___errno_location": {},
|
||||
"__assert_fail": {},
|
||||
"__assert_rtn": {},
|
||||
"__builtin___memcpy_chk": {},
|
||||
"__builtin___memmove_chk": {},
|
||||
"__builtin___memset_chk": {},
|
||||
"__builtin___snprintf_chk": {},
|
||||
"__builtin___sprintf_chk": {},
|
||||
"__builtin___strcat_chk": {},
|
||||
"__builtin___strcpy_chk": {},
|
||||
"__builtin___strncpy_chk": {},
|
||||
"__builtin___vsnprintf_chk": {},
|
||||
"__builtin_abort": {},
|
||||
"__builtin_abs": {},
|
||||
"__builtin_add_overflowInt64": {},
|
||||
"__builtin_add_overflowUint32": {},
|
||||
"__builtin_add_overflowUint64": {},
|
||||
"__builtin_bswap16": {},
|
||||
"__builtin_bswap32": {},
|
||||
"__builtin_bswap64": {},
|
||||
"__builtin_bzero": {},
|
||||
"__builtin_clz": {},
|
||||
"__builtin_clzl": {},
|
||||
"__builtin_clzll": {},
|
||||
"__builtin_constant_p_impl": {},
|
||||
"__builtin_copysign": {},
|
||||
"__builtin_copysignf": {},
|
||||
"__builtin_copysignl": {},
|
||||
"__builtin_exit": {},
|
||||
"__builtin_expect": {},
|
||||
"__builtin_fabs": {},
|
||||
"__builtin_fabsf": {},
|
||||
"__builtin_fabsl": {},
|
||||
"__builtin_free": {},
|
||||
"__builtin_getentropy": {},
|
||||
"__builtin_huge_val": {},
|
||||
"__builtin_huge_valf": {},
|
||||
"__builtin_inf": {},
|
||||
"__builtin_inff": {},
|
||||
"__builtin_infl": {},
|
||||
"__builtin_isnan": {},
|
||||
"__builtin_isunordered": {},
|
||||
"__builtin_llabs": {},
|
||||
"__builtin_malloc": {},
|
||||
"__builtin_memcmp": {},
|
||||
"__builtin_memcpy": {},
|
||||
"__builtin_memset": {},
|
||||
"__builtin_mmap": {},
|
||||
"__builtin_mul_overflowInt64": {},
|
||||
"__builtin_mul_overflowUint128": {},
|
||||
"__builtin_mul_overflowUint64": {},
|
||||
"__builtin_nan": {},
|
||||
"__builtin_nanf": {},
|
||||
"__builtin_nanl": {},
|
||||
"__builtin_object_size": {},
|
||||
"__builtin_popcount": {},
|
||||
"__builtin_popcountl": {},
|
||||
"__builtin_prefetch": {},
|
||||
"__builtin_printf": {},
|
||||
"__builtin_snprintf": {},
|
||||
"__builtin_sprintf": {},
|
||||
"__builtin_strchr": {},
|
||||
"__builtin_strcmp": {},
|
||||
"__builtin_strcpy": {},
|
||||
"__builtin_strlen": {},
|
||||
"__builtin_sub_overflowInt64": {},
|
||||
"__builtin_trap": {},
|
||||
"__builtin_unreachable": {},
|
||||
"__ccgo_dmesg": {},
|
||||
"__ccgo_getMutexType": {},
|
||||
"__ccgo_in6addr_anyp": {},
|
||||
"__ccgo_pthreadAttrGetDetachState": {},
|
||||
"__ccgo_pthreadMutexattrGettype": {},
|
||||
"__ccgo_sqlite3_log": {},
|
||||
"__cmsg_nxthdr": {},
|
||||
"__ctype_get_mb_cur_max": {},
|
||||
"__darwin_check_fd_set_overflow": {},
|
||||
"__darwin_fd_clr": {},
|
||||
"__darwin_fd_isset": {},
|
||||
"__darwin_fd_set": {},
|
||||
"__env_rm_add": {},
|
||||
"__errno_location": {},
|
||||
"__error": {},
|
||||
"__floatscan": {},
|
||||
"__fpclassify": {},
|
||||
"__fpclassifyf": {},
|
||||
"__fpclassifyl": {},
|
||||
"__h_errno_location": {},
|
||||
"__inet_aton": {},
|
||||
"__inline_isnand": {},
|
||||
"__inline_isnanf": {},
|
||||
"__inline_isnanl": {},
|
||||
"__intscan": {},
|
||||
"__isctype": {},
|
||||
"__isnan": {},
|
||||
"__isnanf": {},
|
||||
"__isnanl": {},
|
||||
"__isoc99_sscanf": {},
|
||||
"__istype": {},
|
||||
"__lookup_ipliteral": {},
|
||||
"__lookup_name": {},
|
||||
"__lookup_serv": {},
|
||||
"__maskrune": {},
|
||||
"__mb_cur_max": {},
|
||||
"__putenv": {},
|
||||
"__shgetc": {},
|
||||
"__shlim": {},
|
||||
"__sincos_stret": {},
|
||||
"__sincosf_stret": {},
|
||||
"__sincospi_stret": {},
|
||||
"__sincospif_stret": {},
|
||||
"__srget": {},
|
||||
"__stderrp": {},
|
||||
"__stdinp": {},
|
||||
"__stdoutp": {},
|
||||
"__strchrnul": {},
|
||||
"__strncasecmp_l": {},
|
||||
"__svfscanf": {},
|
||||
"__swbuf": {},
|
||||
"__sync_add_and_fetch_uint32": {},
|
||||
"__sync_sub_and_fetch_uint32": {},
|
||||
"__tolower": {},
|
||||
"__toread": {},
|
||||
"__toread_needs_stdio_exit": {},
|
||||
"__toupper": {},
|
||||
"__uflow": {},
|
||||
"__wcwidth": {},
|
||||
"_exit": {},
|
||||
"_longjmp": {},
|
||||
"_obstack_begin": {},
|
||||
"_obstack_newchunk": {},
|
||||
"_setjmp": {},
|
||||
"abort": {},
|
||||
"abs": {},
|
||||
"accept": {},
|
||||
"access": {},
|
||||
"acos": {},
|
||||
"acosh": {},
|
||||
"alarm": {},
|
||||
"arc4random_buf": {},
|
||||
"asin": {},
|
||||
"asinh": {},
|
||||
"atan": {},
|
||||
"atan2": {},
|
||||
"atanh": {},
|
||||
"atexit": {},
|
||||
"atof": {},
|
||||
"atoi": {},
|
||||
"atol": {},
|
||||
"bind": {},
|
||||
"bsearch": {},
|
||||
"bzero": {},
|
||||
"calloc": {},
|
||||
"ceil": {},
|
||||
"ceilf": {},
|
||||
"cfgetospeed": {},
|
||||
"cfsetispeed": {},
|
||||
"cfsetospeed": {},
|
||||
"chdir": {},
|
||||
"chflags": {},
|
||||
"chmod": {},
|
||||
"chown": {},
|
||||
"clock": {},
|
||||
"clock_gettime": {},
|
||||
"close": {},
|
||||
"closedir": {},
|
||||
"confstr": {},
|
||||
"connect": {},
|
||||
"copyfile": {},
|
||||
"copysign": {},
|
||||
"copysignf": {},
|
||||
"copysignl": {},
|
||||
"cos": {},
|
||||
"cosf": {},
|
||||
"cosh": {},
|
||||
"ctime": {},
|
||||
"ctime_r": {},
|
||||
"digittoint": {},
|
||||
"dlclose": {},
|
||||
"dlerror": {},
|
||||
"dlopen": {},
|
||||
"dlsym": {},
|
||||
"dup2": {},
|
||||
"endpwent": {},
|
||||
"environ": {},
|
||||
"exit": {},
|
||||
"exp": {},
|
||||
"fabs": {},
|
||||
"fabsf": {},
|
||||
"fabsl": {},
|
||||
"fchmod": {},
|
||||
"fchown": {},
|
||||
"fclose": {},
|
||||
"fcntl": {},
|
||||
"fcntl64": {},
|
||||
"fdopen": {},
|
||||
"ferror": {},
|
||||
"fflush": {},
|
||||
"fgetc": {},
|
||||
"fgets": {},
|
||||
"fileno": {},
|
||||
"flock": {},
|
||||
"floor": {},
|
||||
"fmod": {},
|
||||
"fmodl": {},
|
||||
"fopen": {},
|
||||
"fopen64": {},
|
||||
"fork": {},
|
||||
"fprintf": {},
|
||||
"fputc": {},
|
||||
"fputs": {},
|
||||
"fread": {},
|
||||
"free": {},
|
||||
"freeaddrinfo": {},
|
||||
"frexp": {},
|
||||
"fsctl": {},
|
||||
"fseek": {},
|
||||
"fstat": {},
|
||||
"fstat64": {},
|
||||
"fstatfs": {},
|
||||
"fsync": {},
|
||||
"ftell": {},
|
||||
"ftruncate": {},
|
||||
"fts_close": {},
|
||||
"fts_open": {},
|
||||
"fts_read": {},
|
||||
"futimes": {},
|
||||
"fwrite": {},
|
||||
"gai_strerror": {},
|
||||
"getaddrinfo": {},
|
||||
"getattrlist": {},
|
||||
"getc": {},
|
||||
"getcwd": {},
|
||||
"getegid": {},
|
||||
"getentropy": {},
|
||||
"getenv": {},
|
||||
"geteuid": {},
|
||||
"getgid": {},
|
||||
"getgrgid": {},
|
||||
"getgrgid_r": {},
|
||||
"getgrnam": {},
|
||||
"getgrnam_r": {},
|
||||
"gethostbyaddr": {},
|
||||
"gethostbyaddr_r": {},
|
||||
"gethostbyname": {},
|
||||
"gethostbyname2": {},
|
||||
"gethostbyname2_r": {},
|
||||
"gethostname": {},
|
||||
"gethostuuid": {},
|
||||
"getnameinfo": {},
|
||||
"getpeername": {},
|
||||
"getpid": {},
|
||||
"getprogname": {},
|
||||
"getpwnam": {},
|
||||
"getpwnam_r": {},
|
||||
"getpwuid": {},
|
||||
"getpwuid_r": {},
|
||||
"getresgid": {},
|
||||
"getresuid": {},
|
||||
"getrusage": {},
|
||||
"getservbyname": {},
|
||||
"getsockname": {},
|
||||
"getsockopt": {},
|
||||
"gettimeofday": {},
|
||||
"getuid": {},
|
||||
"gmtime_r": {},
|
||||
"h_errno": {},
|
||||
"htonl": {},
|
||||
"htons": {},
|
||||
"hypot": {},
|
||||
"inet_ntoa": {},
|
||||
"inet_ntop": {},
|
||||
"inet_pton": {},
|
||||
"initstate": {},
|
||||
"initstate_r": {},
|
||||
"ioctl": {},
|
||||
"isalnum": {},
|
||||
"isalpha": {},
|
||||
"isascii": {},
|
||||
"isatty": {},
|
||||
"isblank": {},
|
||||
"iscntrl": {},
|
||||
"isdigit": {},
|
||||
"isgraph": {},
|
||||
"ishexnumber": {},
|
||||
"isideogram": {},
|
||||
"islower": {},
|
||||
"isnan": {},
|
||||
"isnanf": {},
|
||||
"isnanl": {},
|
||||
"isnumber": {},
|
||||
"isphonogram": {},
|
||||
"isprint": {},
|
||||
"ispunct": {},
|
||||
"isrune": {},
|
||||
"issetugid": {},
|
||||
"isspace": {},
|
||||
"isspecial": {},
|
||||
"isupper": {},
|
||||
"iswalnum": {},
|
||||
"iswspace": {},
|
||||
"isxdigit": {},
|
||||
"kill": {},
|
||||
"ldexp": {},
|
||||
"link": {},
|
||||
"listen": {},
|
||||
"llabs": {},
|
||||
"localeconv": {},
|
||||
"localtime": {},
|
||||
"localtime_r": {},
|
||||
"log": {},
|
||||
"log10": {},
|
||||
"log2": {},
|
||||
"longjmp": {},
|
||||
"lrand48": {},
|
||||
"lseek": {},
|
||||
"lseek64": {},
|
||||
"lstat": {},
|
||||
"lstat64": {},
|
||||
"mach_absolute_time": {},
|
||||
"mach_timebase_info": {},
|
||||
"malloc": {},
|
||||
"mblen": {},
|
||||
"mbstowcs": {},
|
||||
"mbtowc": {},
|
||||
"memchr": {},
|
||||
"memcmp": {},
|
||||
"memcpy": {},
|
||||
"memmove": {},
|
||||
"memset": {},
|
||||
"mkdir": {},
|
||||
"mkfifo": {},
|
||||
"mknod": {},
|
||||
"mkostemp": {},
|
||||
"mkstemp": {},
|
||||
"mkstemp64": {},
|
||||
"mkstemps": {},
|
||||
"mkstemps64": {},
|
||||
"mktime": {},
|
||||
"mmap": {},
|
||||
"modf": {},
|
||||
"munmap": {},
|
||||
"nanf": {},
|
||||
"nl_langinfo": {},
|
||||
"ntohs": {},
|
||||
"obstack_free": {},
|
||||
"obstack_vprintf": {},
|
||||
"open": {},
|
||||
"opendir": {},
|
||||
"openpty": {},
|
||||
"pathconf": {},
|
||||
"pause": {},
|
||||
"pclose": {},
|
||||
"perror": {},
|
||||
"pipe": {},
|
||||
"poll": {},
|
||||
"popen": {},
|
||||
"posix_fadvise": {},
|
||||
"pow": {},
|
||||
"pread": {},
|
||||
"printf": {},
|
||||
"pselect": {},
|
||||
"pthread_attr_destroy": {},
|
||||
"pthread_attr_getdetachstate": {},
|
||||
"pthread_attr_init": {},
|
||||
"pthread_attr_setdetachstate": {},
|
||||
"pthread_attr_setscope": {},
|
||||
"pthread_attr_setstacksize": {},
|
||||
"pthread_cond_broadcast": {},
|
||||
"pthread_cond_destroy": {},
|
||||
"pthread_cond_init": {},
|
||||
"pthread_cond_signal": {},
|
||||
"pthread_cond_timedwait": {},
|
||||
"pthread_cond_wait": {},
|
||||
"pthread_create": {},
|
||||
"pthread_detach": {},
|
||||
"pthread_equal": {},
|
||||
"pthread_exit": {},
|
||||
"pthread_getspecific": {},
|
||||
"pthread_join": {},
|
||||
"pthread_key_create": {},
|
||||
"pthread_key_delete": {},
|
||||
"pthread_mutex_destroy": {},
|
||||
"pthread_mutex_init": {},
|
||||
"pthread_mutex_lock": {},
|
||||
"pthread_mutex_trylock": {},
|
||||
"pthread_mutex_unlock": {},
|
||||
"pthread_mutexattr_destroy": {},
|
||||
"pthread_mutexattr_init": {},
|
||||
"pthread_mutexattr_settype": {},
|
||||
"pthread_self": {},
|
||||
"pthread_setspecific": {},
|
||||
"putc": {},
|
||||
"putchar": {},
|
||||
"putenv": {},
|
||||
"puts": {},
|
||||
"pwrite": {},
|
||||
"qsort": {},
|
||||
"raise": {},
|
||||
"rand": {},
|
||||
"rand_r": {},
|
||||
"random": {},
|
||||
"random_r": {},
|
||||
"read": {},
|
||||
"readdir": {},
|
||||
"readlink": {},
|
||||
"readv": {},
|
||||
"realloc": {},
|
||||
"reallocarray": {},
|
||||
"realpath": {},
|
||||
"recv": {},
|
||||
"recvfrom": {},
|
||||
"recvmsg": {},
|
||||
"remove": {},
|
||||
"rename": {},
|
||||
"rewind": {},
|
||||
"rindex": {},
|
||||
"rint": {},
|
||||
"rmdir": {},
|
||||
"round": {},
|
||||
"scalbn": {},
|
||||
"scalbnl": {},
|
||||
"sched_yield": {},
|
||||
"select": {},
|
||||
"send": {},
|
||||
"sendmsg": {},
|
||||
"sendto": {},
|
||||
"setattrlist": {},
|
||||
"setbuf": {},
|
||||
"setenv": {},
|
||||
"setjmp": {},
|
||||
"setlocale": {},
|
||||
"setsid": {},
|
||||
"setsockopt": {},
|
||||
"setstate": {},
|
||||
"setvbuf": {},
|
||||
"shmat": {},
|
||||
"shmctl": {},
|
||||
"shmdt": {},
|
||||
"shutdown": {},
|
||||
"sigaction": {},
|
||||
"signal": {},
|
||||
"sin": {},
|
||||
"sinf": {},
|
||||
"sinh": {},
|
||||
"sleep": {},
|
||||
"snprintf": {},
|
||||
"socket": {},
|
||||
"sprintf": {},
|
||||
"sqrt": {},
|
||||
"srand48": {},
|
||||
"srandomdev": {},
|
||||
"sscanf": {},
|
||||
"stat": {},
|
||||
"stat64": {},
|
||||
"statfs": {},
|
||||
"stderr": {},
|
||||
"stdin": {},
|
||||
"stdout": {},
|
||||
"strcasecmp": {},
|
||||
"strcat": {},
|
||||
"strchr": {},
|
||||
"strcmp": {},
|
||||
"strcpy": {},
|
||||
"strcspn": {},
|
||||
"strdup": {},
|
||||
"strerror": {},
|
||||
"strerror_r": {},
|
||||
"strlcat": {},
|
||||
"strlcpy": {},
|
||||
"strlen": {},
|
||||
"strncasecmp": {},
|
||||
"strncat": {},
|
||||
"strncmp": {},
|
||||
"strncpy": {},
|
||||
"strnlen": {},
|
||||
"strpbrk": {},
|
||||
"strrchr": {},
|
||||
"strspn": {},
|
||||
"strstr": {},
|
||||
"strtod": {},
|
||||
"strtof": {},
|
||||
"strtoimax": {},
|
||||
"strtok": {},
|
||||
"strtol": {},
|
||||
"strtold": {},
|
||||
"strtoll": {},
|
||||
"strtoul": {},
|
||||
"strtoull": {},
|
||||
"strtoumax": {},
|
||||
"symlink": {},
|
||||
"sysconf": {},
|
||||
"system": {},
|
||||
"tan": {},
|
||||
"tanh": {},
|
||||
"tcgetattr": {},
|
||||
"tcsendbreak": {},
|
||||
"tcsetattr": {},
|
||||
"time": {},
|
||||
"tmpfile": {},
|
||||
"toascii": {},
|
||||
"tolower": {},
|
||||
"toupper": {},
|
||||
"trunc": {},
|
||||
"truncate": {},
|
||||
"tzset": {},
|
||||
"umask": {},
|
||||
"uname": {},
|
||||
"ungetc": {},
|
||||
"unlink": {},
|
||||
"unsetenv": {},
|
||||
"usleep": {},
|
||||
"utime": {},
|
||||
"utimes": {},
|
||||
"uuid_copy": {},
|
||||
"uuid_generate_random": {},
|
||||
"uuid_parse": {},
|
||||
"uuid_unparse": {},
|
||||
"vasprintf": {},
|
||||
"vfprintf": {},
|
||||
"vprintf": {},
|
||||
"vsnprintf": {},
|
||||
"vsprintf": {},
|
||||
"waitpid": {},
|
||||
"wcschr": {},
|
||||
"wctomb": {},
|
||||
"wcwidth": {},
|
||||
"write": {},
|
||||
"writev": {},
|
||||
"zero_struct_address": {},
|
||||
}
|
506
vendor/modernc.org/libc/capi_freebsd_386.go
generated
vendored
Normal file
506
vendor/modernc.org/libc/capi_freebsd_386.go
generated
vendored
Normal file
|
@ -0,0 +1,506 @@
|
|||
// Code generated by 'go generate' - DO NOT EDIT.
|
||||
|
||||
package libc // import "modernc.org/libc"
|
||||
|
||||
var CAPI = map[string]struct{}{
|
||||
"_CurrentRuneLocale": {},
|
||||
"_DefaultRuneLocale": {},
|
||||
"_IO_putc": {},
|
||||
"_ThreadRuneLocale": {},
|
||||
"___errno_location": {},
|
||||
"___runetype": {},
|
||||
"___tolower": {},
|
||||
"___toupper": {},
|
||||
"__assert": {},
|
||||
"__assert_fail": {},
|
||||
"__builtin___memcpy_chk": {},
|
||||
"__builtin___memmove_chk": {},
|
||||
"__builtin___memset_chk": {},
|
||||
"__builtin___snprintf_chk": {},
|
||||
"__builtin___sprintf_chk": {},
|
||||
"__builtin___strcat_chk": {},
|
||||
"__builtin___strcpy_chk": {},
|
||||
"__builtin___strncpy_chk": {},
|
||||
"__builtin___vsnprintf_chk": {},
|
||||
"__builtin_abort": {},
|
||||
"__builtin_abs": {},
|
||||
"__builtin_add_overflowInt64": {},
|
||||
"__builtin_add_overflowUint32": {},
|
||||
"__builtin_add_overflowUint64": {},
|
||||
"__builtin_bswap16": {},
|
||||
"__builtin_bswap32": {},
|
||||
"__builtin_bswap64": {},
|
||||
"__builtin_bzero": {},
|
||||
"__builtin_clz": {},
|
||||
"__builtin_clzl": {},
|
||||
"__builtin_clzll": {},
|
||||
"__builtin_constant_p_impl": {},
|
||||
"__builtin_copysign": {},
|
||||
"__builtin_copysignf": {},
|
||||
"__builtin_copysignl": {},
|
||||
"__builtin_exit": {},
|
||||
"__builtin_expect": {},
|
||||
"__builtin_fabs": {},
|
||||
"__builtin_fabsf": {},
|
||||
"__builtin_fabsl": {},
|
||||
"__builtin_free": {},
|
||||
"__builtin_getentropy": {},
|
||||
"__builtin_huge_val": {},
|
||||
"__builtin_huge_valf": {},
|
||||
"__builtin_inf": {},
|
||||
"__builtin_inff": {},
|
||||
"__builtin_infl": {},
|
||||
"__builtin_isnan": {},
|
||||
"__builtin_isunordered": {},
|
||||
"__builtin_llabs": {},
|
||||
"__builtin_malloc": {},
|
||||
"__builtin_memcmp": {},
|
||||
"__builtin_memcpy": {},
|
||||
"__builtin_memset": {},
|
||||
"__builtin_mmap": {},
|
||||
"__builtin_mul_overflowInt64": {},
|
||||
"__builtin_mul_overflowUint128": {},
|
||||
"__builtin_mul_overflowUint64": {},
|
||||
"__builtin_nan": {},
|
||||
"__builtin_nanf": {},
|
||||
"__builtin_nanl": {},
|
||||
"__builtin_object_size": {},
|
||||
"__builtin_popcount": {},
|
||||
"__builtin_popcountl": {},
|
||||
"__builtin_prefetch": {},
|
||||
"__builtin_printf": {},
|
||||
"__builtin_snprintf": {},
|
||||
"__builtin_sprintf": {},
|
||||
"__builtin_strchr": {},
|
||||
"__builtin_strcmp": {},
|
||||
"__builtin_strcpy": {},
|
||||
"__builtin_strlen": {},
|
||||
"__builtin_sub_overflowInt64": {},
|
||||
"__builtin_trap": {},
|
||||
"__builtin_unreachable": {},
|
||||
"__ccgo_dmesg": {},
|
||||
"__ccgo_getMutexType": {},
|
||||
"__ccgo_in6addr_anyp": {},
|
||||
"__ccgo_pthreadAttrGetDetachState": {},
|
||||
"__ccgo_pthreadMutexattrGettype": {},
|
||||
"__ccgo_sqlite3_log": {},
|
||||
"__cmsg_nxthdr": {},
|
||||
"__ctype_get_mb_cur_max": {},
|
||||
"__errno_location": {},
|
||||
"__error": {},
|
||||
"__floatscan": {},
|
||||
"__h_errno_location": {},
|
||||
"__inet_aton": {},
|
||||
"__inet_ntoa": {},
|
||||
"__intscan": {},
|
||||
"__isalnum_l": {},
|
||||
"__isalpha_l": {},
|
||||
"__isdigit_l": {},
|
||||
"__islower_l": {},
|
||||
"__isnan": {},
|
||||
"__isnanf": {},
|
||||
"__isnanl": {},
|
||||
"__isoc99_sscanf": {},
|
||||
"__isprint_l": {},
|
||||
"__isspace_l": {},
|
||||
"__isthreaded": {},
|
||||
"__isupper_l": {},
|
||||
"__isxdigit_l": {},
|
||||
"__lookup_ipliteral": {},
|
||||
"__lookup_name": {},
|
||||
"__lookup_serv": {},
|
||||
"__mb_sb_limit": {},
|
||||
"__runes_for_locale": {},
|
||||
"__shgetc": {},
|
||||
"__shlim": {},
|
||||
"__srget": {},
|
||||
"__stderrp": {},
|
||||
"__stdinp": {},
|
||||
"__stdoutp": {},
|
||||
"__swbuf": {},
|
||||
"__sync_add_and_fetch_uint32": {},
|
||||
"__sync_sub_and_fetch_uint32": {},
|
||||
"__syscall1": {},
|
||||
"__syscall3": {},
|
||||
"__syscall4": {},
|
||||
"__toread": {},
|
||||
"__toread_needs_stdio_exit": {},
|
||||
"__uflow": {},
|
||||
"__xuname": {},
|
||||
"_exit": {},
|
||||
"_longjmp": {},
|
||||
"_obstack_begin": {},
|
||||
"_obstack_newchunk": {},
|
||||
"_setjmp": {},
|
||||
"abort": {},
|
||||
"abs": {},
|
||||
"accept": {},
|
||||
"access": {},
|
||||
"acos": {},
|
||||
"acosh": {},
|
||||
"alarm": {},
|
||||
"asin": {},
|
||||
"asinh": {},
|
||||
"atan": {},
|
||||
"atan2": {},
|
||||
"atanh": {},
|
||||
"atexit": {},
|
||||
"atof": {},
|
||||
"atoi": {},
|
||||
"atol": {},
|
||||
"backtrace": {},
|
||||
"backtrace_symbols_fd": {},
|
||||
"bind": {},
|
||||
"bsearch": {},
|
||||
"bswap16": {},
|
||||
"bswap32": {},
|
||||
"bswap64": {},
|
||||
"bzero": {},
|
||||
"calloc": {},
|
||||
"ceil": {},
|
||||
"ceilf": {},
|
||||
"cfgetospeed": {},
|
||||
"cfsetispeed": {},
|
||||
"cfsetospeed": {},
|
||||
"chdir": {},
|
||||
"chflags": {},
|
||||
"chmod": {},
|
||||
"chown": {},
|
||||
"clock_gettime": {},
|
||||
"close": {},
|
||||
"closedir": {},
|
||||
"confstr": {},
|
||||
"connect": {},
|
||||
"copysign": {},
|
||||
"copysignf": {},
|
||||
"copysignl": {},
|
||||
"cos": {},
|
||||
"cosf": {},
|
||||
"cosh": {},
|
||||
"ctime": {},
|
||||
"ctime_r": {},
|
||||
"dlclose": {},
|
||||
"dlerror": {},
|
||||
"dlopen": {},
|
||||
"dlsym": {},
|
||||
"dup2": {},
|
||||
"endpwent": {},
|
||||
"environ": {},
|
||||
"execvp": {},
|
||||
"exit": {},
|
||||
"exp": {},
|
||||
"fabs": {},
|
||||
"fabsf": {},
|
||||
"fabsl": {},
|
||||
"fchmod": {},
|
||||
"fchown": {},
|
||||
"fclose": {},
|
||||
"fcntl": {},
|
||||
"fcntl64": {},
|
||||
"fdopen": {},
|
||||
"ferror": {},
|
||||
"fflush": {},
|
||||
"fgetc": {},
|
||||
"fgets": {},
|
||||
"fileno": {},
|
||||
"floor": {},
|
||||
"fmod": {},
|
||||
"fmodl": {},
|
||||
"fopen": {},
|
||||
"fopen64": {},
|
||||
"fork": {},
|
||||
"fprintf": {},
|
||||
"fputc": {},
|
||||
"fputs": {},
|
||||
"fread": {},
|
||||
"free": {},
|
||||
"freeaddrinfo": {},
|
||||
"frexp": {},
|
||||
"fscanf": {},
|
||||
"fseek": {},
|
||||
"fstat": {},
|
||||
"fstat64": {},
|
||||
"fsync": {},
|
||||
"ftell": {},
|
||||
"ftruncate": {},
|
||||
"fts64_close": {},
|
||||
"fts64_open": {},
|
||||
"fts64_read": {},
|
||||
"fts_close": {},
|
||||
"fts_open": {},
|
||||
"fts_read": {},
|
||||
"fwrite": {},
|
||||
"gai_strerror": {},
|
||||
"getaddrinfo": {},
|
||||
"getc": {},
|
||||
"getcwd": {},
|
||||
"getegid": {},
|
||||
"getentropy": {},
|
||||
"getenv": {},
|
||||
"geteuid": {},
|
||||
"getgid": {},
|
||||
"getgrgid": {},
|
||||
"getgrgid_r": {},
|
||||
"getgrnam": {},
|
||||
"getgrnam_r": {},
|
||||
"gethostbyaddr": {},
|
||||
"gethostbyaddr_r": {},
|
||||
"gethostbyname": {},
|
||||
"gethostbyname2": {},
|
||||
"gethostbyname2_r": {},
|
||||
"gethostname": {},
|
||||
"getnameinfo": {},
|
||||
"getpeername": {},
|
||||
"getpid": {},
|
||||
"getpwnam": {},
|
||||
"getpwnam_r": {},
|
||||
"getpwuid": {},
|
||||
"getpwuid_r": {},
|
||||
"getresgid": {},
|
||||
"getresuid": {},
|
||||
"getrlimit": {},
|
||||
"getrlimit64": {},
|
||||
"getrusage": {},
|
||||
"getservbyname": {},
|
||||
"getsockname": {},
|
||||
"getsockopt": {},
|
||||
"gettimeofday": {},
|
||||
"getuid": {},
|
||||
"gmtime_r": {},
|
||||
"h_errno": {},
|
||||
"htonl": {},
|
||||
"htons": {},
|
||||
"hypot": {},
|
||||
"inet_ntoa": {},
|
||||
"inet_ntop": {},
|
||||
"inet_pton": {},
|
||||
"initstate": {},
|
||||
"initstate_r": {},
|
||||
"ioctl": {},
|
||||
"isalnum": {},
|
||||
"isalpha": {},
|
||||
"isascii": {},
|
||||
"isatty": {},
|
||||
"isdigit": {},
|
||||
"islower": {},
|
||||
"isnan": {},
|
||||
"isnanf": {},
|
||||
"isnanl": {},
|
||||
"isprint": {},
|
||||
"isspace": {},
|
||||
"isupper": {},
|
||||
"isxdigit": {},
|
||||
"kill": {},
|
||||
"ldexp": {},
|
||||
"link": {},
|
||||
"listen": {},
|
||||
"llabs": {},
|
||||
"localtime": {},
|
||||
"localtime_r": {},
|
||||
"log": {},
|
||||
"log10": {},
|
||||
"log2": {},
|
||||
"longjmp": {},
|
||||
"lrand48": {},
|
||||
"lseek": {},
|
||||
"lseek64": {},
|
||||
"lstat": {},
|
||||
"lstat64": {},
|
||||
"malloc": {},
|
||||
"mblen": {},
|
||||
"mbstowcs": {},
|
||||
"mbtowc": {},
|
||||
"memchr": {},
|
||||
"memcmp": {},
|
||||
"memcpy": {},
|
||||
"memmove": {},
|
||||
"memset": {},
|
||||
"mkdir": {},
|
||||
"mkfifo": {},
|
||||
"mknod": {},
|
||||
"mkostemp": {},
|
||||
"mkstemp": {},
|
||||
"mkstemp64": {},
|
||||
"mkstemps": {},
|
||||
"mkstemps64": {},
|
||||
"mktime": {},
|
||||
"mmap": {},
|
||||
"modf": {},
|
||||
"munmap": {},
|
||||
"nl_langinfo": {},
|
||||
"ntohs": {},
|
||||
"obstack_free": {},
|
||||
"obstack_vprintf": {},
|
||||
"open": {},
|
||||
"open64": {},
|
||||
"opendir": {},
|
||||
"openpty": {},
|
||||
"pathconf": {},
|
||||
"pause": {},
|
||||
"pclose": {},
|
||||
"perror": {},
|
||||
"pipe": {},
|
||||
"poll": {},
|
||||
"popen": {},
|
||||
"pow": {},
|
||||
"pread": {},
|
||||
"printf": {},
|
||||
"pselect": {},
|
||||
"pthread_attr_destroy": {},
|
||||
"pthread_attr_getdetachstate": {},
|
||||
"pthread_attr_init": {},
|
||||
"pthread_attr_setdetachstate": {},
|
||||
"pthread_attr_setscope": {},
|
||||
"pthread_attr_setstacksize": {},
|
||||
"pthread_cond_broadcast": {},
|
||||
"pthread_cond_destroy": {},
|
||||
"pthread_cond_init": {},
|
||||
"pthread_cond_signal": {},
|
||||
"pthread_cond_timedwait": {},
|
||||
"pthread_cond_wait": {},
|
||||
"pthread_create": {},
|
||||
"pthread_detach": {},
|
||||
"pthread_equal": {},
|
||||
"pthread_exit": {},
|
||||
"pthread_getspecific": {},
|
||||
"pthread_join": {},
|
||||
"pthread_key_create": {},
|
||||
"pthread_key_delete": {},
|
||||
"pthread_mutex_destroy": {},
|
||||
"pthread_mutex_init": {},
|
||||
"pthread_mutex_lock": {},
|
||||
"pthread_mutex_trylock": {},
|
||||
"pthread_mutex_unlock": {},
|
||||
"pthread_mutexattr_destroy": {},
|
||||
"pthread_mutexattr_init": {},
|
||||
"pthread_mutexattr_settype": {},
|
||||
"pthread_self": {},
|
||||
"pthread_setspecific": {},
|
||||
"putc": {},
|
||||
"putchar": {},
|
||||
"puts": {},
|
||||
"qsort": {},
|
||||
"raise": {},
|
||||
"rand": {},
|
||||
"random": {},
|
||||
"random_r": {},
|
||||
"read": {},
|
||||
"readdir": {},
|
||||
"readdir64": {},
|
||||
"readlink": {},
|
||||
"readv": {},
|
||||
"realloc": {},
|
||||
"reallocarray": {},
|
||||
"realpath": {},
|
||||
"recv": {},
|
||||
"recvfrom": {},
|
||||
"recvmsg": {},
|
||||
"remove": {},
|
||||
"rename": {},
|
||||
"rewind": {},
|
||||
"rindex": {},
|
||||
"rint": {},
|
||||
"rmdir": {},
|
||||
"round": {},
|
||||
"scalbn": {},
|
||||
"scalbnl": {},
|
||||
"sched_yield": {},
|
||||
"select": {},
|
||||
"send": {},
|
||||
"sendmsg": {},
|
||||
"sendto": {},
|
||||
"setbuf": {},
|
||||
"setenv": {},
|
||||
"setjmp": {},
|
||||
"setlocale": {},
|
||||
"setrlimit": {},
|
||||
"setrlimit64": {},
|
||||
"setsid": {},
|
||||
"setsockopt": {},
|
||||
"setstate": {},
|
||||
"setvbuf": {},
|
||||
"shmat": {},
|
||||
"shmctl": {},
|
||||
"shmdt": {},
|
||||
"shutdown": {},
|
||||
"sigaction": {},
|
||||
"signal": {},
|
||||
"sin": {},
|
||||
"sinf": {},
|
||||
"sinh": {},
|
||||
"sleep": {},
|
||||
"snprintf": {},
|
||||
"socket": {},
|
||||
"sprintf": {},
|
||||
"sqrt": {},
|
||||
"srand48": {},
|
||||
"sscanf": {},
|
||||
"stat": {},
|
||||
"stat64": {},
|
||||
"stderr": {},
|
||||
"stdin": {},
|
||||
"stdout": {},
|
||||
"strcasecmp": {},
|
||||
"strcat": {},
|
||||
"strchr": {},
|
||||
"strcmp": {},
|
||||
"strcpy": {},
|
||||
"strcspn": {},
|
||||
"strdup": {},
|
||||
"strerror": {},
|
||||
"strerror_r": {},
|
||||
"strlen": {},
|
||||
"strncmp": {},
|
||||
"strncpy": {},
|
||||
"strnlen": {},
|
||||
"strpbrk": {},
|
||||
"strrchr": {},
|
||||
"strspn": {},
|
||||
"strstr": {},
|
||||
"strtod": {},
|
||||
"strtof": {},
|
||||
"strtoimax": {},
|
||||
"strtol": {},
|
||||
"strtold": {},
|
||||
"strtoll": {},
|
||||
"strtoul": {},
|
||||
"strtoull": {},
|
||||
"strtoumax": {},
|
||||
"symlink": {},
|
||||
"sysconf": {},
|
||||
"system": {},
|
||||
"tan": {},
|
||||
"tanh": {},
|
||||
"tcgetattr": {},
|
||||
"tcsendbreak": {},
|
||||
"tcsetattr": {},
|
||||
"time": {},
|
||||
"tmpfile": {},
|
||||
"tolower": {},
|
||||
"toupper": {},
|
||||
"trunc": {},
|
||||
"tzset": {},
|
||||
"umask": {},
|
||||
"uname": {},
|
||||
"ungetc": {},
|
||||
"unlink": {},
|
||||
"unsetenv": {},
|
||||
"usleep": {},
|
||||
"utime": {},
|
||||
"utimes": {},
|
||||
"uuid_generate_random": {},
|
||||
"uuid_parse": {},
|
||||
"uuid_unparse": {},
|
||||
"vasprintf": {},
|
||||
"vfprintf": {},
|
||||
"vprintf": {},
|
||||
"vsnprintf": {},
|
||||
"vsprintf": {},
|
||||
"waitpid": {},
|
||||
"wcschr": {},
|
||||
"wctomb": {},
|
||||
"wcwidth": {},
|
||||
"write": {},
|
||||
"writev": {},
|
||||
"zero_struct_address": {},
|
||||
}
|
506
vendor/modernc.org/libc/capi_freebsd_amd64.go
generated
vendored
Normal file
506
vendor/modernc.org/libc/capi_freebsd_amd64.go
generated
vendored
Normal file
|
@ -0,0 +1,506 @@
|
|||
// Code generated by 'go generate' - DO NOT EDIT.
|
||||
|
||||
package libc // import "modernc.org/libc"
|
||||
|
||||
var CAPI = map[string]struct{}{
|
||||
"_CurrentRuneLocale": {},
|
||||
"_DefaultRuneLocale": {},
|
||||
"_IO_putc": {},
|
||||
"_ThreadRuneLocale": {},
|
||||
"___errno_location": {},
|
||||
"___runetype": {},
|
||||
"___tolower": {},
|
||||
"___toupper": {},
|
||||
"__assert": {},
|
||||
"__assert_fail": {},
|
||||
"__builtin___memcpy_chk": {},
|
||||
"__builtin___memmove_chk": {},
|
||||
"__builtin___memset_chk": {},
|
||||
"__builtin___snprintf_chk": {},
|
||||
"__builtin___sprintf_chk": {},
|
||||
"__builtin___strcat_chk": {},
|
||||
"__builtin___strcpy_chk": {},
|
||||
"__builtin___strncpy_chk": {},
|
||||
"__builtin___vsnprintf_chk": {},
|
||||
"__builtin_abort": {},
|
||||
"__builtin_abs": {},
|
||||
"__builtin_add_overflowInt64": {},
|
||||
"__builtin_add_overflowUint32": {},
|
||||
"__builtin_add_overflowUint64": {},
|
||||
"__builtin_bswap16": {},
|
||||
"__builtin_bswap32": {},
|
||||
"__builtin_bswap64": {},
|
||||
"__builtin_bzero": {},
|
||||
"__builtin_clz": {},
|
||||
"__builtin_clzl": {},
|
||||
"__builtin_clzll": {},
|
||||
"__builtin_constant_p_impl": {},
|
||||
"__builtin_copysign": {},
|
||||
"__builtin_copysignf": {},
|
||||
"__builtin_copysignl": {},
|
||||
"__builtin_exit": {},
|
||||
"__builtin_expect": {},
|
||||
"__builtin_fabs": {},
|
||||
"__builtin_fabsf": {},
|
||||
"__builtin_fabsl": {},
|
||||
"__builtin_free": {},
|
||||
"__builtin_getentropy": {},
|
||||
"__builtin_huge_val": {},
|
||||
"__builtin_huge_valf": {},
|
||||
"__builtin_inf": {},
|
||||
"__builtin_inff": {},
|
||||
"__builtin_infl": {},
|
||||
"__builtin_isnan": {},
|
||||
"__builtin_isunordered": {},
|
||||
"__builtin_llabs": {},
|
||||
"__builtin_malloc": {},
|
||||
"__builtin_memcmp": {},
|
||||
"__builtin_memcpy": {},
|
||||
"__builtin_memset": {},
|
||||
"__builtin_mmap": {},
|
||||
"__builtin_mul_overflowInt64": {},
|
||||
"__builtin_mul_overflowUint128": {},
|
||||
"__builtin_mul_overflowUint64": {},
|
||||
"__builtin_nan": {},
|
||||
"__builtin_nanf": {},
|
||||
"__builtin_nanl": {},
|
||||
"__builtin_object_size": {},
|
||||
"__builtin_popcount": {},
|
||||
"__builtin_popcountl": {},
|
||||
"__builtin_prefetch": {},
|
||||
"__builtin_printf": {},
|
||||
"__builtin_snprintf": {},
|
||||
"__builtin_sprintf": {},
|
||||
"__builtin_strchr": {},
|
||||
"__builtin_strcmp": {},
|
||||
"__builtin_strcpy": {},
|
||||
"__builtin_strlen": {},
|
||||
"__builtin_sub_overflowInt64": {},
|
||||
"__builtin_trap": {},
|
||||
"__builtin_unreachable": {},
|
||||
"__ccgo_dmesg": {},
|
||||
"__ccgo_getMutexType": {},
|
||||
"__ccgo_in6addr_anyp": {},
|
||||
"__ccgo_pthreadAttrGetDetachState": {},
|
||||
"__ccgo_pthreadMutexattrGettype": {},
|
||||
"__ccgo_sqlite3_log": {},
|
||||
"__cmsg_nxthdr": {},
|
||||
"__ctype_get_mb_cur_max": {},
|
||||
"__errno_location": {},
|
||||
"__error": {},
|
||||
"__floatscan": {},
|
||||
"__h_errno_location": {},
|
||||
"__inet_aton": {},
|
||||
"__inet_ntoa": {},
|
||||
"__intscan": {},
|
||||
"__isalnum_l": {},
|
||||
"__isalpha_l": {},
|
||||
"__isdigit_l": {},
|
||||
"__islower_l": {},
|
||||
"__isnan": {},
|
||||
"__isnanf": {},
|
||||
"__isnanl": {},
|
||||
"__isoc99_sscanf": {},
|
||||
"__isprint_l": {},
|
||||
"__isspace_l": {},
|
||||
"__isthreaded": {},
|
||||
"__isupper_l": {},
|
||||
"__isxdigit_l": {},
|
||||
"__lookup_ipliteral": {},
|
||||
"__lookup_name": {},
|
||||
"__lookup_serv": {},
|
||||
"__mb_sb_limit": {},
|
||||
"__runes_for_locale": {},
|
||||
"__shgetc": {},
|
||||
"__shlim": {},
|
||||
"__srget": {},
|
||||
"__stderrp": {},
|
||||
"__stdinp": {},
|
||||
"__stdoutp": {},
|
||||
"__swbuf": {},
|
||||
"__sync_add_and_fetch_uint32": {},
|
||||
"__sync_sub_and_fetch_uint32": {},
|
||||
"__syscall1": {},
|
||||
"__syscall3": {},
|
||||
"__syscall4": {},
|
||||
"__toread": {},
|
||||
"__toread_needs_stdio_exit": {},
|
||||
"__uflow": {},
|
||||
"__xuname": {},
|
||||
"_exit": {},
|
||||
"_longjmp": {},
|
||||
"_obstack_begin": {},
|
||||
"_obstack_newchunk": {},
|
||||
"_setjmp": {},
|
||||
"abort": {},
|
||||
"abs": {},
|
||||
"accept": {},
|
||||
"access": {},
|
||||
"acos": {},
|
||||
"acosh": {},
|
||||
"alarm": {},
|
||||
"asin": {},
|
||||
"asinh": {},
|
||||
"atan": {},
|
||||
"atan2": {},
|
||||
"atanh": {},
|
||||
"atexit": {},
|
||||
"atof": {},
|
||||
"atoi": {},
|
||||
"atol": {},
|
||||
"backtrace": {},
|
||||
"backtrace_symbols_fd": {},
|
||||
"bind": {},
|
||||
"bsearch": {},
|
||||
"bswap16": {},
|
||||
"bswap32": {},
|
||||
"bswap64": {},
|
||||
"bzero": {},
|
||||
"calloc": {},
|
||||
"ceil": {},
|
||||
"ceilf": {},
|
||||
"cfgetospeed": {},
|
||||
"cfsetispeed": {},
|
||||
"cfsetospeed": {},
|
||||
"chdir": {},
|
||||
"chflags": {},
|
||||
"chmod": {},
|
||||
"chown": {},
|
||||
"clock_gettime": {},
|
||||
"close": {},
|
||||
"closedir": {},
|
||||
"confstr": {},
|
||||
"connect": {},
|
||||
"copysign": {},
|
||||
"copysignf": {},
|
||||
"copysignl": {},
|
||||
"cos": {},
|
||||
"cosf": {},
|
||||
"cosh": {},
|
||||
"ctime": {},
|
||||
"ctime_r": {},
|
||||
"dlclose": {},
|
||||
"dlerror": {},
|
||||
"dlopen": {},
|
||||
"dlsym": {},
|
||||
"dup2": {},
|
||||
"endpwent": {},
|
||||
"environ": {},
|
||||
"execvp": {},
|
||||
"exit": {},
|
||||
"exp": {},
|
||||
"fabs": {},
|
||||
"fabsf": {},
|
||||
"fabsl": {},
|
||||
"fchmod": {},
|
||||
"fchown": {},
|
||||
"fclose": {},
|
||||
"fcntl": {},
|
||||
"fcntl64": {},
|
||||
"fdopen": {},
|
||||
"ferror": {},
|
||||
"fflush": {},
|
||||
"fgetc": {},
|
||||
"fgets": {},
|
||||
"fileno": {},
|
||||
"floor": {},
|
||||
"fmod": {},
|
||||
"fmodl": {},
|
||||
"fopen": {},
|
||||
"fopen64": {},
|
||||
"fork": {},
|
||||
"fprintf": {},
|
||||
"fputc": {},
|
||||
"fputs": {},
|
||||
"fread": {},
|
||||
"free": {},
|
||||
"freeaddrinfo": {},
|
||||
"frexp": {},
|
||||
"fscanf": {},
|
||||
"fseek": {},
|
||||
"fstat": {},
|
||||
"fstat64": {},
|
||||
"fsync": {},
|
||||
"ftell": {},
|
||||
"ftruncate": {},
|
||||
"fts64_close": {},
|
||||
"fts64_open": {},
|
||||
"fts64_read": {},
|
||||
"fts_close": {},
|
||||
"fts_open": {},
|
||||
"fts_read": {},
|
||||
"fwrite": {},
|
||||
"gai_strerror": {},
|
||||
"getaddrinfo": {},
|
||||
"getc": {},
|
||||
"getcwd": {},
|
||||
"getegid": {},
|
||||
"getentropy": {},
|
||||
"getenv": {},
|
||||
"geteuid": {},
|
||||
"getgid": {},
|
||||
"getgrgid": {},
|
||||
"getgrgid_r": {},
|
||||
"getgrnam": {},
|
||||
"getgrnam_r": {},
|
||||
"gethostbyaddr": {},
|
||||
"gethostbyaddr_r": {},
|
||||
"gethostbyname": {},
|
||||
"gethostbyname2": {},
|
||||
"gethostbyname2_r": {},
|
||||
"gethostname": {},
|
||||
"getnameinfo": {},
|
||||
"getpeername": {},
|
||||
"getpid": {},
|
||||
"getpwnam": {},
|
||||
"getpwnam_r": {},
|
||||
"getpwuid": {},
|
||||
"getpwuid_r": {},
|
||||
"getresgid": {},
|
||||
"getresuid": {},
|
||||
"getrlimit": {},
|
||||
"getrlimit64": {},
|
||||
"getrusage": {},
|
||||
"getservbyname": {},
|
||||
"getsockname": {},
|
||||
"getsockopt": {},
|
||||
"gettimeofday": {},
|
||||
"getuid": {},
|
||||
"gmtime_r": {},
|
||||
"h_errno": {},
|
||||
"htonl": {},
|
||||
"htons": {},
|
||||
"hypot": {},
|
||||
"inet_ntoa": {},
|
||||
"inet_ntop": {},
|
||||
"inet_pton": {},
|
||||
"initstate": {},
|
||||
"initstate_r": {},
|
||||
"ioctl": {},
|
||||
"isalnum": {},
|
||||
"isalpha": {},
|
||||
"isascii": {},
|
||||
"isatty": {},
|
||||
"isdigit": {},
|
||||
"islower": {},
|
||||
"isnan": {},
|
||||
"isnanf": {},
|
||||
"isnanl": {},
|
||||
"isprint": {},
|
||||
"isspace": {},
|
||||
"isupper": {},
|
||||
"isxdigit": {},
|
||||
"kill": {},
|
||||
"ldexp": {},
|
||||
"link": {},
|
||||
"listen": {},
|
||||
"llabs": {},
|
||||
"localtime": {},
|
||||
"localtime_r": {},
|
||||
"log": {},
|
||||
"log10": {},
|
||||
"log2": {},
|
||||
"longjmp": {},
|
||||
"lrand48": {},
|
||||
"lseek": {},
|
||||
"lseek64": {},
|
||||
"lstat": {},
|
||||
"lstat64": {},
|
||||
"malloc": {},
|
||||
"mblen": {},
|
||||
"mbstowcs": {},
|
||||
"mbtowc": {},
|
||||
"memchr": {},
|
||||
"memcmp": {},
|
||||
"memcpy": {},
|
||||
"memmove": {},
|
||||
"memset": {},
|
||||
"mkdir": {},
|
||||
"mkfifo": {},
|
||||
"mknod": {},
|
||||
"mkostemp": {},
|
||||
"mkstemp": {},
|
||||
"mkstemp64": {},
|
||||
"mkstemps": {},
|
||||
"mkstemps64": {},
|
||||
"mktime": {},
|
||||
"mmap": {},
|
||||
"modf": {},
|
||||
"munmap": {},
|
||||
"nl_langinfo": {},
|
||||
"ntohs": {},
|
||||
"obstack_free": {},
|
||||
"obstack_vprintf": {},
|
||||
"open": {},
|
||||
"open64": {},
|
||||
"opendir": {},
|
||||
"openpty": {},
|
||||
"pathconf": {},
|
||||
"pause": {},
|
||||
"pclose": {},
|
||||
"perror": {},
|
||||
"pipe": {},
|
||||
"poll": {},
|
||||
"popen": {},
|
||||
"pow": {},
|
||||
"pread": {},
|
||||
"printf": {},
|
||||
"pselect": {},
|
||||
"pthread_attr_destroy": {},
|
||||
"pthread_attr_getdetachstate": {},
|
||||
"pthread_attr_init": {},
|
||||
"pthread_attr_setdetachstate": {},
|
||||
"pthread_attr_setscope": {},
|
||||
"pthread_attr_setstacksize": {},
|
||||
"pthread_cond_broadcast": {},
|
||||
"pthread_cond_destroy": {},
|
||||
"pthread_cond_init": {},
|
||||
"pthread_cond_signal": {},
|
||||
"pthread_cond_timedwait": {},
|
||||
"pthread_cond_wait": {},
|
||||
"pthread_create": {},
|
||||
"pthread_detach": {},
|
||||
"pthread_equal": {},
|
||||
"pthread_exit": {},
|
||||
"pthread_getspecific": {},
|
||||
"pthread_join": {},
|
||||
"pthread_key_create": {},
|
||||
"pthread_key_delete": {},
|
||||
"pthread_mutex_destroy": {},
|
||||
"pthread_mutex_init": {},
|
||||
"pthread_mutex_lock": {},
|
||||
"pthread_mutex_trylock": {},
|
||||
"pthread_mutex_unlock": {},
|
||||
"pthread_mutexattr_destroy": {},
|
||||
"pthread_mutexattr_init": {},
|
||||
"pthread_mutexattr_settype": {},
|
||||
"pthread_self": {},
|
||||
"pthread_setspecific": {},
|
||||
"putc": {},
|
||||
"putchar": {},
|
||||
"puts": {},
|
||||
"qsort": {},
|
||||
"raise": {},
|
||||
"rand": {},
|
||||
"random": {},
|
||||
"random_r": {},
|
||||
"read": {},
|
||||
"readdir": {},
|
||||
"readdir64": {},
|
||||
"readlink": {},
|
||||
"readv": {},
|
||||
"realloc": {},
|
||||
"reallocarray": {},
|
||||
"realpath": {},
|
||||
"recv": {},
|
||||
"recvfrom": {},
|
||||
"recvmsg": {},
|
||||
"remove": {},
|
||||
"rename": {},
|
||||
"rewind": {},
|
||||
"rindex": {},
|
||||
"rint": {},
|
||||
"rmdir": {},
|
||||
"round": {},
|
||||
"scalbn": {},
|
||||
"scalbnl": {},
|
||||
"sched_yield": {},
|
||||
"select": {},
|
||||
"send": {},
|
||||
"sendmsg": {},
|
||||
"sendto": {},
|
||||
"setbuf": {},
|
||||
"setenv": {},
|
||||
"setjmp": {},
|
||||
"setlocale": {},
|
||||
"setrlimit": {},
|
||||
"setrlimit64": {},
|
||||
"setsid": {},
|
||||
"setsockopt": {},
|
||||
"setstate": {},
|
||||
"setvbuf": {},
|
||||
"shmat": {},
|
||||
"shmctl": {},
|
||||
"shmdt": {},
|
||||
"shutdown": {},
|
||||
"sigaction": {},
|
||||
"signal": {},
|
||||
"sin": {},
|
||||
"sinf": {},
|
||||
"sinh": {},
|
||||
"sleep": {},
|
||||
"snprintf": {},
|
||||
"socket": {},
|
||||
"sprintf": {},
|
||||
"sqrt": {},
|
||||
"srand48": {},
|
||||
"sscanf": {},
|
||||
"stat": {},
|
||||
"stat64": {},
|
||||
"stderr": {},
|
||||
"stdin": {},
|
||||
"stdout": {},
|
||||
"strcasecmp": {},
|
||||
"strcat": {},
|
||||
"strchr": {},
|
||||
"strcmp": {},
|
||||
"strcpy": {},
|
||||
"strcspn": {},
|
||||
"strdup": {},
|
||||
"strerror": {},
|
||||
"strerror_r": {},
|
||||
"strlen": {},
|
||||
"strncmp": {},
|
||||
"strncpy": {},
|
||||
"strnlen": {},
|
||||
"strpbrk": {},
|
||||
"strrchr": {},
|
||||
"strspn": {},
|
||||
"strstr": {},
|
||||
"strtod": {},
|
||||
"strtof": {},
|
||||
"strtoimax": {},
|
||||
"strtol": {},
|
||||
"strtold": {},
|
||||
"strtoll": {},
|
||||
"strtoul": {},
|
||||
"strtoull": {},
|
||||
"strtoumax": {},
|
||||
"symlink": {},
|
||||
"sysconf": {},
|
||||
"system": {},
|
||||
"tan": {},
|
||||
"tanh": {},
|
||||
"tcgetattr": {},
|
||||
"tcsendbreak": {},
|
||||
"tcsetattr": {},
|
||||
"time": {},
|
||||
"tmpfile": {},
|
||||
"tolower": {},
|
||||
"toupper": {},
|
||||
"trunc": {},
|
||||
"tzset": {},
|
||||
"umask": {},
|
||||
"uname": {},
|
||||
"ungetc": {},
|
||||
"unlink": {},
|
||||
"unsetenv": {},
|
||||
"usleep": {},
|
||||
"utime": {},
|
||||
"utimes": {},
|
||||
"uuid_generate_random": {},
|
||||
"uuid_parse": {},
|
||||
"uuid_unparse": {},
|
||||
"vasprintf": {},
|
||||
"vfprintf": {},
|
||||
"vprintf": {},
|
||||
"vsnprintf": {},
|
||||
"vsprintf": {},
|
||||
"waitpid": {},
|
||||
"wcschr": {},
|
||||
"wctomb": {},
|
||||
"wcwidth": {},
|
||||
"write": {},
|
||||
"writev": {},
|
||||
"zero_struct_address": {},
|
||||
}
|
506
vendor/modernc.org/libc/capi_freebsd_arm.go
generated
vendored
Normal file
506
vendor/modernc.org/libc/capi_freebsd_arm.go
generated
vendored
Normal file
|
@ -0,0 +1,506 @@
|
|||
// Code generated by 'go generate' - DO NOT EDIT.
|
||||
|
||||
package libc // import "modernc.org/libc"
|
||||
|
||||
var CAPI = map[string]struct{}{
|
||||
"_CurrentRuneLocale": {},
|
||||
"_DefaultRuneLocale": {},
|
||||
"_IO_putc": {},
|
||||
"_ThreadRuneLocale": {},
|
||||
"___errno_location": {},
|
||||
"___runetype": {},
|
||||
"___tolower": {},
|
||||
"___toupper": {},
|
||||
"__assert": {},
|
||||
"__assert_fail": {},
|
||||
"__builtin___memcpy_chk": {},
|
||||
"__builtin___memmove_chk": {},
|
||||
"__builtin___memset_chk": {},
|
||||
"__builtin___snprintf_chk": {},
|
||||
"__builtin___sprintf_chk": {},
|
||||
"__builtin___strcat_chk": {},
|
||||
"__builtin___strcpy_chk": {},
|
||||
"__builtin___strncpy_chk": {},
|
||||
"__builtin___vsnprintf_chk": {},
|
||||
"__builtin_abort": {},
|
||||
"__builtin_abs": {},
|
||||
"__builtin_add_overflowInt64": {},
|
||||
"__builtin_add_overflowUint32": {},
|
||||
"__builtin_add_overflowUint64": {},
|
||||
"__builtin_bswap16": {},
|
||||
"__builtin_bswap32": {},
|
||||
"__builtin_bswap64": {},
|
||||
"__builtin_bzero": {},
|
||||
"__builtin_clz": {},
|
||||
"__builtin_clzl": {},
|
||||
"__builtin_clzll": {},
|
||||
"__builtin_constant_p_impl": {},
|
||||
"__builtin_copysign": {},
|
||||
"__builtin_copysignf": {},
|
||||
"__builtin_copysignl": {},
|
||||
"__builtin_exit": {},
|
||||
"__builtin_expect": {},
|
||||
"__builtin_fabs": {},
|
||||
"__builtin_fabsf": {},
|
||||
"__builtin_fabsl": {},
|
||||
"__builtin_free": {},
|
||||
"__builtin_getentropy": {},
|
||||
"__builtin_huge_val": {},
|
||||
"__builtin_huge_valf": {},
|
||||
"__builtin_inf": {},
|
||||
"__builtin_inff": {},
|
||||
"__builtin_infl": {},
|
||||
"__builtin_isnan": {},
|
||||
"__builtin_isunordered": {},
|
||||
"__builtin_llabs": {},
|
||||
"__builtin_malloc": {},
|
||||
"__builtin_memcmp": {},
|
||||
"__builtin_memcpy": {},
|
||||
"__builtin_memset": {},
|
||||
"__builtin_mmap": {},
|
||||
"__builtin_mul_overflowInt64": {},
|
||||
"__builtin_mul_overflowUint128": {},
|
||||
"__builtin_mul_overflowUint64": {},
|
||||
"__builtin_nan": {},
|
||||
"__builtin_nanf": {},
|
||||
"__builtin_nanl": {},
|
||||
"__builtin_object_size": {},
|
||||
"__builtin_popcount": {},
|
||||
"__builtin_popcountl": {},
|
||||
"__builtin_prefetch": {},
|
||||
"__builtin_printf": {},
|
||||
"__builtin_snprintf": {},
|
||||
"__builtin_sprintf": {},
|
||||
"__builtin_strchr": {},
|
||||
"__builtin_strcmp": {},
|
||||
"__builtin_strcpy": {},
|
||||
"__builtin_strlen": {},
|
||||
"__builtin_sub_overflowInt64": {},
|
||||
"__builtin_trap": {},
|
||||
"__builtin_unreachable": {},
|
||||
"__ccgo_dmesg": {},
|
||||
"__ccgo_getMutexType": {},
|
||||
"__ccgo_in6addr_anyp": {},
|
||||
"__ccgo_pthreadAttrGetDetachState": {},
|
||||
"__ccgo_pthreadMutexattrGettype": {},
|
||||
"__ccgo_sqlite3_log": {},
|
||||
"__cmsg_nxthdr": {},
|
||||
"__ctype_get_mb_cur_max": {},
|
||||
"__errno_location": {},
|
||||
"__error": {},
|
||||
"__floatscan": {},
|
||||
"__h_errno_location": {},
|
||||
"__inet_aton": {},
|
||||
"__inet_ntoa": {},
|
||||
"__intscan": {},
|
||||
"__isalnum_l": {},
|
||||
"__isalpha_l": {},
|
||||
"__isdigit_l": {},
|
||||
"__islower_l": {},
|
||||
"__isnan": {},
|
||||
"__isnanf": {},
|
||||
"__isnanl": {},
|
||||
"__isoc99_sscanf": {},
|
||||
"__isprint_l": {},
|
||||
"__isspace_l": {},
|
||||
"__isthreaded": {},
|
||||
"__isupper_l": {},
|
||||
"__isxdigit_l": {},
|
||||
"__lookup_ipliteral": {},
|
||||
"__lookup_name": {},
|
||||
"__lookup_serv": {},
|
||||
"__mb_sb_limit": {},
|
||||
"__runes_for_locale": {},
|
||||
"__shgetc": {},
|
||||
"__shlim": {},
|
||||
"__srget": {},
|
||||
"__stderrp": {},
|
||||
"__stdinp": {},
|
||||
"__stdoutp": {},
|
||||
"__swbuf": {},
|
||||
"__sync_add_and_fetch_uint32": {},
|
||||
"__sync_sub_and_fetch_uint32": {},
|
||||
"__syscall1": {},
|
||||
"__syscall3": {},
|
||||
"__syscall4": {},
|
||||
"__toread": {},
|
||||
"__toread_needs_stdio_exit": {},
|
||||
"__uflow": {},
|
||||
"__xuname": {},
|
||||
"_exit": {},
|
||||
"_longjmp": {},
|
||||
"_obstack_begin": {},
|
||||
"_obstack_newchunk": {},
|
||||
"_setjmp": {},
|
||||
"abort": {},
|
||||
"abs": {},
|
||||
"accept": {},
|
||||
"access": {},
|
||||
"acos": {},
|
||||
"acosh": {},
|
||||
"alarm": {},
|
||||
"asin": {},
|
||||
"asinh": {},
|
||||
"atan": {},
|
||||
"atan2": {},
|
||||
"atanh": {},
|
||||
"atexit": {},
|
||||
"atof": {},
|
||||
"atoi": {},
|
||||
"atol": {},
|
||||
"backtrace": {},
|
||||
"backtrace_symbols_fd": {},
|
||||
"bind": {},
|
||||
"bsearch": {},
|
||||
"bswap16": {},
|
||||
"bswap32": {},
|
||||
"bswap64": {},
|
||||
"bzero": {},
|
||||
"calloc": {},
|
||||
"ceil": {},
|
||||
"ceilf": {},
|
||||
"cfgetospeed": {},
|
||||
"cfsetispeed": {},
|
||||
"cfsetospeed": {},
|
||||
"chdir": {},
|
||||
"chflags": {},
|
||||
"chmod": {},
|
||||
"chown": {},
|
||||
"clock_gettime": {},
|
||||
"close": {},
|
||||
"closedir": {},
|
||||
"confstr": {},
|
||||
"connect": {},
|
||||
"copysign": {},
|
||||
"copysignf": {},
|
||||
"copysignl": {},
|
||||
"cos": {},
|
||||
"cosf": {},
|
||||
"cosh": {},
|
||||
"ctime": {},
|
||||
"ctime_r": {},
|
||||
"dlclose": {},
|
||||
"dlerror": {},
|
||||
"dlopen": {},
|
||||
"dlsym": {},
|
||||
"dup2": {},
|
||||
"endpwent": {},
|
||||
"environ": {},
|
||||
"execvp": {},
|
||||
"exit": {},
|
||||
"exp": {},
|
||||
"fabs": {},
|
||||
"fabsf": {},
|
||||
"fabsl": {},
|
||||
"fchmod": {},
|
||||
"fchown": {},
|
||||
"fclose": {},
|
||||
"fcntl": {},
|
||||
"fcntl64": {},
|
||||
"fdopen": {},
|
||||
"ferror": {},
|
||||
"fflush": {},
|
||||
"fgetc": {},
|
||||
"fgets": {},
|
||||
"fileno": {},
|
||||
"floor": {},
|
||||
"fmod": {},
|
||||
"fmodl": {},
|
||||
"fopen": {},
|
||||
"fopen64": {},
|
||||
"fork": {},
|
||||
"fprintf": {},
|
||||
"fputc": {},
|
||||
"fputs": {},
|
||||
"fread": {},
|
||||
"free": {},
|
||||
"freeaddrinfo": {},
|
||||
"frexp": {},
|
||||
"fscanf": {},
|
||||
"fseek": {},
|
||||
"fstat": {},
|
||||
"fstat64": {},
|
||||
"fsync": {},
|
||||
"ftell": {},
|
||||
"ftruncate": {},
|
||||
"fts64_close": {},
|
||||
"fts64_open": {},
|
||||
"fts64_read": {},
|
||||
"fts_close": {},
|
||||
"fts_open": {},
|
||||
"fts_read": {},
|
||||
"fwrite": {},
|
||||
"gai_strerror": {},
|
||||
"getaddrinfo": {},
|
||||
"getc": {},
|
||||
"getcwd": {},
|
||||
"getegid": {},
|
||||
"getentropy": {},
|
||||
"getenv": {},
|
||||
"geteuid": {},
|
||||
"getgid": {},
|
||||
"getgrgid": {},
|
||||
"getgrgid_r": {},
|
||||
"getgrnam": {},
|
||||
"getgrnam_r": {},
|
||||
"gethostbyaddr": {},
|
||||
"gethostbyaddr_r": {},
|
||||
"gethostbyname": {},
|
||||
"gethostbyname2": {},
|
||||
"gethostbyname2_r": {},
|
||||
"gethostname": {},
|
||||
"getnameinfo": {},
|
||||
"getpeername": {},
|
||||
"getpid": {},
|
||||
"getpwnam": {},
|
||||
"getpwnam_r": {},
|
||||
"getpwuid": {},
|
||||
"getpwuid_r": {},
|
||||
"getresgid": {},
|
||||
"getresuid": {},
|
||||
"getrlimit": {},
|
||||
"getrlimit64": {},
|
||||
"getrusage": {},
|
||||
"getservbyname": {},
|
||||
"getsockname": {},
|
||||
"getsockopt": {},
|
||||
"gettimeofday": {},
|
||||
"getuid": {},
|
||||
"gmtime_r": {},
|
||||
"h_errno": {},
|
||||
"htonl": {},
|
||||
"htons": {},
|
||||
"hypot": {},
|
||||
"inet_ntoa": {},
|
||||
"inet_ntop": {},
|
||||
"inet_pton": {},
|
||||
"initstate": {},
|
||||
"initstate_r": {},
|
||||
"ioctl": {},
|
||||
"isalnum": {},
|
||||
"isalpha": {},
|
||||
"isascii": {},
|
||||
"isatty": {},
|
||||
"isdigit": {},
|
||||
"islower": {},
|
||||
"isnan": {},
|
||||
"isnanf": {},
|
||||
"isnanl": {},
|
||||
"isprint": {},
|
||||
"isspace": {},
|
||||
"isupper": {},
|
||||
"isxdigit": {},
|
||||
"kill": {},
|
||||
"ldexp": {},
|
||||
"link": {},
|
||||
"listen": {},
|
||||
"llabs": {},
|
||||
"localtime": {},
|
||||
"localtime_r": {},
|
||||
"log": {},
|
||||
"log10": {},
|
||||
"log2": {},
|
||||
"longjmp": {},
|
||||
"lrand48": {},
|
||||
"lseek": {},
|
||||
"lseek64": {},
|
||||
"lstat": {},
|
||||
"lstat64": {},
|
||||
"malloc": {},
|
||||
"mblen": {},
|
||||
"mbstowcs": {},
|
||||
"mbtowc": {},
|
||||
"memchr": {},
|
||||
"memcmp": {},
|
||||
"memcpy": {},
|
||||
"memmove": {},
|
||||
"memset": {},
|
||||
"mkdir": {},
|
||||
"mkfifo": {},
|
||||
"mknod": {},
|
||||
"mkostemp": {},
|
||||
"mkstemp": {},
|
||||
"mkstemp64": {},
|
||||
"mkstemps": {},
|
||||
"mkstemps64": {},
|
||||
"mktime": {},
|
||||
"mmap": {},
|
||||
"modf": {},
|
||||
"munmap": {},
|
||||
"nl_langinfo": {},
|
||||
"ntohs": {},
|
||||
"obstack_free": {},
|
||||
"obstack_vprintf": {},
|
||||
"open": {},
|
||||
"open64": {},
|
||||
"opendir": {},
|
||||
"openpty": {},
|
||||
"pathconf": {},
|
||||
"pause": {},
|
||||
"pclose": {},
|
||||
"perror": {},
|
||||
"pipe": {},
|
||||
"poll": {},
|
||||
"popen": {},
|
||||
"pow": {},
|
||||
"pread": {},
|
||||
"printf": {},
|
||||
"pselect": {},
|
||||
"pthread_attr_destroy": {},
|
||||
"pthread_attr_getdetachstate": {},
|
||||
"pthread_attr_init": {},
|
||||
"pthread_attr_setdetachstate": {},
|
||||
"pthread_attr_setscope": {},
|
||||
"pthread_attr_setstacksize": {},
|
||||
"pthread_cond_broadcast": {},
|
||||
"pthread_cond_destroy": {},
|
||||
"pthread_cond_init": {},
|
||||
"pthread_cond_signal": {},
|
||||
"pthread_cond_timedwait": {},
|
||||
"pthread_cond_wait": {},
|
||||
"pthread_create": {},
|
||||
"pthread_detach": {},
|
||||
"pthread_equal": {},
|
||||
"pthread_exit": {},
|
||||
"pthread_getspecific": {},
|
||||
"pthread_join": {},
|
||||
"pthread_key_create": {},
|
||||
"pthread_key_delete": {},
|
||||
"pthread_mutex_destroy": {},
|
||||
"pthread_mutex_init": {},
|
||||
"pthread_mutex_lock": {},
|
||||
"pthread_mutex_trylock": {},
|
||||
"pthread_mutex_unlock": {},
|
||||
"pthread_mutexattr_destroy": {},
|
||||
"pthread_mutexattr_init": {},
|
||||
"pthread_mutexattr_settype": {},
|
||||
"pthread_self": {},
|
||||
"pthread_setspecific": {},
|
||||
"putc": {},
|
||||
"putchar": {},
|
||||
"puts": {},
|
||||
"qsort": {},
|
||||
"raise": {},
|
||||
"rand": {},
|
||||
"random": {},
|
||||
"random_r": {},
|
||||
"read": {},
|
||||
"readdir": {},
|
||||
"readdir64": {},
|
||||
"readlink": {},
|
||||
"readv": {},
|
||||
"realloc": {},
|
||||
"reallocarray": {},
|
||||
"realpath": {},
|
||||
"recv": {},
|
||||
"recvfrom": {},
|
||||
"recvmsg": {},
|
||||
"remove": {},
|
||||
"rename": {},
|
||||
"rewind": {},
|
||||
"rindex": {},
|
||||
"rint": {},
|
||||
"rmdir": {},
|
||||
"round": {},
|
||||
"scalbn": {},
|
||||
"scalbnl": {},
|
||||
"sched_yield": {},
|
||||
"select": {},
|
||||
"send": {},
|
||||
"sendmsg": {},
|
||||
"sendto": {},
|
||||
"setbuf": {},
|
||||
"setenv": {},
|
||||
"setjmp": {},
|
||||
"setlocale": {},
|
||||
"setrlimit": {},
|
||||
"setrlimit64": {},
|
||||
"setsid": {},
|
||||
"setsockopt": {},
|
||||
"setstate": {},
|
||||
"setvbuf": {},
|
||||
"shmat": {},
|
||||
"shmctl": {},
|
||||
"shmdt": {},
|
||||
"shutdown": {},
|
||||
"sigaction": {},
|
||||
"signal": {},
|
||||
"sin": {},
|
||||
"sinf": {},
|
||||
"sinh": {},
|
||||
"sleep": {},
|
||||
"snprintf": {},
|
||||
"socket": {},
|
||||
"sprintf": {},
|
||||
"sqrt": {},
|
||||
"srand48": {},
|
||||
"sscanf": {},
|
||||
"stat": {},
|
||||
"stat64": {},
|
||||
"stderr": {},
|
||||
"stdin": {},
|
||||
"stdout": {},
|
||||
"strcasecmp": {},
|
||||
"strcat": {},
|
||||
"strchr": {},
|
||||
"strcmp": {},
|
||||
"strcpy": {},
|
||||
"strcspn": {},
|
||||
"strdup": {},
|
||||
"strerror": {},
|
||||
"strerror_r": {},
|
||||
"strlen": {},
|
||||
"strncmp": {},
|
||||
"strncpy": {},
|
||||
"strnlen": {},
|
||||
"strpbrk": {},
|
||||
"strrchr": {},
|
||||
"strspn": {},
|
||||
"strstr": {},
|
||||
"strtod": {},
|
||||
"strtof": {},
|
||||
"strtoimax": {},
|
||||
"strtol": {},
|
||||
"strtold": {},
|
||||
"strtoll": {},
|
||||
"strtoul": {},
|
||||
"strtoull": {},
|
||||
"strtoumax": {},
|
||||
"symlink": {},
|
||||
"sysconf": {},
|
||||
"system": {},
|
||||
"tan": {},
|
||||
"tanh": {},
|
||||
"tcgetattr": {},
|
||||
"tcsendbreak": {},
|
||||
"tcsetattr": {},
|
||||
"time": {},
|
||||
"tmpfile": {},
|
||||
"tolower": {},
|
||||
"toupper": {},
|
||||
"trunc": {},
|
||||
"tzset": {},
|
||||
"umask": {},
|
||||
"uname": {},
|
||||
"ungetc": {},
|
||||
"unlink": {},
|
||||
"unsetenv": {},
|
||||
"usleep": {},
|
||||
"utime": {},
|
||||
"utimes": {},
|
||||
"uuid_generate_random": {},
|
||||
"uuid_parse": {},
|
||||
"uuid_unparse": {},
|
||||
"vasprintf": {},
|
||||
"vfprintf": {},
|
||||
"vprintf": {},
|
||||
"vsnprintf": {},
|
||||
"vsprintf": {},
|
||||
"waitpid": {},
|
||||
"wcschr": {},
|
||||
"wctomb": {},
|
||||
"wcwidth": {},
|
||||
"write": {},
|
||||
"writev": {},
|
||||
"zero_struct_address": {},
|
||||
}
|
506
vendor/modernc.org/libc/capi_freebsd_arm64.go
generated
vendored
Normal file
506
vendor/modernc.org/libc/capi_freebsd_arm64.go
generated
vendored
Normal file
|
@ -0,0 +1,506 @@
|
|||
// Code generated by 'go generate' - DO NOT EDIT.
|
||||
|
||||
package libc // import "modernc.org/libc"
|
||||
|
||||
var CAPI = map[string]struct{}{
|
||||
"_CurrentRuneLocale": {},
|
||||
"_DefaultRuneLocale": {},
|
||||
"_IO_putc": {},
|
||||
"_ThreadRuneLocale": {},
|
||||
"___errno_location": {},
|
||||
"___runetype": {},
|
||||
"___tolower": {},
|
||||
"___toupper": {},
|
||||
"__assert": {},
|
||||
"__assert_fail": {},
|
||||
"__builtin___memcpy_chk": {},
|
||||
"__builtin___memmove_chk": {},
|
||||
"__builtin___memset_chk": {},
|
||||
"__builtin___snprintf_chk": {},
|
||||
"__builtin___sprintf_chk": {},
|
||||
"__builtin___strcat_chk": {},
|
||||
"__builtin___strcpy_chk": {},
|
||||
"__builtin___strncpy_chk": {},
|
||||
"__builtin___vsnprintf_chk": {},
|
||||
"__builtin_abort": {},
|
||||
"__builtin_abs": {},
|
||||
"__builtin_add_overflowInt64": {},
|
||||
"__builtin_add_overflowUint32": {},
|
||||
"__builtin_add_overflowUint64": {},
|
||||
"__builtin_bswap16": {},
|
||||
"__builtin_bswap32": {},
|
||||
"__builtin_bswap64": {},
|
||||
"__builtin_bzero": {},
|
||||
"__builtin_clz": {},
|
||||
"__builtin_clzl": {},
|
||||
"__builtin_clzll": {},
|
||||
"__builtin_constant_p_impl": {},
|
||||
"__builtin_copysign": {},
|
||||
"__builtin_copysignf": {},
|
||||
"__builtin_copysignl": {},
|
||||
"__builtin_exit": {},
|
||||
"__builtin_expect": {},
|
||||
"__builtin_fabs": {},
|
||||
"__builtin_fabsf": {},
|
||||
"__builtin_fabsl": {},
|
||||
"__builtin_free": {},
|
||||
"__builtin_getentropy": {},
|
||||
"__builtin_huge_val": {},
|
||||
"__builtin_huge_valf": {},
|
||||
"__builtin_inf": {},
|
||||
"__builtin_inff": {},
|
||||
"__builtin_infl": {},
|
||||
"__builtin_isnan": {},
|
||||
"__builtin_isunordered": {},
|
||||
"__builtin_llabs": {},
|
||||
"__builtin_malloc": {},
|
||||
"__builtin_memcmp": {},
|
||||
"__builtin_memcpy": {},
|
||||
"__builtin_memset": {},
|
||||
"__builtin_mmap": {},
|
||||
"__builtin_mul_overflowInt64": {},
|
||||
"__builtin_mul_overflowUint128": {},
|
||||
"__builtin_mul_overflowUint64": {},
|
||||
"__builtin_nan": {},
|
||||
"__builtin_nanf": {},
|
||||
"__builtin_nanl": {},
|
||||
"__builtin_object_size": {},
|
||||
"__builtin_popcount": {},
|
||||
"__builtin_popcountl": {},
|
||||
"__builtin_prefetch": {},
|
||||
"__builtin_printf": {},
|
||||
"__builtin_snprintf": {},
|
||||
"__builtin_sprintf": {},
|
||||
"__builtin_strchr": {},
|
||||
"__builtin_strcmp": {},
|
||||
"__builtin_strcpy": {},
|
||||
"__builtin_strlen": {},
|
||||
"__builtin_sub_overflowInt64": {},
|
||||
"__builtin_trap": {},
|
||||
"__builtin_unreachable": {},
|
||||
"__ccgo_dmesg": {},
|
||||
"__ccgo_getMutexType": {},
|
||||
"__ccgo_in6addr_anyp": {},
|
||||
"__ccgo_pthreadAttrGetDetachState": {},
|
||||
"__ccgo_pthreadMutexattrGettype": {},
|
||||
"__ccgo_sqlite3_log": {},
|
||||
"__cmsg_nxthdr": {},
|
||||
"__ctype_get_mb_cur_max": {},
|
||||
"__errno_location": {},
|
||||
"__error": {},
|
||||
"__floatscan": {},
|
||||
"__h_errno_location": {},
|
||||
"__inet_aton": {},
|
||||
"__inet_ntoa": {},
|
||||
"__intscan": {},
|
||||
"__isalnum_l": {},
|
||||
"__isalpha_l": {},
|
||||
"__isdigit_l": {},
|
||||
"__islower_l": {},
|
||||
"__isnan": {},
|
||||
"__isnanf": {},
|
||||
"__isnanl": {},
|
||||
"__isoc99_sscanf": {},
|
||||
"__isprint_l": {},
|
||||
"__isspace_l": {},
|
||||
"__isthreaded": {},
|
||||
"__isupper_l": {},
|
||||
"__isxdigit_l": {},
|
||||
"__lookup_ipliteral": {},
|
||||
"__lookup_name": {},
|
||||
"__lookup_serv": {},
|
||||
"__mb_sb_limit": {},
|
||||
"__runes_for_locale": {},
|
||||
"__shgetc": {},
|
||||
"__shlim": {},
|
||||
"__srget": {},
|
||||
"__stderrp": {},
|
||||
"__stdinp": {},
|
||||
"__stdoutp": {},
|
||||
"__swbuf": {},
|
||||
"__sync_add_and_fetch_uint32": {},
|
||||
"__sync_sub_and_fetch_uint32": {},
|
||||
"__syscall1": {},
|
||||
"__syscall3": {},
|
||||
"__syscall4": {},
|
||||
"__toread": {},
|
||||
"__toread_needs_stdio_exit": {},
|
||||
"__uflow": {},
|
||||
"__xuname": {},
|
||||
"_exit": {},
|
||||
"_longjmp": {},
|
||||
"_obstack_begin": {},
|
||||
"_obstack_newchunk": {},
|
||||
"_setjmp": {},
|
||||
"abort": {},
|
||||
"abs": {},
|
||||
"accept": {},
|
||||
"access": {},
|
||||
"acos": {},
|
||||
"acosh": {},
|
||||
"alarm": {},
|
||||
"asin": {},
|
||||
"asinh": {},
|
||||
"atan": {},
|
||||
"atan2": {},
|
||||
"atanh": {},
|
||||
"atexit": {},
|
||||
"atof": {},
|
||||
"atoi": {},
|
||||
"atol": {},
|
||||
"backtrace": {},
|
||||
"backtrace_symbols_fd": {},
|
||||
"bind": {},
|
||||
"bsearch": {},
|
||||
"bswap16": {},
|
||||
"bswap32": {},
|
||||
"bswap64": {},
|
||||
"bzero": {},
|
||||
"calloc": {},
|
||||
"ceil": {},
|
||||
"ceilf": {},
|
||||
"cfgetospeed": {},
|
||||
"cfsetispeed": {},
|
||||
"cfsetospeed": {},
|
||||
"chdir": {},
|
||||
"chflags": {},
|
||||
"chmod": {},
|
||||
"chown": {},
|
||||
"clock_gettime": {},
|
||||
"close": {},
|
||||
"closedir": {},
|
||||
"confstr": {},
|
||||
"connect": {},
|
||||
"copysign": {},
|
||||
"copysignf": {},
|
||||
"copysignl": {},
|
||||
"cos": {},
|
||||
"cosf": {},
|
||||
"cosh": {},
|
||||
"ctime": {},
|
||||
"ctime_r": {},
|
||||
"dlclose": {},
|
||||
"dlerror": {},
|
||||
"dlopen": {},
|
||||
"dlsym": {},
|
||||
"dup2": {},
|
||||
"endpwent": {},
|
||||
"environ": {},
|
||||
"execvp": {},
|
||||
"exit": {},
|
||||
"exp": {},
|
||||
"fabs": {},
|
||||
"fabsf": {},
|
||||
"fabsl": {},
|
||||
"fchmod": {},
|
||||
"fchown": {},
|
||||
"fclose": {},
|
||||
"fcntl": {},
|
||||
"fcntl64": {},
|
||||
"fdopen": {},
|
||||
"ferror": {},
|
||||
"fflush": {},
|
||||
"fgetc": {},
|
||||
"fgets": {},
|
||||
"fileno": {},
|
||||
"floor": {},
|
||||
"fmod": {},
|
||||
"fmodl": {},
|
||||
"fopen": {},
|
||||
"fopen64": {},
|
||||
"fork": {},
|
||||
"fprintf": {},
|
||||
"fputc": {},
|
||||
"fputs": {},
|
||||
"fread": {},
|
||||
"free": {},
|
||||
"freeaddrinfo": {},
|
||||
"frexp": {},
|
||||
"fscanf": {},
|
||||
"fseek": {},
|
||||
"fstat": {},
|
||||
"fstat64": {},
|
||||
"fsync": {},
|
||||
"ftell": {},
|
||||
"ftruncate": {},
|
||||
"fts64_close": {},
|
||||
"fts64_open": {},
|
||||
"fts64_read": {},
|
||||
"fts_close": {},
|
||||
"fts_open": {},
|
||||
"fts_read": {},
|
||||
"fwrite": {},
|
||||
"gai_strerror": {},
|
||||
"getaddrinfo": {},
|
||||
"getc": {},
|
||||
"getcwd": {},
|
||||
"getegid": {},
|
||||
"getentropy": {},
|
||||
"getenv": {},
|
||||
"geteuid": {},
|
||||
"getgid": {},
|
||||
"getgrgid": {},
|
||||
"getgrgid_r": {},
|
||||
"getgrnam": {},
|
||||
"getgrnam_r": {},
|
||||
"gethostbyaddr": {},
|
||||
"gethostbyaddr_r": {},
|
||||
"gethostbyname": {},
|
||||
"gethostbyname2": {},
|
||||
"gethostbyname2_r": {},
|
||||
"gethostname": {},
|
||||
"getnameinfo": {},
|
||||
"getpeername": {},
|
||||
"getpid": {},
|
||||
"getpwnam": {},
|
||||
"getpwnam_r": {},
|
||||
"getpwuid": {},
|
||||
"getpwuid_r": {},
|
||||
"getresgid": {},
|
||||
"getresuid": {},
|
||||
"getrlimit": {},
|
||||
"getrlimit64": {},
|
||||
"getrusage": {},
|
||||
"getservbyname": {},
|
||||
"getsockname": {},
|
||||
"getsockopt": {},
|
||||
"gettimeofday": {},
|
||||
"getuid": {},
|
||||
"gmtime_r": {},
|
||||
"h_errno": {},
|
||||
"htonl": {},
|
||||
"htons": {},
|
||||
"hypot": {},
|
||||
"inet_ntoa": {},
|
||||
"inet_ntop": {},
|
||||
"inet_pton": {},
|
||||
"initstate": {},
|
||||
"initstate_r": {},
|
||||
"ioctl": {},
|
||||
"isalnum": {},
|
||||
"isalpha": {},
|
||||
"isascii": {},
|
||||
"isatty": {},
|
||||
"isdigit": {},
|
||||
"islower": {},
|
||||
"isnan": {},
|
||||
"isnanf": {},
|
||||
"isnanl": {},
|
||||
"isprint": {},
|
||||
"isspace": {},
|
||||
"isupper": {},
|
||||
"isxdigit": {},
|
||||
"kill": {},
|
||||
"ldexp": {},
|
||||
"link": {},
|
||||
"listen": {},
|
||||
"llabs": {},
|
||||
"localtime": {},
|
||||
"localtime_r": {},
|
||||
"log": {},
|
||||
"log10": {},
|
||||
"log2": {},
|
||||
"longjmp": {},
|
||||
"lrand48": {},
|
||||
"lseek": {},
|
||||
"lseek64": {},
|
||||
"lstat": {},
|
||||
"lstat64": {},
|
||||
"malloc": {},
|
||||
"mblen": {},
|
||||
"mbstowcs": {},
|
||||
"mbtowc": {},
|
||||
"memchr": {},
|
||||
"memcmp": {},
|
||||
"memcpy": {},
|
||||
"memmove": {},
|
||||
"memset": {},
|
||||
"mkdir": {},
|
||||
"mkfifo": {},
|
||||
"mknod": {},
|
||||
"mkostemp": {},
|
||||
"mkstemp": {},
|
||||
"mkstemp64": {},
|
||||
"mkstemps": {},
|
||||
"mkstemps64": {},
|
||||
"mktime": {},
|
||||
"mmap": {},
|
||||
"modf": {},
|
||||
"munmap": {},
|
||||
"nl_langinfo": {},
|
||||
"ntohs": {},
|
||||
"obstack_free": {},
|
||||
"obstack_vprintf": {},
|
||||
"open": {},
|
||||
"open64": {},
|
||||
"opendir": {},
|
||||
"openpty": {},
|
||||
"pathconf": {},
|
||||
"pause": {},
|
||||
"pclose": {},
|
||||
"perror": {},
|
||||
"pipe": {},
|
||||
"poll": {},
|
||||
"popen": {},
|
||||
"pow": {},
|
||||
"pread": {},
|
||||
"printf": {},
|
||||
"pselect": {},
|
||||
"pthread_attr_destroy": {},
|
||||
"pthread_attr_getdetachstate": {},
|
||||
"pthread_attr_init": {},
|
||||
"pthread_attr_setdetachstate": {},
|
||||
"pthread_attr_setscope": {},
|
||||
"pthread_attr_setstacksize": {},
|
||||
"pthread_cond_broadcast": {},
|
||||
"pthread_cond_destroy": {},
|
||||
"pthread_cond_init": {},
|
||||
"pthread_cond_signal": {},
|
||||
"pthread_cond_timedwait": {},
|
||||
"pthread_cond_wait": {},
|
||||
"pthread_create": {},
|
||||
"pthread_detach": {},
|
||||
"pthread_equal": {},
|
||||
"pthread_exit": {},
|
||||
"pthread_getspecific": {},
|
||||
"pthread_join": {},
|
||||
"pthread_key_create": {},
|
||||
"pthread_key_delete": {},
|
||||
"pthread_mutex_destroy": {},
|
||||
"pthread_mutex_init": {},
|
||||
"pthread_mutex_lock": {},
|
||||
"pthread_mutex_trylock": {},
|
||||
"pthread_mutex_unlock": {},
|
||||
"pthread_mutexattr_destroy": {},
|
||||
"pthread_mutexattr_init": {},
|
||||
"pthread_mutexattr_settype": {},
|
||||
"pthread_self": {},
|
||||
"pthread_setspecific": {},
|
||||
"putc": {},
|
||||
"putchar": {},
|
||||
"puts": {},
|
||||
"qsort": {},
|
||||
"raise": {},
|
||||
"rand": {},
|
||||
"random": {},
|
||||
"random_r": {},
|
||||
"read": {},
|
||||
"readdir": {},
|
||||
"readdir64": {},
|
||||
"readlink": {},
|
||||
"readv": {},
|
||||
"realloc": {},
|
||||
"reallocarray": {},
|
||||
"realpath": {},
|
||||
"recv": {},
|
||||
"recvfrom": {},
|
||||
"recvmsg": {},
|
||||
"remove": {},
|
||||
"rename": {},
|
||||
"rewind": {},
|
||||
"rindex": {},
|
||||
"rint": {},
|
||||
"rmdir": {},
|
||||
"round": {},
|
||||
"scalbn": {},
|
||||
"scalbnl": {},
|
||||
"sched_yield": {},
|
||||
"select": {},
|
||||
"send": {},
|
||||
"sendmsg": {},
|
||||
"sendto": {},
|
||||
"setbuf": {},
|
||||
"setenv": {},
|
||||
"setjmp": {},
|
||||
"setlocale": {},
|
||||
"setrlimit": {},
|
||||
"setrlimit64": {},
|
||||
"setsid": {},
|
||||
"setsockopt": {},
|
||||
"setstate": {},
|
||||
"setvbuf": {},
|
||||
"shmat": {},
|
||||
"shmctl": {},
|
||||
"shmdt": {},
|
||||
"shutdown": {},
|
||||
"sigaction": {},
|
||||
"signal": {},
|
||||
"sin": {},
|
||||
"sinf": {},
|
||||
"sinh": {},
|
||||
"sleep": {},
|
||||
"snprintf": {},
|
||||
"socket": {},
|
||||
"sprintf": {},
|
||||
"sqrt": {},
|
||||
"srand48": {},
|
||||
"sscanf": {},
|
||||
"stat": {},
|
||||
"stat64": {},
|
||||
"stderr": {},
|
||||
"stdin": {},
|
||||
"stdout": {},
|
||||
"strcasecmp": {},
|
||||
"strcat": {},
|
||||
"strchr": {},
|
||||
"strcmp": {},
|
||||
"strcpy": {},
|
||||
"strcspn": {},
|
||||
"strdup": {},
|
||||
"strerror": {},
|
||||
"strerror_r": {},
|
||||
"strlen": {},
|
||||
"strncmp": {},
|
||||
"strncpy": {},
|
||||
"strnlen": {},
|
||||
"strpbrk": {},
|
||||
"strrchr": {},
|
||||
"strspn": {},
|
||||
"strstr": {},
|
||||
"strtod": {},
|
||||
"strtof": {},
|
||||
"strtoimax": {},
|
||||
"strtol": {},
|
||||
"strtold": {},
|
||||
"strtoll": {},
|
||||
"strtoul": {},
|
||||
"strtoull": {},
|
||||
"strtoumax": {},
|
||||
"symlink": {},
|
||||
"sysconf": {},
|
||||
"system": {},
|
||||
"tan": {},
|
||||
"tanh": {},
|
||||
"tcgetattr": {},
|
||||
"tcsendbreak": {},
|
||||
"tcsetattr": {},
|
||||
"time": {},
|
||||
"tmpfile": {},
|
||||
"tolower": {},
|
||||
"toupper": {},
|
||||
"trunc": {},
|
||||
"tzset": {},
|
||||
"umask": {},
|
||||
"uname": {},
|
||||
"ungetc": {},
|
||||
"unlink": {},
|
||||
"unsetenv": {},
|
||||
"usleep": {},
|
||||
"utime": {},
|
||||
"utimes": {},
|
||||
"uuid_generate_random": {},
|
||||
"uuid_parse": {},
|
||||
"uuid_unparse": {},
|
||||
"vasprintf": {},
|
||||
"vfprintf": {},
|
||||
"vprintf": {},
|
||||
"vsnprintf": {},
|
||||
"vsprintf": {},
|
||||
"waitpid": {},
|
||||
"wcschr": {},
|
||||
"wctomb": {},
|
||||
"wcwidth": {},
|
||||
"write": {},
|
||||
"writev": {},
|
||||
"zero_struct_address": {},
|
||||
}
|
528
vendor/modernc.org/libc/capi_illumos_amd64.go
generated
vendored
Normal file
528
vendor/modernc.org/libc/capi_illumos_amd64.go
generated
vendored
Normal file
|
@ -0,0 +1,528 @@
|
|||
// Code generated by 'go generate' - DO NOT EDIT.
|
||||
|
||||
package libc // import "modernc.org/libc"
|
||||
|
||||
var CAPI = map[string]struct{}{
|
||||
"_IO_putc": {},
|
||||
"___errno_location": {},
|
||||
"__assert_fail": {},
|
||||
"__builtin___memcpy_chk": {},
|
||||
"__builtin___memmove_chk": {},
|
||||
"__builtin___memset_chk": {},
|
||||
"__builtin___snprintf_chk": {},
|
||||
"__builtin___sprintf_chk": {},
|
||||
"__builtin___strcat_chk": {},
|
||||
"__builtin___strcpy_chk": {},
|
||||
"__builtin___strncpy_chk": {},
|
||||
"__builtin___vsnprintf_chk": {},
|
||||
"__builtin_abort": {},
|
||||
"__builtin_abs": {},
|
||||
"__builtin_add_overflowInt64": {},
|
||||
"__builtin_add_overflowUint32": {},
|
||||
"__builtin_add_overflowUint64": {},
|
||||
"__builtin_bswap16": {},
|
||||
"__builtin_bswap32": {},
|
||||
"__builtin_bswap64": {},
|
||||
"__builtin_bzero": {},
|
||||
"__builtin_clz": {},
|
||||
"__builtin_clzl": {},
|
||||
"__builtin_clzll": {},
|
||||
"__builtin_constant_p_impl": {},
|
||||
"__builtin_copysign": {},
|
||||
"__builtin_copysignf": {},
|
||||
"__builtin_copysignl": {},
|
||||
"__builtin_exit": {},
|
||||
"__builtin_expect": {},
|
||||
"__builtin_fabs": {},
|
||||
"__builtin_fabsf": {},
|
||||
"__builtin_fabsl": {},
|
||||
"__builtin_free": {},
|
||||
"__builtin_getentropy": {},
|
||||
"__builtin_huge_val": {},
|
||||
"__builtin_huge_valf": {},
|
||||
"__builtin_inf": {},
|
||||
"__builtin_inff": {},
|
||||
"__builtin_infl": {},
|
||||
"__builtin_isnan": {},
|
||||
"__builtin_isunordered": {},
|
||||
"__builtin_llabs": {},
|
||||
"__builtin_malloc": {},
|
||||
"__builtin_memcmp": {},
|
||||
"__builtin_memcpy": {},
|
||||
"__builtin_memset": {},
|
||||
"__builtin_mmap": {},
|
||||
"__builtin_mul_overflowInt64": {},
|
||||
"__builtin_mul_overflowUint128": {},
|
||||
"__builtin_mul_overflowUint64": {},
|
||||
"__builtin_nan": {},
|
||||
"__builtin_nanf": {},
|
||||
"__builtin_nanl": {},
|
||||
"__builtin_object_size": {},
|
||||
"__builtin_popcount": {},
|
||||
"__builtin_popcountl": {},
|
||||
"__builtin_prefetch": {},
|
||||
"__builtin_printf": {},
|
||||
"__builtin_snprintf": {},
|
||||
"__builtin_sprintf": {},
|
||||
"__builtin_strchr": {},
|
||||
"__builtin_strcmp": {},
|
||||
"__builtin_strcpy": {},
|
||||
"__builtin_strlen": {},
|
||||
"__builtin_sub_overflowInt64": {},
|
||||
"__builtin_trap": {},
|
||||
"__builtin_unreachable": {},
|
||||
"__ccgo_dmesg": {},
|
||||
"__ccgo_getMutexType": {},
|
||||
"__ccgo_in6addr_anyp": {},
|
||||
"__ccgo_pthreadAttrGetDetachState": {},
|
||||
"__ccgo_pthreadMutexattrGettype": {},
|
||||
"__ccgo_sqlite3_log": {},
|
||||
"__cmsg_nxthdr": {},
|
||||
"__ctype_b_loc": {},
|
||||
"__ctype_get_mb_cur_max": {},
|
||||
"__errno_location": {},
|
||||
"__floatscan": {},
|
||||
"__fpclassify": {},
|
||||
"__fpclassifyf": {},
|
||||
"__fpclassifyl": {},
|
||||
"__fsmu8": {},
|
||||
"__h_errno_location": {},
|
||||
"__inet_aton": {},
|
||||
"__intscan": {},
|
||||
"__isalnum_l": {},
|
||||
"__isalpha_l": {},
|
||||
"__isdigit_l": {},
|
||||
"__islower_l": {},
|
||||
"__isnan": {},
|
||||
"__isnanf": {},
|
||||
"__isnanl": {},
|
||||
"__isoc99_sscanf": {},
|
||||
"__isprint_l": {},
|
||||
"__isupper_l": {},
|
||||
"__isxdigit_l": {},
|
||||
"__lockfile": {},
|
||||
"__lookup_ipliteral": {},
|
||||
"__lookup_name": {},
|
||||
"__lookup_serv": {},
|
||||
"__shgetc": {},
|
||||
"__shlim": {},
|
||||
"__strncasecmp_l": {},
|
||||
"__sync_add_and_fetch_uint32": {},
|
||||
"__sync_sub_and_fetch_uint32": {},
|
||||
"__syscall1": {},
|
||||
"__syscall3": {},
|
||||
"__syscall4": {},
|
||||
"__toread": {},
|
||||
"__toread_needs_stdio_exit": {},
|
||||
"__uflow": {},
|
||||
"__unlockfile": {},
|
||||
"_exit": {},
|
||||
"_longjmp": {},
|
||||
"_obstack_begin": {},
|
||||
"_obstack_newchunk": {},
|
||||
"_setjmp": {},
|
||||
"abort": {},
|
||||
"abs": {},
|
||||
"accept": {},
|
||||
"access": {},
|
||||
"acos": {},
|
||||
"acosh": {},
|
||||
"alarm": {},
|
||||
"asin": {},
|
||||
"asinh": {},
|
||||
"atan": {},
|
||||
"atan2": {},
|
||||
"atanh": {},
|
||||
"atexit": {},
|
||||
"atof": {},
|
||||
"atoi": {},
|
||||
"atol": {},
|
||||
"backtrace": {},
|
||||
"backtrace_symbols_fd": {},
|
||||
"bind": {},
|
||||
"bsearch": {},
|
||||
"bzero": {},
|
||||
"calloc": {},
|
||||
"ceil": {},
|
||||
"ceilf": {},
|
||||
"cfgetospeed": {},
|
||||
"cfsetispeed": {},
|
||||
"cfsetospeed": {},
|
||||
"chdir": {},
|
||||
"chmod": {},
|
||||
"chown": {},
|
||||
"clock_gettime": {},
|
||||
"close": {},
|
||||
"closedir": {},
|
||||
"confstr": {},
|
||||
"connect": {},
|
||||
"copysign": {},
|
||||
"copysignf": {},
|
||||
"copysignl": {},
|
||||
"cos": {},
|
||||
"cosf": {},
|
||||
"cosh": {},
|
||||
"ctime": {},
|
||||
"ctime_r": {},
|
||||
"dlclose": {},
|
||||
"dlerror": {},
|
||||
"dlopen": {},
|
||||
"dlsym": {},
|
||||
"dup2": {},
|
||||
"dup3": {},
|
||||
"endpwent": {},
|
||||
"environ": {},
|
||||
"execvp": {},
|
||||
"exit": {},
|
||||
"exp": {},
|
||||
"fabs": {},
|
||||
"fabsf": {},
|
||||
"fabsl": {},
|
||||
"faccessat": {},
|
||||
"fchmod": {},
|
||||
"fchmodat": {},
|
||||
"fchown": {},
|
||||
"fchownat": {},
|
||||
"fclose": {},
|
||||
"fcntl": {},
|
||||
"fcntl64": {},
|
||||
"fdopen": {},
|
||||
"ferror": {},
|
||||
"fflush": {},
|
||||
"fgetc": {},
|
||||
"fgets": {},
|
||||
"fileno": {},
|
||||
"floor": {},
|
||||
"fmod": {},
|
||||
"fmodl": {},
|
||||
"fopen": {},
|
||||
"fopen64": {},
|
||||
"fork": {},
|
||||
"fprintf": {},
|
||||
"fputc": {},
|
||||
"fputs": {},
|
||||
"fread": {},
|
||||
"free": {},
|
||||
"freeaddrinfo": {},
|
||||
"frexp": {},
|
||||
"fscanf": {},
|
||||
"fseek": {},
|
||||
"fstat": {},
|
||||
"fstat64": {},
|
||||
"fstatfs": {},
|
||||
"fsync": {},
|
||||
"ftell": {},
|
||||
"ftruncate": {},
|
||||
"ftruncate64": {},
|
||||
"fts64_close": {},
|
||||
"fts64_open": {},
|
||||
"fts64_read": {},
|
||||
"fts_close": {},
|
||||
"fts_open": {},
|
||||
"fts_read": {},
|
||||
"fwrite": {},
|
||||
"gai_strerror": {},
|
||||
"getaddrinfo": {},
|
||||
"getc": {},
|
||||
"getcwd": {},
|
||||
"getegid": {},
|
||||
"getentropy": {},
|
||||
"getenv": {},
|
||||
"geteuid": {},
|
||||
"getgid": {},
|
||||
"getgrgid": {},
|
||||
"getgrgid_r": {},
|
||||
"getgrnam": {},
|
||||
"getgrnam_r": {},
|
||||
"gethostbyaddr": {},
|
||||
"gethostbyaddr_r": {},
|
||||
"gethostbyname": {},
|
||||
"gethostbyname2": {},
|
||||
"gethostbyname2_r": {},
|
||||
"gethostbyname_r": {},
|
||||
"gethostname": {},
|
||||
"getnameinfo": {},
|
||||
"getpeername": {},
|
||||
"getpid": {},
|
||||
"getpwnam": {},
|
||||
"getpwnam_r": {},
|
||||
"getpwuid": {},
|
||||
"getpwuid_r": {},
|
||||
"getrandom": {},
|
||||
"getresgid": {},
|
||||
"getresuid": {},
|
||||
"getrlimit": {},
|
||||
"getrlimit64": {},
|
||||
"getrusage": {},
|
||||
"getservbyname": {},
|
||||
"getsockname": {},
|
||||
"getsockopt": {},
|
||||
"gettimeofday": {},
|
||||
"getuid": {},
|
||||
"gmtime_r": {},
|
||||
"h_errno": {},
|
||||
"htonl": {},
|
||||
"htons": {},
|
||||
"hypot": {},
|
||||
"inet_ntoa": {},
|
||||
"inet_ntop": {},
|
||||
"inet_pton": {},
|
||||
"initstate": {},
|
||||
"initstate_r": {},
|
||||
"ioctl": {},
|
||||
"isalnum": {},
|
||||
"isalpha": {},
|
||||
"isascii": {},
|
||||
"isatty": {},
|
||||
"isdigit": {},
|
||||
"islower": {},
|
||||
"isnan": {},
|
||||
"isnanf": {},
|
||||
"isnanl": {},
|
||||
"isprint": {},
|
||||
"isupper": {},
|
||||
"iswalnum": {},
|
||||
"iswspace": {},
|
||||
"isxdigit": {},
|
||||
"kill": {},
|
||||
"ldexp": {},
|
||||
"link": {},
|
||||
"linkat": {},
|
||||
"listen": {},
|
||||
"llabs": {},
|
||||
"localeconv": {},
|
||||
"localtime": {},
|
||||
"localtime_r": {},
|
||||
"log": {},
|
||||
"log10": {},
|
||||
"log2": {},
|
||||
"longjmp": {},
|
||||
"lrand48": {},
|
||||
"lseek": {},
|
||||
"lseek64": {},
|
||||
"lstat": {},
|
||||
"lstat64": {},
|
||||
"malloc": {},
|
||||
"mblen": {},
|
||||
"mbrtowc": {},
|
||||
"mbsinit": {},
|
||||
"mbstowcs": {},
|
||||
"mbtowc": {},
|
||||
"memchr": {},
|
||||
"memcmp": {},
|
||||
"memcpy": {},
|
||||
"memmove": {},
|
||||
"memset": {},
|
||||
"mkdir": {},
|
||||
"mkdirat": {},
|
||||
"mkfifo": {},
|
||||
"mknod": {},
|
||||
"mknodat": {},
|
||||
"mkostemp": {},
|
||||
"mkstemp": {},
|
||||
"mkstemp64": {},
|
||||
"mkstemps": {},
|
||||
"mkstemps64": {},
|
||||
"mktime": {},
|
||||
"mmap": {},
|
||||
"mmap64": {},
|
||||
"modf": {},
|
||||
"mremap": {},
|
||||
"munmap": {},
|
||||
"nanf": {},
|
||||
"nanosleep": {},
|
||||
"nl_langinfo": {},
|
||||
"ntohs": {},
|
||||
"obstack_free": {},
|
||||
"obstack_vprintf": {},
|
||||
"open": {},
|
||||
"open64": {},
|
||||
"openat": {},
|
||||
"opendir": {},
|
||||
"openpty": {},
|
||||
"pathconf": {},
|
||||
"pause": {},
|
||||
"pclose": {},
|
||||
"perror": {},
|
||||
"pipe": {},
|
||||
"pipe2": {},
|
||||
"poll": {},
|
||||
"popen": {},
|
||||
"posix_fadvise": {},
|
||||
"pow": {},
|
||||
"pread": {},
|
||||
"printf": {},
|
||||
"pselect": {},
|
||||
"pthread_attr_destroy": {},
|
||||
"pthread_attr_getdetachstate": {},
|
||||
"pthread_attr_init": {},
|
||||
"pthread_attr_setdetachstate": {},
|
||||
"pthread_attr_setscope": {},
|
||||
"pthread_attr_setstacksize": {},
|
||||
"pthread_cond_broadcast": {},
|
||||
"pthread_cond_destroy": {},
|
||||
"pthread_cond_init": {},
|
||||
"pthread_cond_signal": {},
|
||||
"pthread_cond_timedwait": {},
|
||||
"pthread_cond_wait": {},
|
||||
"pthread_create": {},
|
||||
"pthread_detach": {},
|
||||
"pthread_equal": {},
|
||||
"pthread_exit": {},
|
||||
"pthread_getspecific": {},
|
||||
"pthread_join": {},
|
||||
"pthread_key_create": {},
|
||||
"pthread_key_delete": {},
|
||||
"pthread_mutex_destroy": {},
|
||||
"pthread_mutex_init": {},
|
||||
"pthread_mutex_lock": {},
|
||||
"pthread_mutex_trylock": {},
|
||||
"pthread_mutex_unlock": {},
|
||||
"pthread_mutexattr_destroy": {},
|
||||
"pthread_mutexattr_init": {},
|
||||
"pthread_mutexattr_settype": {},
|
||||
"pthread_self": {},
|
||||
"pthread_setspecific": {},
|
||||
"putc": {},
|
||||
"putchar": {},
|
||||
"puts": {},
|
||||
"pwrite": {},
|
||||
"qsort": {},
|
||||
"raise": {},
|
||||
"rand": {},
|
||||
"rand_r": {},
|
||||
"random": {},
|
||||
"random_r": {},
|
||||
"read": {},
|
||||
"readdir": {},
|
||||
"readdir64": {},
|
||||
"readlink": {},
|
||||
"readlinkat": {},
|
||||
"readv": {},
|
||||
"realloc": {},
|
||||
"reallocarray": {},
|
||||
"realpath": {},
|
||||
"recv": {},
|
||||
"recvfrom": {},
|
||||
"recvmsg": {},
|
||||
"remove": {},
|
||||
"rename": {},
|
||||
"renameat2": {},
|
||||
"rewind": {},
|
||||
"rindex": {},
|
||||
"rint": {},
|
||||
"rmdir": {},
|
||||
"round": {},
|
||||
"scalbn": {},
|
||||
"scalbnl": {},
|
||||
"sched_yield": {},
|
||||
"select": {},
|
||||
"send": {},
|
||||
"sendmsg": {},
|
||||
"sendto": {},
|
||||
"setbuf": {},
|
||||
"setenv": {},
|
||||
"setjmp": {},
|
||||
"setlocale": {},
|
||||
"setrlimit": {},
|
||||
"setrlimit64": {},
|
||||
"setsid": {},
|
||||
"setsockopt": {},
|
||||
"setstate": {},
|
||||
"setvbuf": {},
|
||||
"shmat": {},
|
||||
"shmctl": {},
|
||||
"shmdt": {},
|
||||
"shutdown": {},
|
||||
"sigaction": {},
|
||||
"signal": {},
|
||||
"sin": {},
|
||||
"sinf": {},
|
||||
"sinh": {},
|
||||
"sleep": {},
|
||||
"snprintf": {},
|
||||
"socket": {},
|
||||
"sprintf": {},
|
||||
"sqrt": {},
|
||||
"srand48": {},
|
||||
"sscanf": {},
|
||||
"stat": {},
|
||||
"stat64": {},
|
||||
"stderr": {},
|
||||
"stdin": {},
|
||||
"stdout": {},
|
||||
"strcasecmp": {},
|
||||
"strcat": {},
|
||||
"strchr": {},
|
||||
"strcmp": {},
|
||||
"strcpy": {},
|
||||
"strcspn": {},
|
||||
"strdup": {},
|
||||
"strerror": {},
|
||||
"strerror_r": {},
|
||||
"strlcat": {},
|
||||
"strlcpy": {},
|
||||
"strlen": {},
|
||||
"strncasecmp": {},
|
||||
"strncat": {},
|
||||
"strncmp": {},
|
||||
"strncpy": {},
|
||||
"strnlen": {},
|
||||
"strpbrk": {},
|
||||
"strrchr": {},
|
||||
"strspn": {},
|
||||
"strstr": {},
|
||||
"strtod": {},
|
||||
"strtof": {},
|
||||
"strtoimax": {},
|
||||
"strtok": {},
|
||||
"strtol": {},
|
||||
"strtold": {},
|
||||
"strtoll": {},
|
||||
"strtoul": {},
|
||||
"strtoull": {},
|
||||
"strtoumax": {},
|
||||
"symlink": {},
|
||||
"symlinkat": {},
|
||||
"sysconf": {},
|
||||
"system": {},
|
||||
"tan": {},
|
||||
"tanh": {},
|
||||
"tcgetattr": {},
|
||||
"tcsendbreak": {},
|
||||
"tcsetattr": {},
|
||||
"time": {},
|
||||
"tmpfile": {},
|
||||
"tolower": {},
|
||||
"toupper": {},
|
||||
"trunc": {},
|
||||
"tzset": {},
|
||||
"umask": {},
|
||||
"uname": {},
|
||||
"ungetc": {},
|
||||
"unlink": {},
|
||||
"unlinkat": {},
|
||||
"unsetenv": {},
|
||||
"usleep": {},
|
||||
"utime": {},
|
||||
"utimensat": {},
|
||||
"utimes": {},
|
||||
"uuid_copy": {},
|
||||
"uuid_generate_random": {},
|
||||
"uuid_parse": {},
|
||||
"uuid_unparse": {},
|
||||
"vasprintf": {},
|
||||
"vfprintf": {},
|
||||
"vfscanf": {},
|
||||
"vprintf": {},
|
||||
"vsnprintf": {},
|
||||
"vsprintf": {},
|
||||
"vsscanf": {},
|
||||
"waitpid": {},
|
||||
"wcschr": {},
|
||||
"wctomb": {},
|
||||
"wcwidth": {},
|
||||
"write": {},
|
||||
"writev": {},
|
||||
"zero_struct_address": {},
|
||||
}
|
512
vendor/modernc.org/libc/capi_linux_386.go
generated
vendored
Normal file
512
vendor/modernc.org/libc/capi_linux_386.go
generated
vendored
Normal file
|
@ -0,0 +1,512 @@
|
|||
// Code generated by 'go generate' - DO NOT EDIT.
|
||||
|
||||
package libc // import "modernc.org/libc"
|
||||
|
||||
var CAPI = map[string]struct{}{
|
||||
"_IO_putc": {},
|
||||
"___errno_location": {},
|
||||
"__assert_fail": {},
|
||||
"__builtin___memcpy_chk": {},
|
||||
"__builtin___memmove_chk": {},
|
||||
"__builtin___memset_chk": {},
|
||||
"__builtin___snprintf_chk": {},
|
||||
"__builtin___sprintf_chk": {},
|
||||
"__builtin___strcat_chk": {},
|
||||
"__builtin___strcpy_chk": {},
|
||||
"__builtin___strncpy_chk": {},
|
||||
"__builtin___vsnprintf_chk": {},
|
||||
"__builtin_abort": {},
|
||||
"__builtin_abs": {},
|
||||
"__builtin_add_overflowInt64": {},
|
||||
"__builtin_add_overflowUint32": {},
|
||||
"__builtin_add_overflowUint64": {},
|
||||
"__builtin_bswap16": {},
|
||||
"__builtin_bswap32": {},
|
||||
"__builtin_bswap64": {},
|
||||
"__builtin_bzero": {},
|
||||
"__builtin_clz": {},
|
||||
"__builtin_clzl": {},
|
||||
"__builtin_clzll": {},
|
||||
"__builtin_constant_p_impl": {},
|
||||
"__builtin_copysign": {},
|
||||
"__builtin_copysignf": {},
|
||||
"__builtin_copysignl": {},
|
||||
"__builtin_exit": {},
|
||||
"__builtin_expect": {},
|
||||
"__builtin_fabs": {},
|
||||
"__builtin_fabsf": {},
|
||||
"__builtin_fabsl": {},
|
||||
"__builtin_free": {},
|
||||
"__builtin_getentropy": {},
|
||||
"__builtin_huge_val": {},
|
||||
"__builtin_huge_valf": {},
|
||||
"__builtin_inf": {},
|
||||
"__builtin_inff": {},
|
||||
"__builtin_infl": {},
|
||||
"__builtin_isnan": {},
|
||||
"__builtin_isunordered": {},
|
||||
"__builtin_llabs": {},
|
||||
"__builtin_malloc": {},
|
||||
"__builtin_memcmp": {},
|
||||
"__builtin_memcpy": {},
|
||||
"__builtin_memset": {},
|
||||
"__builtin_mmap": {},
|
||||
"__builtin_mul_overflowInt64": {},
|
||||
"__builtin_mul_overflowUint128": {},
|
||||
"__builtin_mul_overflowUint64": {},
|
||||
"__builtin_nan": {},
|
||||
"__builtin_nanf": {},
|
||||
"__builtin_nanl": {},
|
||||
"__builtin_object_size": {},
|
||||
"__builtin_popcount": {},
|
||||
"__builtin_popcountl": {},
|
||||
"__builtin_prefetch": {},
|
||||
"__builtin_printf": {},
|
||||
"__builtin_snprintf": {},
|
||||
"__builtin_sprintf": {},
|
||||
"__builtin_strchr": {},
|
||||
"__builtin_strcmp": {},
|
||||
"__builtin_strcpy": {},
|
||||
"__builtin_strlen": {},
|
||||
"__builtin_sub_overflowInt64": {},
|
||||
"__builtin_trap": {},
|
||||
"__builtin_unreachable": {},
|
||||
"__ccgo_dmesg": {},
|
||||
"__ccgo_getMutexType": {},
|
||||
"__ccgo_in6addr_anyp": {},
|
||||
"__ccgo_pthreadAttrGetDetachState": {},
|
||||
"__ccgo_pthreadMutexattrGettype": {},
|
||||
"__ccgo_sqlite3_log": {},
|
||||
"__cmsg_nxthdr": {},
|
||||
"__ctype_b_loc": {},
|
||||
"__ctype_get_mb_cur_max": {},
|
||||
"__errno_location": {},
|
||||
"__floatscan": {},
|
||||
"__fpclassify": {},
|
||||
"__fpclassifyf": {},
|
||||
"__fpclassifyl": {},
|
||||
"__fsmu8": {},
|
||||
"__h_errno_location": {},
|
||||
"__inet_aton": {},
|
||||
"__intscan": {},
|
||||
"__isalnum_l": {},
|
||||
"__isalpha_l": {},
|
||||
"__isdigit_l": {},
|
||||
"__islower_l": {},
|
||||
"__isnan": {},
|
||||
"__isnanf": {},
|
||||
"__isnanl": {},
|
||||
"__isoc99_sscanf": {},
|
||||
"__isprint_l": {},
|
||||
"__isupper_l": {},
|
||||
"__isxdigit_l": {},
|
||||
"__lockfile": {},
|
||||
"__lookup_ipliteral": {},
|
||||
"__lookup_name": {},
|
||||
"__lookup_serv": {},
|
||||
"__shgetc": {},
|
||||
"__shlim": {},
|
||||
"__strncasecmp_l": {},
|
||||
"__sync_add_and_fetch_uint32": {},
|
||||
"__sync_sub_and_fetch_uint32": {},
|
||||
"__syscall1": {},
|
||||
"__syscall3": {},
|
||||
"__syscall4": {},
|
||||
"__toread": {},
|
||||
"__toread_needs_stdio_exit": {},
|
||||
"__uflow": {},
|
||||
"__unlockfile": {},
|
||||
"_exit": {},
|
||||
"_longjmp": {},
|
||||
"_obstack_begin": {},
|
||||
"_obstack_newchunk": {},
|
||||
"_setjmp": {},
|
||||
"abort": {},
|
||||
"abs": {},
|
||||
"accept": {},
|
||||
"access": {},
|
||||
"acos": {},
|
||||
"acosh": {},
|
||||
"alarm": {},
|
||||
"asin": {},
|
||||
"asinh": {},
|
||||
"atan": {},
|
||||
"atan2": {},
|
||||
"atanh": {},
|
||||
"atexit": {},
|
||||
"atof": {},
|
||||
"atoi": {},
|
||||
"atol": {},
|
||||
"backtrace": {},
|
||||
"backtrace_symbols_fd": {},
|
||||
"bind": {},
|
||||
"bsearch": {},
|
||||
"bzero": {},
|
||||
"calloc": {},
|
||||
"ceil": {},
|
||||
"ceilf": {},
|
||||
"cfgetospeed": {},
|
||||
"cfsetispeed": {},
|
||||
"cfsetospeed": {},
|
||||
"chdir": {},
|
||||
"chmod": {},
|
||||
"chown": {},
|
||||
"clock_gettime": {},
|
||||
"close": {},
|
||||
"closedir": {},
|
||||
"confstr": {},
|
||||
"connect": {},
|
||||
"copysign": {},
|
||||
"copysignf": {},
|
||||
"copysignl": {},
|
||||
"cos": {},
|
||||
"cosf": {},
|
||||
"cosh": {},
|
||||
"ctime": {},
|
||||
"ctime_r": {},
|
||||
"dlclose": {},
|
||||
"dlerror": {},
|
||||
"dlopen": {},
|
||||
"dlsym": {},
|
||||
"dup2": {},
|
||||
"endpwent": {},
|
||||
"environ": {},
|
||||
"execvp": {},
|
||||
"exit": {},
|
||||
"exp": {},
|
||||
"fabs": {},
|
||||
"fabsf": {},
|
||||
"fabsl": {},
|
||||
"fchmod": {},
|
||||
"fchown": {},
|
||||
"fclose": {},
|
||||
"fcntl": {},
|
||||
"fcntl64": {},
|
||||
"fdopen": {},
|
||||
"ferror": {},
|
||||
"fflush": {},
|
||||
"fgetc": {},
|
||||
"fgets": {},
|
||||
"fileno": {},
|
||||
"floor": {},
|
||||
"fmod": {},
|
||||
"fmodl": {},
|
||||
"fopen": {},
|
||||
"fopen64": {},
|
||||
"fork": {},
|
||||
"fprintf": {},
|
||||
"fputc": {},
|
||||
"fputs": {},
|
||||
"fread": {},
|
||||
"free": {},
|
||||
"freeaddrinfo": {},
|
||||
"frexp": {},
|
||||
"fscanf": {},
|
||||
"fseek": {},
|
||||
"fstat": {},
|
||||
"fstat64": {},
|
||||
"fstatfs": {},
|
||||
"fsync": {},
|
||||
"ftell": {},
|
||||
"ftruncate": {},
|
||||
"ftruncate64": {},
|
||||
"fts64_close": {},
|
||||
"fts64_open": {},
|
||||
"fts64_read": {},
|
||||
"fts_close": {},
|
||||
"fts_open": {},
|
||||
"fts_read": {},
|
||||
"fwrite": {},
|
||||
"gai_strerror": {},
|
||||
"getaddrinfo": {},
|
||||
"getc": {},
|
||||
"getcwd": {},
|
||||
"getegid": {},
|
||||
"getentropy": {},
|
||||
"getenv": {},
|
||||
"geteuid": {},
|
||||
"getgid": {},
|
||||
"getgrgid": {},
|
||||
"getgrgid_r": {},
|
||||
"getgrnam": {},
|
||||
"getgrnam_r": {},
|
||||
"gethostbyaddr": {},
|
||||
"gethostbyaddr_r": {},
|
||||
"gethostbyname": {},
|
||||
"gethostbyname2": {},
|
||||
"gethostbyname2_r": {},
|
||||
"gethostbyname_r": {},
|
||||
"gethostname": {},
|
||||
"getnameinfo": {},
|
||||
"getpeername": {},
|
||||
"getpid": {},
|
||||
"getpwnam": {},
|
||||
"getpwnam_r": {},
|
||||
"getpwuid": {},
|
||||
"getpwuid_r": {},
|
||||
"getrandom": {},
|
||||
"getresgid": {},
|
||||
"getresuid": {},
|
||||
"getrlimit": {},
|
||||
"getrlimit64": {},
|
||||
"getrusage": {},
|
||||
"getservbyname": {},
|
||||
"getsockname": {},
|
||||
"getsockopt": {},
|
||||
"gettimeofday": {},
|
||||
"getuid": {},
|
||||
"gmtime_r": {},
|
||||
"h_errno": {},
|
||||
"htonl": {},
|
||||
"htons": {},
|
||||
"hypot": {},
|
||||
"inet_ntoa": {},
|
||||
"inet_ntop": {},
|
||||
"inet_pton": {},
|
||||
"initstate": {},
|
||||
"initstate_r": {},
|
||||
"ioctl": {},
|
||||
"isalnum": {},
|
||||
"isalpha": {},
|
||||
"isascii": {},
|
||||
"isatty": {},
|
||||
"isdigit": {},
|
||||
"islower": {},
|
||||
"isnan": {},
|
||||
"isnanf": {},
|
||||
"isnanl": {},
|
||||
"isprint": {},
|
||||
"isupper": {},
|
||||
"isxdigit": {},
|
||||
"kill": {},
|
||||
"ldexp": {},
|
||||
"link": {},
|
||||
"listen": {},
|
||||
"llabs": {},
|
||||
"localeconv": {},
|
||||
"localtime": {},
|
||||
"localtime_r": {},
|
||||
"log": {},
|
||||
"log10": {},
|
||||
"log2": {},
|
||||
"longjmp": {},
|
||||
"lrand48": {},
|
||||
"lseek": {},
|
||||
"lseek64": {},
|
||||
"lstat": {},
|
||||
"lstat64": {},
|
||||
"malloc": {},
|
||||
"mblen": {},
|
||||
"mbrtowc": {},
|
||||
"mbsinit": {},
|
||||
"mbstowcs": {},
|
||||
"mbtowc": {},
|
||||
"memchr": {},
|
||||
"memcmp": {},
|
||||
"memcpy": {},
|
||||
"memmove": {},
|
||||
"memset": {},
|
||||
"mkdir": {},
|
||||
"mkfifo": {},
|
||||
"mknod": {},
|
||||
"mkostemp": {},
|
||||
"mkstemp": {},
|
||||
"mkstemp64": {},
|
||||
"mkstemps": {},
|
||||
"mkstemps64": {},
|
||||
"mktime": {},
|
||||
"mmap": {},
|
||||
"mmap64": {},
|
||||
"modf": {},
|
||||
"mremap": {},
|
||||
"munmap": {},
|
||||
"nanf": {},
|
||||
"nanosleep": {},
|
||||
"nl_langinfo": {},
|
||||
"ntohs": {},
|
||||
"obstack_free": {},
|
||||
"obstack_vprintf": {},
|
||||
"open": {},
|
||||
"open64": {},
|
||||
"opendir": {},
|
||||
"openpty": {},
|
||||
"pathconf": {},
|
||||
"pause": {},
|
||||
"pclose": {},
|
||||
"perror": {},
|
||||
"pipe": {},
|
||||
"poll": {},
|
||||
"popen": {},
|
||||
"posix_fadvise": {},
|
||||
"pow": {},
|
||||
"pread": {},
|
||||
"printf": {},
|
||||
"pselect": {},
|
||||
"pthread_attr_destroy": {},
|
||||
"pthread_attr_getdetachstate": {},
|
||||
"pthread_attr_init": {},
|
||||
"pthread_attr_setdetachstate": {},
|
||||
"pthread_attr_setscope": {},
|
||||
"pthread_attr_setstacksize": {},
|
||||
"pthread_cond_broadcast": {},
|
||||
"pthread_cond_destroy": {},
|
||||
"pthread_cond_init": {},
|
||||
"pthread_cond_signal": {},
|
||||
"pthread_cond_timedwait": {},
|
||||
"pthread_cond_wait": {},
|
||||
"pthread_create": {},
|
||||
"pthread_detach": {},
|
||||
"pthread_equal": {},
|
||||
"pthread_exit": {},
|
||||
"pthread_getspecific": {},
|
||||
"pthread_join": {},
|
||||
"pthread_key_create": {},
|
||||
"pthread_key_delete": {},
|
||||
"pthread_mutex_destroy": {},
|
||||
"pthread_mutex_init": {},
|
||||
"pthread_mutex_lock": {},
|
||||
"pthread_mutex_trylock": {},
|
||||
"pthread_mutex_unlock": {},
|
||||
"pthread_mutexattr_destroy": {},
|
||||
"pthread_mutexattr_init": {},
|
||||
"pthread_mutexattr_settype": {},
|
||||
"pthread_self": {},
|
||||
"pthread_setspecific": {},
|
||||
"putc": {},
|
||||
"putchar": {},
|
||||
"puts": {},
|
||||
"pwrite": {},
|
||||
"qsort": {},
|
||||
"raise": {},
|
||||
"rand": {},
|
||||
"rand_r": {},
|
||||
"random": {},
|
||||
"random_r": {},
|
||||
"read": {},
|
||||
"readdir": {},
|
||||
"readdir64": {},
|
||||
"readlink": {},
|
||||
"readv": {},
|
||||
"realloc": {},
|
||||
"reallocarray": {},
|
||||
"realpath": {},
|
||||
"recv": {},
|
||||
"recvfrom": {},
|
||||
"recvmsg": {},
|
||||
"remove": {},
|
||||
"rename": {},
|
||||
"rewind": {},
|
||||
"rindex": {},
|
||||
"rint": {},
|
||||
"rmdir": {},
|
||||
"round": {},
|
||||
"scalbn": {},
|
||||
"scalbnl": {},
|
||||
"sched_yield": {},
|
||||
"select": {},
|
||||
"send": {},
|
||||
"sendmsg": {},
|
||||
"sendto": {},
|
||||
"setbuf": {},
|
||||
"setenv": {},
|
||||
"setjmp": {},
|
||||
"setlocale": {},
|
||||
"setrlimit": {},
|
||||
"setrlimit64": {},
|
||||
"setsid": {},
|
||||
"setsockopt": {},
|
||||
"setstate": {},
|
||||
"setvbuf": {},
|
||||
"shmat": {},
|
||||
"shmctl": {},
|
||||
"shmdt": {},
|
||||
"shutdown": {},
|
||||
"sigaction": {},
|
||||
"signal": {},
|
||||
"sin": {},
|
||||
"sinf": {},
|
||||
"sinh": {},
|
||||
"sleep": {},
|
||||
"snprintf": {},
|
||||
"socket": {},
|
||||
"sprintf": {},
|
||||
"sqrt": {},
|
||||
"srand48": {},
|
||||
"sscanf": {},
|
||||
"stat": {},
|
||||
"stat64": {},
|
||||
"stderr": {},
|
||||
"stdin": {},
|
||||
"stdout": {},
|
||||
"strcasecmp": {},
|
||||
"strcat": {},
|
||||
"strchr": {},
|
||||
"strcmp": {},
|
||||
"strcpy": {},
|
||||
"strcspn": {},
|
||||
"strdup": {},
|
||||
"strerror": {},
|
||||
"strerror_r": {},
|
||||
"strlcat": {},
|
||||
"strlcpy": {},
|
||||
"strlen": {},
|
||||
"strncasecmp": {},
|
||||
"strncat": {},
|
||||
"strncmp": {},
|
||||
"strncpy": {},
|
||||
"strnlen": {},
|
||||
"strpbrk": {},
|
||||
"strrchr": {},
|
||||
"strspn": {},
|
||||
"strstr": {},
|
||||
"strtod": {},
|
||||
"strtof": {},
|
||||
"strtoimax": {},
|
||||
"strtok": {},
|
||||
"strtol": {},
|
||||
"strtold": {},
|
||||
"strtoll": {},
|
||||
"strtoul": {},
|
||||
"strtoull": {},
|
||||
"strtoumax": {},
|
||||
"symlink": {},
|
||||
"sysconf": {},
|
||||
"system": {},
|
||||
"tan": {},
|
||||
"tanh": {},
|
||||
"tcgetattr": {},
|
||||
"tcsendbreak": {},
|
||||
"tcsetattr": {},
|
||||
"time": {},
|
||||
"tmpfile": {},
|
||||
"tolower": {},
|
||||
"toupper": {},
|
||||
"trunc": {},
|
||||
"tzset": {},
|
||||
"umask": {},
|
||||
"uname": {},
|
||||
"ungetc": {},
|
||||
"unlink": {},
|
||||
"unsetenv": {},
|
||||
"usleep": {},
|
||||
"utime": {},
|
||||
"utimes": {},
|
||||
"uuid_copy": {},
|
||||
"uuid_generate_random": {},
|
||||
"uuid_parse": {},
|
||||
"uuid_unparse": {},
|
||||
"vasprintf": {},
|
||||
"vfprintf": {},
|
||||
"vfscanf": {},
|
||||
"vprintf": {},
|
||||
"vsnprintf": {},
|
||||
"vsprintf": {},
|
||||
"vsscanf": {},
|
||||
"waitpid": {},
|
||||
"wcschr": {},
|
||||
"wctomb": {},
|
||||
"wcwidth": {},
|
||||
"write": {},
|
||||
"writev": {},
|
||||
"zero_struct_address": {},
|
||||
}
|
528
vendor/modernc.org/libc/capi_linux_amd64.go
generated
vendored
Normal file
528
vendor/modernc.org/libc/capi_linux_amd64.go
generated
vendored
Normal file
|
@ -0,0 +1,528 @@
|
|||
// Code generated by 'go generate' - DO NOT EDIT.
|
||||
|
||||
package libc // import "modernc.org/libc"
|
||||
|
||||
var CAPI = map[string]struct{}{
|
||||
"_IO_putc": {},
|
||||
"___errno_location": {},
|
||||
"__assert_fail": {},
|
||||
"__builtin___memcpy_chk": {},
|
||||
"__builtin___memmove_chk": {},
|
||||
"__builtin___memset_chk": {},
|
||||
"__builtin___snprintf_chk": {},
|
||||
"__builtin___sprintf_chk": {},
|
||||
"__builtin___strcat_chk": {},
|
||||
"__builtin___strcpy_chk": {},
|
||||
"__builtin___strncpy_chk": {},
|
||||
"__builtin___vsnprintf_chk": {},
|
||||
"__builtin_abort": {},
|
||||
"__builtin_abs": {},
|
||||
"__builtin_add_overflowInt64": {},
|
||||
"__builtin_add_overflowUint32": {},
|
||||
"__builtin_add_overflowUint64": {},
|
||||
"__builtin_bswap16": {},
|
||||
"__builtin_bswap32": {},
|
||||
"__builtin_bswap64": {},
|
||||
"__builtin_bzero": {},
|
||||
"__builtin_clz": {},
|
||||
"__builtin_clzl": {},
|
||||
"__builtin_clzll": {},
|
||||
"__builtin_constant_p_impl": {},
|
||||
"__builtin_copysign": {},
|
||||
"__builtin_copysignf": {},
|
||||
"__builtin_copysignl": {},
|
||||
"__builtin_exit": {},
|
||||
"__builtin_expect": {},
|
||||
"__builtin_fabs": {},
|
||||
"__builtin_fabsf": {},
|
||||
"__builtin_fabsl": {},
|
||||
"__builtin_free": {},
|
||||
"__builtin_getentropy": {},
|
||||
"__builtin_huge_val": {},
|
||||
"__builtin_huge_valf": {},
|
||||
"__builtin_inf": {},
|
||||
"__builtin_inff": {},
|
||||
"__builtin_infl": {},
|
||||
"__builtin_isnan": {},
|
||||
"__builtin_isunordered": {},
|
||||
"__builtin_llabs": {},
|
||||
"__builtin_malloc": {},
|
||||
"__builtin_memcmp": {},
|
||||
"__builtin_memcpy": {},
|
||||
"__builtin_memset": {},
|
||||
"__builtin_mmap": {},
|
||||
"__builtin_mul_overflowInt64": {},
|
||||
"__builtin_mul_overflowUint128": {},
|
||||
"__builtin_mul_overflowUint64": {},
|
||||
"__builtin_nan": {},
|
||||
"__builtin_nanf": {},
|
||||
"__builtin_nanl": {},
|
||||
"__builtin_object_size": {},
|
||||
"__builtin_popcount": {},
|
||||
"__builtin_popcountl": {},
|
||||
"__builtin_prefetch": {},
|
||||
"__builtin_printf": {},
|
||||
"__builtin_snprintf": {},
|
||||
"__builtin_sprintf": {},
|
||||
"__builtin_strchr": {},
|
||||
"__builtin_strcmp": {},
|
||||
"__builtin_strcpy": {},
|
||||
"__builtin_strlen": {},
|
||||
"__builtin_sub_overflowInt64": {},
|
||||
"__builtin_trap": {},
|
||||
"__builtin_unreachable": {},
|
||||
"__ccgo_dmesg": {},
|
||||
"__ccgo_getMutexType": {},
|
||||
"__ccgo_in6addr_anyp": {},
|
||||
"__ccgo_pthreadAttrGetDetachState": {},
|
||||
"__ccgo_pthreadMutexattrGettype": {},
|
||||
"__ccgo_sqlite3_log": {},
|
||||
"__cmsg_nxthdr": {},
|
||||
"__ctype_b_loc": {},
|
||||
"__ctype_get_mb_cur_max": {},
|
||||
"__errno_location": {},
|
||||
"__floatscan": {},
|
||||
"__fpclassify": {},
|
||||
"__fpclassifyf": {},
|
||||
"__fpclassifyl": {},
|
||||
"__fsmu8": {},
|
||||
"__h_errno_location": {},
|
||||
"__inet_aton": {},
|
||||
"__intscan": {},
|
||||
"__isalnum_l": {},
|
||||
"__isalpha_l": {},
|
||||
"__isdigit_l": {},
|
||||
"__islower_l": {},
|
||||
"__isnan": {},
|
||||
"__isnanf": {},
|
||||
"__isnanl": {},
|
||||
"__isoc99_sscanf": {},
|
||||
"__isprint_l": {},
|
||||
"__isupper_l": {},
|
||||
"__isxdigit_l": {},
|
||||
"__lockfile": {},
|
||||
"__lookup_ipliteral": {},
|
||||
"__lookup_name": {},
|
||||
"__lookup_serv": {},
|
||||
"__shgetc": {},
|
||||
"__shlim": {},
|
||||
"__strncasecmp_l": {},
|
||||
"__sync_add_and_fetch_uint32": {},
|
||||
"__sync_sub_and_fetch_uint32": {},
|
||||
"__syscall1": {},
|
||||
"__syscall3": {},
|
||||
"__syscall4": {},
|
||||
"__toread": {},
|
||||
"__toread_needs_stdio_exit": {},
|
||||
"__uflow": {},
|
||||
"__unlockfile": {},
|
||||
"_exit": {},
|
||||
"_longjmp": {},
|
||||
"_obstack_begin": {},
|
||||
"_obstack_newchunk": {},
|
||||
"_setjmp": {},
|
||||
"abort": {},
|
||||
"abs": {},
|
||||
"accept": {},
|
||||
"access": {},
|
||||
"acos": {},
|
||||
"acosh": {},
|
||||
"alarm": {},
|
||||
"asin": {},
|
||||
"asinh": {},
|
||||
"atan": {},
|
||||
"atan2": {},
|
||||
"atanh": {},
|
||||
"atexit": {},
|
||||
"atof": {},
|
||||
"atoi": {},
|
||||
"atol": {},
|
||||
"backtrace": {},
|
||||
"backtrace_symbols_fd": {},
|
||||
"bind": {},
|
||||
"bsearch": {},
|
||||
"bzero": {},
|
||||
"calloc": {},
|
||||
"ceil": {},
|
||||
"ceilf": {},
|
||||
"cfgetospeed": {},
|
||||
"cfsetispeed": {},
|
||||
"cfsetospeed": {},
|
||||
"chdir": {},
|
||||
"chmod": {},
|
||||
"chown": {},
|
||||
"clock_gettime": {},
|
||||
"close": {},
|
||||
"closedir": {},
|
||||
"confstr": {},
|
||||
"connect": {},
|
||||
"copysign": {},
|
||||
"copysignf": {},
|
||||
"copysignl": {},
|
||||
"cos": {},
|
||||
"cosf": {},
|
||||
"cosh": {},
|
||||
"ctime": {},
|
||||
"ctime_r": {},
|
||||
"dlclose": {},
|
||||
"dlerror": {},
|
||||
"dlopen": {},
|
||||
"dlsym": {},
|
||||
"dup2": {},
|
||||
"dup3": {},
|
||||
"endpwent": {},
|
||||
"environ": {},
|
||||
"execvp": {},
|
||||
"exit": {},
|
||||
"exp": {},
|
||||
"fabs": {},
|
||||
"fabsf": {},
|
||||
"fabsl": {},
|
||||
"faccessat": {},
|
||||
"fchmod": {},
|
||||
"fchmodat": {},
|
||||
"fchown": {},
|
||||
"fchownat": {},
|
||||
"fclose": {},
|
||||
"fcntl": {},
|
||||
"fcntl64": {},
|
||||
"fdopen": {},
|
||||
"ferror": {},
|
||||
"fflush": {},
|
||||
"fgetc": {},
|
||||
"fgets": {},
|
||||
"fileno": {},
|
||||
"floor": {},
|
||||
"fmod": {},
|
||||
"fmodl": {},
|
||||
"fopen": {},
|
||||
"fopen64": {},
|
||||
"fork": {},
|
||||
"fprintf": {},
|
||||
"fputc": {},
|
||||
"fputs": {},
|
||||
"fread": {},
|
||||
"free": {},
|
||||
"freeaddrinfo": {},
|
||||
"frexp": {},
|
||||
"fscanf": {},
|
||||
"fseek": {},
|
||||
"fstat": {},
|
||||
"fstat64": {},
|
||||
"fstatfs": {},
|
||||
"fsync": {},
|
||||
"ftell": {},
|
||||
"ftruncate": {},
|
||||
"ftruncate64": {},
|
||||
"fts64_close": {},
|
||||
"fts64_open": {},
|
||||
"fts64_read": {},
|
||||
"fts_close": {},
|
||||
"fts_open": {},
|
||||
"fts_read": {},
|
||||
"fwrite": {},
|
||||
"gai_strerror": {},
|
||||
"getaddrinfo": {},
|
||||
"getc": {},
|
||||
"getcwd": {},
|
||||
"getegid": {},
|
||||
"getentropy": {},
|
||||
"getenv": {},
|
||||
"geteuid": {},
|
||||
"getgid": {},
|
||||
"getgrgid": {},
|
||||
"getgrgid_r": {},
|
||||
"getgrnam": {},
|
||||
"getgrnam_r": {},
|
||||
"gethostbyaddr": {},
|
||||
"gethostbyaddr_r": {},
|
||||
"gethostbyname": {},
|
||||
"gethostbyname2": {},
|
||||
"gethostbyname2_r": {},
|
||||
"gethostbyname_r": {},
|
||||
"gethostname": {},
|
||||
"getnameinfo": {},
|
||||
"getpeername": {},
|
||||
"getpid": {},
|
||||
"getpwnam": {},
|
||||
"getpwnam_r": {},
|
||||
"getpwuid": {},
|
||||
"getpwuid_r": {},
|
||||
"getrandom": {},
|
||||
"getresgid": {},
|
||||
"getresuid": {},
|
||||
"getrlimit": {},
|
||||
"getrlimit64": {},
|
||||
"getrusage": {},
|
||||
"getservbyname": {},
|
||||
"getsockname": {},
|
||||
"getsockopt": {},
|
||||
"gettimeofday": {},
|
||||
"getuid": {},
|
||||
"gmtime_r": {},
|
||||
"h_errno": {},
|
||||
"htonl": {},
|
||||
"htons": {},
|
||||
"hypot": {},
|
||||
"inet_ntoa": {},
|
||||
"inet_ntop": {},
|
||||
"inet_pton": {},
|
||||
"initstate": {},
|
||||
"initstate_r": {},
|
||||
"ioctl": {},
|
||||
"isalnum": {},
|
||||
"isalpha": {},
|
||||
"isascii": {},
|
||||
"isatty": {},
|
||||
"isdigit": {},
|
||||
"islower": {},
|
||||
"isnan": {},
|
||||
"isnanf": {},
|
||||
"isnanl": {},
|
||||
"isprint": {},
|
||||
"isupper": {},
|
||||
"iswalnum": {},
|
||||
"iswspace": {},
|
||||
"isxdigit": {},
|
||||
"kill": {},
|
||||
"ldexp": {},
|
||||
"link": {},
|
||||
"linkat": {},
|
||||
"listen": {},
|
||||
"llabs": {},
|
||||
"localeconv": {},
|
||||
"localtime": {},
|
||||
"localtime_r": {},
|
||||
"log": {},
|
||||
"log10": {},
|
||||
"log2": {},
|
||||
"longjmp": {},
|
||||
"lrand48": {},
|
||||
"lseek": {},
|
||||
"lseek64": {},
|
||||
"lstat": {},
|
||||
"lstat64": {},
|
||||
"malloc": {},
|
||||
"mblen": {},
|
||||
"mbrtowc": {},
|
||||
"mbsinit": {},
|
||||
"mbstowcs": {},
|
||||
"mbtowc": {},
|
||||
"memchr": {},
|
||||
"memcmp": {},
|
||||
"memcpy": {},
|
||||
"memmove": {},
|
||||
"memset": {},
|
||||
"mkdir": {},
|
||||
"mkdirat": {},
|
||||
"mkfifo": {},
|
||||
"mknod": {},
|
||||
"mknodat": {},
|
||||
"mkostemp": {},
|
||||
"mkstemp": {},
|
||||
"mkstemp64": {},
|
||||
"mkstemps": {},
|
||||
"mkstemps64": {},
|
||||
"mktime": {},
|
||||
"mmap": {},
|
||||
"mmap64": {},
|
||||
"modf": {},
|
||||
"mremap": {},
|
||||
"munmap": {},
|
||||
"nanf": {},
|
||||
"nanosleep": {},
|
||||
"nl_langinfo": {},
|
||||
"ntohs": {},
|
||||
"obstack_free": {},
|
||||
"obstack_vprintf": {},
|
||||
"open": {},
|
||||
"open64": {},
|
||||
"openat": {},
|
||||
"opendir": {},
|
||||
"openpty": {},
|
||||
"pathconf": {},
|
||||
"pause": {},
|
||||
"pclose": {},
|
||||
"perror": {},
|
||||
"pipe": {},
|
||||
"pipe2": {},
|
||||
"poll": {},
|
||||
"popen": {},
|
||||
"posix_fadvise": {},
|
||||
"pow": {},
|
||||
"pread": {},
|
||||
"printf": {},
|
||||
"pselect": {},
|
||||
"pthread_attr_destroy": {},
|
||||
"pthread_attr_getdetachstate": {},
|
||||
"pthread_attr_init": {},
|
||||
"pthread_attr_setdetachstate": {},
|
||||
"pthread_attr_setscope": {},
|
||||
"pthread_attr_setstacksize": {},
|
||||
"pthread_cond_broadcast": {},
|
||||
"pthread_cond_destroy": {},
|
||||
"pthread_cond_init": {},
|
||||
"pthread_cond_signal": {},
|
||||
"pthread_cond_timedwait": {},
|
||||
"pthread_cond_wait": {},
|
||||
"pthread_create": {},
|
||||
"pthread_detach": {},
|
||||
"pthread_equal": {},
|
||||
"pthread_exit": {},
|
||||
"pthread_getspecific": {},
|
||||
"pthread_join": {},
|
||||
"pthread_key_create": {},
|
||||
"pthread_key_delete": {},
|
||||
"pthread_mutex_destroy": {},
|
||||
"pthread_mutex_init": {},
|
||||
"pthread_mutex_lock": {},
|
||||
"pthread_mutex_trylock": {},
|
||||
"pthread_mutex_unlock": {},
|
||||
"pthread_mutexattr_destroy": {},
|
||||
"pthread_mutexattr_init": {},
|
||||
"pthread_mutexattr_settype": {},
|
||||
"pthread_self": {},
|
||||
"pthread_setspecific": {},
|
||||
"putc": {},
|
||||
"putchar": {},
|
||||
"puts": {},
|
||||
"pwrite": {},
|
||||
"qsort": {},
|
||||
"raise": {},
|
||||
"rand": {},
|
||||
"rand_r": {},
|
||||
"random": {},
|
||||
"random_r": {},
|
||||
"read": {},
|
||||
"readdir": {},
|
||||
"readdir64": {},
|
||||
"readlink": {},
|
||||
"readlinkat": {},
|
||||
"readv": {},
|
||||
"realloc": {},
|
||||
"reallocarray": {},
|
||||
"realpath": {},
|
||||
"recv": {},
|
||||
"recvfrom": {},
|
||||
"recvmsg": {},
|
||||
"remove": {},
|
||||
"rename": {},
|
||||
"renameat2": {},
|
||||
"rewind": {},
|
||||
"rindex": {},
|
||||
"rint": {},
|
||||
"rmdir": {},
|
||||
"round": {},
|
||||
"scalbn": {},
|
||||
"scalbnl": {},
|
||||
"sched_yield": {},
|
||||
"select": {},
|
||||
"send": {},
|
||||
"sendmsg": {},
|
||||
"sendto": {},
|
||||
"setbuf": {},
|
||||
"setenv": {},
|
||||
"setjmp": {},
|
||||
"setlocale": {},
|
||||
"setrlimit": {},
|
||||
"setrlimit64": {},
|
||||
"setsid": {},
|
||||
"setsockopt": {},
|
||||
"setstate": {},
|
||||
"setvbuf": {},
|
||||
"shmat": {},
|
||||
"shmctl": {},
|
||||
"shmdt": {},
|
||||
"shutdown": {},
|
||||
"sigaction": {},
|
||||
"signal": {},
|
||||
"sin": {},
|
||||
"sinf": {},
|
||||
"sinh": {},
|
||||
"sleep": {},
|
||||
"snprintf": {},
|
||||
"socket": {},
|
||||
"sprintf": {},
|
||||
"sqrt": {},
|
||||
"srand48": {},
|
||||
"sscanf": {},
|
||||
"stat": {},
|
||||
"stat64": {},
|
||||
"stderr": {},
|
||||
"stdin": {},
|
||||
"stdout": {},
|
||||
"strcasecmp": {},
|
||||
"strcat": {},
|
||||
"strchr": {},
|
||||
"strcmp": {},
|
||||
"strcpy": {},
|
||||
"strcspn": {},
|
||||
"strdup": {},
|
||||
"strerror": {},
|
||||
"strerror_r": {},
|
||||
"strlcat": {},
|
||||
"strlcpy": {},
|
||||
"strlen": {},
|
||||
"strncasecmp": {},
|
||||
"strncat": {},
|
||||
"strncmp": {},
|
||||
"strncpy": {},
|
||||
"strnlen": {},
|
||||
"strpbrk": {},
|
||||
"strrchr": {},
|
||||
"strspn": {},
|
||||
"strstr": {},
|
||||
"strtod": {},
|
||||
"strtof": {},
|
||||
"strtoimax": {},
|
||||
"strtok": {},
|
||||
"strtol": {},
|
||||
"strtold": {},
|
||||
"strtoll": {},
|
||||
"strtoul": {},
|
||||
"strtoull": {},
|
||||
"strtoumax": {},
|
||||
"symlink": {},
|
||||
"symlinkat": {},
|
||||
"sysconf": {},
|
||||
"system": {},
|
||||
"tan": {},
|
||||
"tanh": {},
|
||||
"tcgetattr": {},
|
||||
"tcsendbreak": {},
|
||||
"tcsetattr": {},
|
||||
"time": {},
|
||||
"tmpfile": {},
|
||||
"tolower": {},
|
||||
"toupper": {},
|
||||
"trunc": {},
|
||||
"tzset": {},
|
||||
"umask": {},
|
||||
"uname": {},
|
||||
"ungetc": {},
|
||||
"unlink": {},
|
||||
"unlinkat": {},
|
||||
"unsetenv": {},
|
||||
"usleep": {},
|
||||
"utime": {},
|
||||
"utimensat": {},
|
||||
"utimes": {},
|
||||
"uuid_copy": {},
|
||||
"uuid_generate_random": {},
|
||||
"uuid_parse": {},
|
||||
"uuid_unparse": {},
|
||||
"vasprintf": {},
|
||||
"vfprintf": {},
|
||||
"vfscanf": {},
|
||||
"vprintf": {},
|
||||
"vsnprintf": {},
|
||||
"vsprintf": {},
|
||||
"vsscanf": {},
|
||||
"waitpid": {},
|
||||
"wcschr": {},
|
||||
"wctomb": {},
|
||||
"wcwidth": {},
|
||||
"write": {},
|
||||
"writev": {},
|
||||
"zero_struct_address": {},
|
||||
}
|
512
vendor/modernc.org/libc/capi_linux_arm.go
generated
vendored
Normal file
512
vendor/modernc.org/libc/capi_linux_arm.go
generated
vendored
Normal file
|
@ -0,0 +1,512 @@
|
|||
// Code generated by 'go generate' - DO NOT EDIT.
|
||||
|
||||
package libc // import "modernc.org/libc"
|
||||
|
||||
var CAPI = map[string]struct{}{
|
||||
"_IO_putc": {},
|
||||
"___errno_location": {},
|
||||
"__assert_fail": {},
|
||||
"__builtin___memcpy_chk": {},
|
||||
"__builtin___memmove_chk": {},
|
||||
"__builtin___memset_chk": {},
|
||||
"__builtin___snprintf_chk": {},
|
||||
"__builtin___sprintf_chk": {},
|
||||
"__builtin___strcat_chk": {},
|
||||
"__builtin___strcpy_chk": {},
|
||||
"__builtin___strncpy_chk": {},
|
||||
"__builtin___vsnprintf_chk": {},
|
||||
"__builtin_abort": {},
|
||||
"__builtin_abs": {},
|
||||
"__builtin_add_overflowInt64": {},
|
||||
"__builtin_add_overflowUint32": {},
|
||||
"__builtin_add_overflowUint64": {},
|
||||
"__builtin_bswap16": {},
|
||||
"__builtin_bswap32": {},
|
||||
"__builtin_bswap64": {},
|
||||
"__builtin_bzero": {},
|
||||
"__builtin_clz": {},
|
||||
"__builtin_clzl": {},
|
||||
"__builtin_clzll": {},
|
||||
"__builtin_constant_p_impl": {},
|
||||
"__builtin_copysign": {},
|
||||
"__builtin_copysignf": {},
|
||||
"__builtin_copysignl": {},
|
||||
"__builtin_exit": {},
|
||||
"__builtin_expect": {},
|
||||
"__builtin_fabs": {},
|
||||
"__builtin_fabsf": {},
|
||||
"__builtin_fabsl": {},
|
||||
"__builtin_free": {},
|
||||
"__builtin_getentropy": {},
|
||||
"__builtin_huge_val": {},
|
||||
"__builtin_huge_valf": {},
|
||||
"__builtin_inf": {},
|
||||
"__builtin_inff": {},
|
||||
"__builtin_infl": {},
|
||||
"__builtin_isnan": {},
|
||||
"__builtin_isunordered": {},
|
||||
"__builtin_llabs": {},
|
||||
"__builtin_malloc": {},
|
||||
"__builtin_memcmp": {},
|
||||
"__builtin_memcpy": {},
|
||||
"__builtin_memset": {},
|
||||
"__builtin_mmap": {},
|
||||
"__builtin_mul_overflowInt64": {},
|
||||
"__builtin_mul_overflowUint128": {},
|
||||
"__builtin_mul_overflowUint64": {},
|
||||
"__builtin_nan": {},
|
||||
"__builtin_nanf": {},
|
||||
"__builtin_nanl": {},
|
||||
"__builtin_object_size": {},
|
||||
"__builtin_popcount": {},
|
||||
"__builtin_popcountl": {},
|
||||
"__builtin_prefetch": {},
|
||||
"__builtin_printf": {},
|
||||
"__builtin_snprintf": {},
|
||||
"__builtin_sprintf": {},
|
||||
"__builtin_strchr": {},
|
||||
"__builtin_strcmp": {},
|
||||
"__builtin_strcpy": {},
|
||||
"__builtin_strlen": {},
|
||||
"__builtin_sub_overflowInt64": {},
|
||||
"__builtin_trap": {},
|
||||
"__builtin_unreachable": {},
|
||||
"__ccgo_dmesg": {},
|
||||
"__ccgo_getMutexType": {},
|
||||
"__ccgo_in6addr_anyp": {},
|
||||
"__ccgo_pthreadAttrGetDetachState": {},
|
||||
"__ccgo_pthreadMutexattrGettype": {},
|
||||
"__ccgo_sqlite3_log": {},
|
||||
"__cmsg_nxthdr": {},
|
||||
"__ctype_b_loc": {},
|
||||
"__ctype_get_mb_cur_max": {},
|
||||
"__errno_location": {},
|
||||
"__floatscan": {},
|
||||
"__fpclassify": {},
|
||||
"__fpclassifyf": {},
|
||||
"__fpclassifyl": {},
|
||||
"__fsmu8": {},
|
||||
"__h_errno_location": {},
|
||||
"__inet_aton": {},
|
||||
"__intscan": {},
|
||||
"__isalnum_l": {},
|
||||
"__isalpha_l": {},
|
||||
"__isdigit_l": {},
|
||||
"__islower_l": {},
|
||||
"__isnan": {},
|
||||
"__isnanf": {},
|
||||
"__isnanl": {},
|
||||
"__isoc99_sscanf": {},
|
||||
"__isprint_l": {},
|
||||
"__isupper_l": {},
|
||||
"__isxdigit_l": {},
|
||||
"__lockfile": {},
|
||||
"__lookup_ipliteral": {},
|
||||
"__lookup_name": {},
|
||||
"__lookup_serv": {},
|
||||
"__shgetc": {},
|
||||
"__shlim": {},
|
||||
"__strncasecmp_l": {},
|
||||
"__sync_add_and_fetch_uint32": {},
|
||||
"__sync_sub_and_fetch_uint32": {},
|
||||
"__syscall1": {},
|
||||
"__syscall3": {},
|
||||
"__syscall4": {},
|
||||
"__toread": {},
|
||||
"__toread_needs_stdio_exit": {},
|
||||
"__uflow": {},
|
||||
"__unlockfile": {},
|
||||
"_exit": {},
|
||||
"_longjmp": {},
|
||||
"_obstack_begin": {},
|
||||
"_obstack_newchunk": {},
|
||||
"_setjmp": {},
|
||||
"abort": {},
|
||||
"abs": {},
|
||||
"accept": {},
|
||||
"access": {},
|
||||
"acos": {},
|
||||
"acosh": {},
|
||||
"alarm": {},
|
||||
"asin": {},
|
||||
"asinh": {},
|
||||
"atan": {},
|
||||
"atan2": {},
|
||||
"atanh": {},
|
||||
"atexit": {},
|
||||
"atof": {},
|
||||
"atoi": {},
|
||||
"atol": {},
|
||||
"backtrace": {},
|
||||
"backtrace_symbols_fd": {},
|
||||
"bind": {},
|
||||
"bsearch": {},
|
||||
"bzero": {},
|
||||
"calloc": {},
|
||||
"ceil": {},
|
||||
"ceilf": {},
|
||||
"cfgetospeed": {},
|
||||
"cfsetispeed": {},
|
||||
"cfsetospeed": {},
|
||||
"chdir": {},
|
||||
"chmod": {},
|
||||
"chown": {},
|
||||
"clock_gettime": {},
|
||||
"close": {},
|
||||
"closedir": {},
|
||||
"confstr": {},
|
||||
"connect": {},
|
||||
"copysign": {},
|
||||
"copysignf": {},
|
||||
"copysignl": {},
|
||||
"cos": {},
|
||||
"cosf": {},
|
||||
"cosh": {},
|
||||
"ctime": {},
|
||||
"ctime_r": {},
|
||||
"dlclose": {},
|
||||
"dlerror": {},
|
||||
"dlopen": {},
|
||||
"dlsym": {},
|
||||
"dup2": {},
|
||||
"endpwent": {},
|
||||
"environ": {},
|
||||
"execvp": {},
|
||||
"exit": {},
|
||||
"exp": {},
|
||||
"fabs": {},
|
||||
"fabsf": {},
|
||||
"fabsl": {},
|
||||
"fchmod": {},
|
||||
"fchown": {},
|
||||
"fclose": {},
|
||||
"fcntl": {},
|
||||
"fcntl64": {},
|
||||
"fdopen": {},
|
||||
"ferror": {},
|
||||
"fflush": {},
|
||||
"fgetc": {},
|
||||
"fgets": {},
|
||||
"fileno": {},
|
||||
"floor": {},
|
||||
"fmod": {},
|
||||
"fmodl": {},
|
||||
"fopen": {},
|
||||
"fopen64": {},
|
||||
"fork": {},
|
||||
"fprintf": {},
|
||||
"fputc": {},
|
||||
"fputs": {},
|
||||
"fread": {},
|
||||
"free": {},
|
||||
"freeaddrinfo": {},
|
||||
"frexp": {},
|
||||
"fscanf": {},
|
||||
"fseek": {},
|
||||
"fstat": {},
|
||||
"fstat64": {},
|
||||
"fstatfs": {},
|
||||
"fsync": {},
|
||||
"ftell": {},
|
||||
"ftruncate": {},
|
||||
"ftruncate64": {},
|
||||
"fts64_close": {},
|
||||
"fts64_open": {},
|
||||
"fts64_read": {},
|
||||
"fts_close": {},
|
||||
"fts_open": {},
|
||||
"fts_read": {},
|
||||
"fwrite": {},
|
||||
"gai_strerror": {},
|
||||
"getaddrinfo": {},
|
||||
"getc": {},
|
||||
"getcwd": {},
|
||||
"getegid": {},
|
||||
"getentropy": {},
|
||||
"getenv": {},
|
||||
"geteuid": {},
|
||||
"getgid": {},
|
||||
"getgrgid": {},
|
||||
"getgrgid_r": {},
|
||||
"getgrnam": {},
|
||||
"getgrnam_r": {},
|
||||
"gethostbyaddr": {},
|
||||
"gethostbyaddr_r": {},
|
||||
"gethostbyname": {},
|
||||
"gethostbyname2": {},
|
||||
"gethostbyname2_r": {},
|
||||
"gethostbyname_r": {},
|
||||
"gethostname": {},
|
||||
"getnameinfo": {},
|
||||
"getpeername": {},
|
||||
"getpid": {},
|
||||
"getpwnam": {},
|
||||
"getpwnam_r": {},
|
||||
"getpwuid": {},
|
||||
"getpwuid_r": {},
|
||||
"getrandom": {},
|
||||
"getresgid": {},
|
||||
"getresuid": {},
|
||||
"getrlimit": {},
|
||||
"getrlimit64": {},
|
||||
"getrusage": {},
|
||||
"getservbyname": {},
|
||||
"getsockname": {},
|
||||
"getsockopt": {},
|
||||
"gettimeofday": {},
|
||||
"getuid": {},
|
||||
"gmtime_r": {},
|
||||
"h_errno": {},
|
||||
"htonl": {},
|
||||
"htons": {},
|
||||
"hypot": {},
|
||||
"inet_ntoa": {},
|
||||
"inet_ntop": {},
|
||||
"inet_pton": {},
|
||||
"initstate": {},
|
||||
"initstate_r": {},
|
||||
"ioctl": {},
|
||||
"isalnum": {},
|
||||
"isalpha": {},
|
||||
"isascii": {},
|
||||
"isatty": {},
|
||||
"isdigit": {},
|
||||
"islower": {},
|
||||
"isnan": {},
|
||||
"isnanf": {},
|
||||
"isnanl": {},
|
||||
"isprint": {},
|
||||
"isupper": {},
|
||||
"isxdigit": {},
|
||||
"kill": {},
|
||||
"ldexp": {},
|
||||
"link": {},
|
||||
"listen": {},
|
||||
"llabs": {},
|
||||
"localeconv": {},
|
||||
"localtime": {},
|
||||
"localtime_r": {},
|
||||
"log": {},
|
||||
"log10": {},
|
||||
"log2": {},
|
||||
"longjmp": {},
|
||||
"lrand48": {},
|
||||
"lseek": {},
|
||||
"lseek64": {},
|
||||
"lstat": {},
|
||||
"lstat64": {},
|
||||
"malloc": {},
|
||||
"mblen": {},
|
||||
"mbrtowc": {},
|
||||
"mbsinit": {},
|
||||
"mbstowcs": {},
|
||||
"mbtowc": {},
|
||||
"memchr": {},
|
||||
"memcmp": {},
|
||||
"memcpy": {},
|
||||
"memmove": {},
|
||||
"memset": {},
|
||||
"mkdir": {},
|
||||
"mkfifo": {},
|
||||
"mknod": {},
|
||||
"mkostemp": {},
|
||||
"mkstemp": {},
|
||||
"mkstemp64": {},
|
||||
"mkstemps": {},
|
||||
"mkstemps64": {},
|
||||
"mktime": {},
|
||||
"mmap": {},
|
||||
"mmap64": {},
|
||||
"modf": {},
|
||||
"mremap": {},
|
||||
"munmap": {},
|
||||
"nanf": {},
|
||||
"nanosleep": {},
|
||||
"nl_langinfo": {},
|
||||
"ntohs": {},
|
||||
"obstack_free": {},
|
||||
"obstack_vprintf": {},
|
||||
"open": {},
|
||||
"open64": {},
|
||||
"opendir": {},
|
||||
"openpty": {},
|
||||
"pathconf": {},
|
||||
"pause": {},
|
||||
"pclose": {},
|
||||
"perror": {},
|
||||
"pipe": {},
|
||||
"poll": {},
|
||||
"popen": {},
|
||||
"posix_fadvise": {},
|
||||
"pow": {},
|
||||
"pread": {},
|
||||
"printf": {},
|
||||
"pselect": {},
|
||||
"pthread_attr_destroy": {},
|
||||
"pthread_attr_getdetachstate": {},
|
||||
"pthread_attr_init": {},
|
||||
"pthread_attr_setdetachstate": {},
|
||||
"pthread_attr_setscope": {},
|
||||
"pthread_attr_setstacksize": {},
|
||||
"pthread_cond_broadcast": {},
|
||||
"pthread_cond_destroy": {},
|
||||
"pthread_cond_init": {},
|
||||
"pthread_cond_signal": {},
|
||||
"pthread_cond_timedwait": {},
|
||||
"pthread_cond_wait": {},
|
||||
"pthread_create": {},
|
||||
"pthread_detach": {},
|
||||
"pthread_equal": {},
|
||||
"pthread_exit": {},
|
||||
"pthread_getspecific": {},
|
||||
"pthread_join": {},
|
||||
"pthread_key_create": {},
|
||||
"pthread_key_delete": {},
|
||||
"pthread_mutex_destroy": {},
|
||||
"pthread_mutex_init": {},
|
||||
"pthread_mutex_lock": {},
|
||||
"pthread_mutex_trylock": {},
|
||||
"pthread_mutex_unlock": {},
|
||||
"pthread_mutexattr_destroy": {},
|
||||
"pthread_mutexattr_init": {},
|
||||
"pthread_mutexattr_settype": {},
|
||||
"pthread_self": {},
|
||||
"pthread_setspecific": {},
|
||||
"putc": {},
|
||||
"putchar": {},
|
||||
"puts": {},
|
||||
"pwrite": {},
|
||||
"qsort": {},
|
||||
"raise": {},
|
||||
"rand": {},
|
||||
"rand_r": {},
|
||||
"random": {},
|
||||
"random_r": {},
|
||||
"read": {},
|
||||
"readdir": {},
|
||||
"readdir64": {},
|
||||
"readlink": {},
|
||||
"readv": {},
|
||||
"realloc": {},
|
||||
"reallocarray": {},
|
||||
"realpath": {},
|
||||
"recv": {},
|
||||
"recvfrom": {},
|
||||
"recvmsg": {},
|
||||
"remove": {},
|
||||
"rename": {},
|
||||
"rewind": {},
|
||||
"rindex": {},
|
||||
"rint": {},
|
||||
"rmdir": {},
|
||||
"round": {},
|
||||
"scalbn": {},
|
||||
"scalbnl": {},
|
||||
"sched_yield": {},
|
||||
"select": {},
|
||||
"send": {},
|
||||
"sendmsg": {},
|
||||
"sendto": {},
|
||||
"setbuf": {},
|
||||
"setenv": {},
|
||||
"setjmp": {},
|
||||
"setlocale": {},
|
||||
"setrlimit": {},
|
||||
"setrlimit64": {},
|
||||
"setsid": {},
|
||||
"setsockopt": {},
|
||||
"setstate": {},
|
||||
"setvbuf": {},
|
||||
"shmat": {},
|
||||
"shmctl": {},
|
||||
"shmdt": {},
|
||||
"shutdown": {},
|
||||
"sigaction": {},
|
||||
"signal": {},
|
||||
"sin": {},
|
||||
"sinf": {},
|
||||
"sinh": {},
|
||||
"sleep": {},
|
||||
"snprintf": {},
|
||||
"socket": {},
|
||||
"sprintf": {},
|
||||
"sqrt": {},
|
||||
"srand48": {},
|
||||
"sscanf": {},
|
||||
"stat": {},
|
||||
"stat64": {},
|
||||
"stderr": {},
|
||||
"stdin": {},
|
||||
"stdout": {},
|
||||
"strcasecmp": {},
|
||||
"strcat": {},
|
||||
"strchr": {},
|
||||
"strcmp": {},
|
||||
"strcpy": {},
|
||||
"strcspn": {},
|
||||
"strdup": {},
|
||||
"strerror": {},
|
||||
"strerror_r": {},
|
||||
"strlcat": {},
|
||||
"strlcpy": {},
|
||||
"strlen": {},
|
||||
"strncasecmp": {},
|
||||
"strncat": {},
|
||||
"strncmp": {},
|
||||
"strncpy": {},
|
||||
"strnlen": {},
|
||||
"strpbrk": {},
|
||||
"strrchr": {},
|
||||
"strspn": {},
|
||||
"strstr": {},
|
||||
"strtod": {},
|
||||
"strtof": {},
|
||||
"strtoimax": {},
|
||||
"strtok": {},
|
||||
"strtol": {},
|
||||
"strtold": {},
|
||||
"strtoll": {},
|
||||
"strtoul": {},
|
||||
"strtoull": {},
|
||||
"strtoumax": {},
|
||||
"symlink": {},
|
||||
"sysconf": {},
|
||||
"system": {},
|
||||
"tan": {},
|
||||
"tanh": {},
|
||||
"tcgetattr": {},
|
||||
"tcsendbreak": {},
|
||||
"tcsetattr": {},
|
||||
"time": {},
|
||||
"tmpfile": {},
|
||||
"tolower": {},
|
||||
"toupper": {},
|
||||
"trunc": {},
|
||||
"tzset": {},
|
||||
"umask": {},
|
||||
"uname": {},
|
||||
"ungetc": {},
|
||||
"unlink": {},
|
||||
"unsetenv": {},
|
||||
"usleep": {},
|
||||
"utime": {},
|
||||
"utimes": {},
|
||||
"uuid_copy": {},
|
||||
"uuid_generate_random": {},
|
||||
"uuid_parse": {},
|
||||
"uuid_unparse": {},
|
||||
"vasprintf": {},
|
||||
"vfprintf": {},
|
||||
"vfscanf": {},
|
||||
"vprintf": {},
|
||||
"vsnprintf": {},
|
||||
"vsprintf": {},
|
||||
"vsscanf": {},
|
||||
"waitpid": {},
|
||||
"wcschr": {},
|
||||
"wctomb": {},
|
||||
"wcwidth": {},
|
||||
"write": {},
|
||||
"writev": {},
|
||||
"zero_struct_address": {},
|
||||
}
|
512
vendor/modernc.org/libc/capi_linux_arm64.go
generated
vendored
Normal file
512
vendor/modernc.org/libc/capi_linux_arm64.go
generated
vendored
Normal file
|
@ -0,0 +1,512 @@
|
|||
// Code generated by 'go generate' - DO NOT EDIT.
|
||||
|
||||
package libc // import "modernc.org/libc"
|
||||
|
||||
var CAPI = map[string]struct{}{
|
||||
"_IO_putc": {},
|
||||
"___errno_location": {},
|
||||
"__assert_fail": {},
|
||||
"__builtin___memcpy_chk": {},
|
||||
"__builtin___memmove_chk": {},
|
||||
"__builtin___memset_chk": {},
|
||||
"__builtin___snprintf_chk": {},
|
||||
"__builtin___sprintf_chk": {},
|
||||
"__builtin___strcat_chk": {},
|
||||
"__builtin___strcpy_chk": {},
|
||||
"__builtin___strncpy_chk": {},
|
||||
"__builtin___vsnprintf_chk": {},
|
||||
"__builtin_abort": {},
|
||||
"__builtin_abs": {},
|
||||
"__builtin_add_overflowInt64": {},
|
||||
"__builtin_add_overflowUint32": {},
|
||||
"__builtin_add_overflowUint64": {},
|
||||
"__builtin_bswap16": {},
|
||||
"__builtin_bswap32": {},
|
||||
"__builtin_bswap64": {},
|
||||
"__builtin_bzero": {},
|
||||
"__builtin_clz": {},
|
||||
"__builtin_clzl": {},
|
||||
"__builtin_clzll": {},
|
||||
"__builtin_constant_p_impl": {},
|
||||
"__builtin_copysign": {},
|
||||
"__builtin_copysignf": {},
|
||||
"__builtin_copysignl": {},
|
||||
"__builtin_exit": {},
|
||||
"__builtin_expect": {},
|
||||
"__builtin_fabs": {},
|
||||
"__builtin_fabsf": {},
|
||||
"__builtin_fabsl": {},
|
||||
"__builtin_free": {},
|
||||
"__builtin_getentropy": {},
|
||||
"__builtin_huge_val": {},
|
||||
"__builtin_huge_valf": {},
|
||||
"__builtin_inf": {},
|
||||
"__builtin_inff": {},
|
||||
"__builtin_infl": {},
|
||||
"__builtin_isnan": {},
|
||||
"__builtin_isunordered": {},
|
||||
"__builtin_llabs": {},
|
||||
"__builtin_malloc": {},
|
||||
"__builtin_memcmp": {},
|
||||
"__builtin_memcpy": {},
|
||||
"__builtin_memset": {},
|
||||
"__builtin_mmap": {},
|
||||
"__builtin_mul_overflowInt64": {},
|
||||
"__builtin_mul_overflowUint128": {},
|
||||
"__builtin_mul_overflowUint64": {},
|
||||
"__builtin_nan": {},
|
||||
"__builtin_nanf": {},
|
||||
"__builtin_nanl": {},
|
||||
"__builtin_object_size": {},
|
||||
"__builtin_popcount": {},
|
||||
"__builtin_popcountl": {},
|
||||
"__builtin_prefetch": {},
|
||||
"__builtin_printf": {},
|
||||
"__builtin_snprintf": {},
|
||||
"__builtin_sprintf": {},
|
||||
"__builtin_strchr": {},
|
||||
"__builtin_strcmp": {},
|
||||
"__builtin_strcpy": {},
|
||||
"__builtin_strlen": {},
|
||||
"__builtin_sub_overflowInt64": {},
|
||||
"__builtin_trap": {},
|
||||
"__builtin_unreachable": {},
|
||||
"__ccgo_dmesg": {},
|
||||
"__ccgo_getMutexType": {},
|
||||
"__ccgo_in6addr_anyp": {},
|
||||
"__ccgo_pthreadAttrGetDetachState": {},
|
||||
"__ccgo_pthreadMutexattrGettype": {},
|
||||
"__ccgo_sqlite3_log": {},
|
||||
"__cmsg_nxthdr": {},
|
||||
"__ctype_b_loc": {},
|
||||
"__ctype_get_mb_cur_max": {},
|
||||
"__errno_location": {},
|
||||
"__floatscan": {},
|
||||
"__fpclassify": {},
|
||||
"__fpclassifyf": {},
|
||||
"__fpclassifyl": {},
|
||||
"__fsmu8": {},
|
||||
"__h_errno_location": {},
|
||||
"__inet_aton": {},
|
||||
"__intscan": {},
|
||||
"__isalnum_l": {},
|
||||
"__isalpha_l": {},
|
||||
"__isdigit_l": {},
|
||||
"__islower_l": {},
|
||||
"__isnan": {},
|
||||
"__isnanf": {},
|
||||
"__isnanl": {},
|
||||
"__isoc99_sscanf": {},
|
||||
"__isprint_l": {},
|
||||
"__isupper_l": {},
|
||||
"__isxdigit_l": {},
|
||||
"__lockfile": {},
|
||||
"__lookup_ipliteral": {},
|
||||
"__lookup_name": {},
|
||||
"__lookup_serv": {},
|
||||
"__shgetc": {},
|
||||
"__shlim": {},
|
||||
"__strncasecmp_l": {},
|
||||
"__sync_add_and_fetch_uint32": {},
|
||||
"__sync_sub_and_fetch_uint32": {},
|
||||
"__syscall1": {},
|
||||
"__syscall3": {},
|
||||
"__syscall4": {},
|
||||
"__toread": {},
|
||||
"__toread_needs_stdio_exit": {},
|
||||
"__uflow": {},
|
||||
"__unlockfile": {},
|
||||
"_exit": {},
|
||||
"_longjmp": {},
|
||||
"_obstack_begin": {},
|
||||
"_obstack_newchunk": {},
|
||||
"_setjmp": {},
|
||||
"abort": {},
|
||||
"abs": {},
|
||||
"accept": {},
|
||||
"access": {},
|
||||
"acos": {},
|
||||
"acosh": {},
|
||||
"alarm": {},
|
||||
"asin": {},
|
||||
"asinh": {},
|
||||
"atan": {},
|
||||
"atan2": {},
|
||||
"atanh": {},
|
||||
"atexit": {},
|
||||
"atof": {},
|
||||
"atoi": {},
|
||||
"atol": {},
|
||||
"backtrace": {},
|
||||
"backtrace_symbols_fd": {},
|
||||
"bind": {},
|
||||
"bsearch": {},
|
||||
"bzero": {},
|
||||
"calloc": {},
|
||||
"ceil": {},
|
||||
"ceilf": {},
|
||||
"cfgetospeed": {},
|
||||
"cfsetispeed": {},
|
||||
"cfsetospeed": {},
|
||||
"chdir": {},
|
||||
"chmod": {},
|
||||
"chown": {},
|
||||
"clock_gettime": {},
|
||||
"close": {},
|
||||
"closedir": {},
|
||||
"confstr": {},
|
||||
"connect": {},
|
||||
"copysign": {},
|
||||
"copysignf": {},
|
||||
"copysignl": {},
|
||||
"cos": {},
|
||||
"cosf": {},
|
||||
"cosh": {},
|
||||
"ctime": {},
|
||||
"ctime_r": {},
|
||||
"dlclose": {},
|
||||
"dlerror": {},
|
||||
"dlopen": {},
|
||||
"dlsym": {},
|
||||
"dup2": {},
|
||||
"endpwent": {},
|
||||
"environ": {},
|
||||
"execvp": {},
|
||||
"exit": {},
|
||||
"exp": {},
|
||||
"fabs": {},
|
||||
"fabsf": {},
|
||||
"fabsl": {},
|
||||
"fchmod": {},
|
||||
"fchown": {},
|
||||
"fclose": {},
|
||||
"fcntl": {},
|
||||
"fcntl64": {},
|
||||
"fdopen": {},
|
||||
"ferror": {},
|
||||
"fflush": {},
|
||||
"fgetc": {},
|
||||
"fgets": {},
|
||||
"fileno": {},
|
||||
"floor": {},
|
||||
"fmod": {},
|
||||
"fmodl": {},
|
||||
"fopen": {},
|
||||
"fopen64": {},
|
||||
"fork": {},
|
||||
"fprintf": {},
|
||||
"fputc": {},
|
||||
"fputs": {},
|
||||
"fread": {},
|
||||
"free": {},
|
||||
"freeaddrinfo": {},
|
||||
"frexp": {},
|
||||
"fscanf": {},
|
||||
"fseek": {},
|
||||
"fstat": {},
|
||||
"fstat64": {},
|
||||
"fstatfs": {},
|
||||
"fsync": {},
|
||||
"ftell": {},
|
||||
"ftruncate": {},
|
||||
"ftruncate64": {},
|
||||
"fts64_close": {},
|
||||
"fts64_open": {},
|
||||
"fts64_read": {},
|
||||
"fts_close": {},
|
||||
"fts_open": {},
|
||||
"fts_read": {},
|
||||
"fwrite": {},
|
||||
"gai_strerror": {},
|
||||
"getaddrinfo": {},
|
||||
"getc": {},
|
||||
"getcwd": {},
|
||||
"getegid": {},
|
||||
"getentropy": {},
|
||||
"getenv": {},
|
||||
"geteuid": {},
|
||||
"getgid": {},
|
||||
"getgrgid": {},
|
||||
"getgrgid_r": {},
|
||||
"getgrnam": {},
|
||||
"getgrnam_r": {},
|
||||
"gethostbyaddr": {},
|
||||
"gethostbyaddr_r": {},
|
||||
"gethostbyname": {},
|
||||
"gethostbyname2": {},
|
||||
"gethostbyname2_r": {},
|
||||
"gethostbyname_r": {},
|
||||
"gethostname": {},
|
||||
"getnameinfo": {},
|
||||
"getpeername": {},
|
||||
"getpid": {},
|
||||
"getpwnam": {},
|
||||
"getpwnam_r": {},
|
||||
"getpwuid": {},
|
||||
"getpwuid_r": {},
|
||||
"getrandom": {},
|
||||
"getresgid": {},
|
||||
"getresuid": {},
|
||||
"getrlimit": {},
|
||||
"getrlimit64": {},
|
||||
"getrusage": {},
|
||||
"getservbyname": {},
|
||||
"getsockname": {},
|
||||
"getsockopt": {},
|
||||
"gettimeofday": {},
|
||||
"getuid": {},
|
||||
"gmtime_r": {},
|
||||
"h_errno": {},
|
||||
"htonl": {},
|
||||
"htons": {},
|
||||
"hypot": {},
|
||||
"inet_ntoa": {},
|
||||
"inet_ntop": {},
|
||||
"inet_pton": {},
|
||||
"initstate": {},
|
||||
"initstate_r": {},
|
||||
"ioctl": {},
|
||||
"isalnum": {},
|
||||
"isalpha": {},
|
||||
"isascii": {},
|
||||
"isatty": {},
|
||||
"isdigit": {},
|
||||
"islower": {},
|
||||
"isnan": {},
|
||||
"isnanf": {},
|
||||
"isnanl": {},
|
||||
"isprint": {},
|
||||
"isupper": {},
|
||||
"isxdigit": {},
|
||||
"kill": {},
|
||||
"ldexp": {},
|
||||
"link": {},
|
||||
"listen": {},
|
||||
"llabs": {},
|
||||
"localeconv": {},
|
||||
"localtime": {},
|
||||
"localtime_r": {},
|
||||
"log": {},
|
||||
"log10": {},
|
||||
"log2": {},
|
||||
"longjmp": {},
|
||||
"lrand48": {},
|
||||
"lseek": {},
|
||||
"lseek64": {},
|
||||
"lstat": {},
|
||||
"lstat64": {},
|
||||
"malloc": {},
|
||||
"mblen": {},
|
||||
"mbrtowc": {},
|
||||
"mbsinit": {},
|
||||
"mbstowcs": {},
|
||||
"mbtowc": {},
|
||||
"memchr": {},
|
||||
"memcmp": {},
|
||||
"memcpy": {},
|
||||
"memmove": {},
|
||||
"memset": {},
|
||||
"mkdir": {},
|
||||
"mkfifo": {},
|
||||
"mknod": {},
|
||||
"mkostemp": {},
|
||||
"mkstemp": {},
|
||||
"mkstemp64": {},
|
||||
"mkstemps": {},
|
||||
"mkstemps64": {},
|
||||
"mktime": {},
|
||||
"mmap": {},
|
||||
"mmap64": {},
|
||||
"modf": {},
|
||||
"mremap": {},
|
||||
"munmap": {},
|
||||
"nanf": {},
|
||||
"nanosleep": {},
|
||||
"nl_langinfo": {},
|
||||
"ntohs": {},
|
||||
"obstack_free": {},
|
||||
"obstack_vprintf": {},
|
||||
"open": {},
|
||||
"open64": {},
|
||||
"opendir": {},
|
||||
"openpty": {},
|
||||
"pathconf": {},
|
||||
"pause": {},
|
||||
"pclose": {},
|
||||
"perror": {},
|
||||
"pipe": {},
|
||||
"poll": {},
|
||||
"popen": {},
|
||||
"posix_fadvise": {},
|
||||
"pow": {},
|
||||
"pread": {},
|
||||
"printf": {},
|
||||
"pselect": {},
|
||||
"pthread_attr_destroy": {},
|
||||
"pthread_attr_getdetachstate": {},
|
||||
"pthread_attr_init": {},
|
||||
"pthread_attr_setdetachstate": {},
|
||||
"pthread_attr_setscope": {},
|
||||
"pthread_attr_setstacksize": {},
|
||||
"pthread_cond_broadcast": {},
|
||||
"pthread_cond_destroy": {},
|
||||
"pthread_cond_init": {},
|
||||
"pthread_cond_signal": {},
|
||||
"pthread_cond_timedwait": {},
|
||||
"pthread_cond_wait": {},
|
||||
"pthread_create": {},
|
||||
"pthread_detach": {},
|
||||
"pthread_equal": {},
|
||||
"pthread_exit": {},
|
||||
"pthread_getspecific": {},
|
||||
"pthread_join": {},
|
||||
"pthread_key_create": {},
|
||||
"pthread_key_delete": {},
|
||||
"pthread_mutex_destroy": {},
|
||||
"pthread_mutex_init": {},
|
||||
"pthread_mutex_lock": {},
|
||||
"pthread_mutex_trylock": {},
|
||||
"pthread_mutex_unlock": {},
|
||||
"pthread_mutexattr_destroy": {},
|
||||
"pthread_mutexattr_init": {},
|
||||
"pthread_mutexattr_settype": {},
|
||||
"pthread_self": {},
|
||||
"pthread_setspecific": {},
|
||||
"putc": {},
|
||||
"putchar": {},
|
||||
"puts": {},
|
||||
"pwrite": {},
|
||||
"qsort": {},
|
||||
"raise": {},
|
||||
"rand": {},
|
||||
"rand_r": {},
|
||||
"random": {},
|
||||
"random_r": {},
|
||||
"read": {},
|
||||
"readdir": {},
|
||||
"readdir64": {},
|
||||
"readlink": {},
|
||||
"readv": {},
|
||||
"realloc": {},
|
||||
"reallocarray": {},
|
||||
"realpath": {},
|
||||
"recv": {},
|
||||
"recvfrom": {},
|
||||
"recvmsg": {},
|
||||
"remove": {},
|
||||
"rename": {},
|
||||
"rewind": {},
|
||||
"rindex": {},
|
||||
"rint": {},
|
||||
"rmdir": {},
|
||||
"round": {},
|
||||
"scalbn": {},
|
||||
"scalbnl": {},
|
||||
"sched_yield": {},
|
||||
"select": {},
|
||||
"send": {},
|
||||
"sendmsg": {},
|
||||
"sendto": {},
|
||||
"setbuf": {},
|
||||
"setenv": {},
|
||||
"setjmp": {},
|
||||
"setlocale": {},
|
||||
"setrlimit": {},
|
||||
"setrlimit64": {},
|
||||
"setsid": {},
|
||||
"setsockopt": {},
|
||||
"setstate": {},
|
||||
"setvbuf": {},
|
||||
"shmat": {},
|
||||
"shmctl": {},
|
||||
"shmdt": {},
|
||||
"shutdown": {},
|
||||
"sigaction": {},
|
||||
"signal": {},
|
||||
"sin": {},
|
||||
"sinf": {},
|
||||
"sinh": {},
|
||||
"sleep": {},
|
||||
"snprintf": {},
|
||||
"socket": {},
|
||||
"sprintf": {},
|
||||
"sqrt": {},
|
||||
"srand48": {},
|
||||
"sscanf": {},
|
||||
"stat": {},
|
||||
"stat64": {},
|
||||
"stderr": {},
|
||||
"stdin": {},
|
||||
"stdout": {},
|
||||
"strcasecmp": {},
|
||||
"strcat": {},
|
||||
"strchr": {},
|
||||
"strcmp": {},
|
||||
"strcpy": {},
|
||||
"strcspn": {},
|
||||
"strdup": {},
|
||||
"strerror": {},
|
||||
"strerror_r": {},
|
||||
"strlcat": {},
|
||||
"strlcpy": {},
|
||||
"strlen": {},
|
||||
"strncasecmp": {},
|
||||
"strncat": {},
|
||||
"strncmp": {},
|
||||
"strncpy": {},
|
||||
"strnlen": {},
|
||||
"strpbrk": {},
|
||||
"strrchr": {},
|
||||
"strspn": {},
|
||||
"strstr": {},
|
||||
"strtod": {},
|
||||
"strtof": {},
|
||||
"strtoimax": {},
|
||||
"strtok": {},
|
||||
"strtol": {},
|
||||
"strtold": {},
|
||||
"strtoll": {},
|
||||
"strtoul": {},
|
||||
"strtoull": {},
|
||||
"strtoumax": {},
|
||||
"symlink": {},
|
||||
"sysconf": {},
|
||||
"system": {},
|
||||
"tan": {},
|
||||
"tanh": {},
|
||||
"tcgetattr": {},
|
||||
"tcsendbreak": {},
|
||||
"tcsetattr": {},
|
||||
"time": {},
|
||||
"tmpfile": {},
|
||||
"tolower": {},
|
||||
"toupper": {},
|
||||
"trunc": {},
|
||||
"tzset": {},
|
||||
"umask": {},
|
||||
"uname": {},
|
||||
"ungetc": {},
|
||||
"unlink": {},
|
||||
"unsetenv": {},
|
||||
"usleep": {},
|
||||
"utime": {},
|
||||
"utimes": {},
|
||||
"uuid_copy": {},
|
||||
"uuid_generate_random": {},
|
||||
"uuid_parse": {},
|
||||
"uuid_unparse": {},
|
||||
"vasprintf": {},
|
||||
"vfprintf": {},
|
||||
"vfscanf": {},
|
||||
"vprintf": {},
|
||||
"vsnprintf": {},
|
||||
"vsprintf": {},
|
||||
"vsscanf": {},
|
||||
"waitpid": {},
|
||||
"wcschr": {},
|
||||
"wctomb": {},
|
||||
"wcwidth": {},
|
||||
"write": {},
|
||||
"writev": {},
|
||||
"zero_struct_address": {},
|
||||
}
|
528
vendor/modernc.org/libc/capi_linux_loong64.go
generated
vendored
Normal file
528
vendor/modernc.org/libc/capi_linux_loong64.go
generated
vendored
Normal file
|
@ -0,0 +1,528 @@
|
|||
// Code generated by 'go generate' - DO NOT EDIT.
|
||||
|
||||
package libc // import "modernc.org/libc"
|
||||
|
||||
var CAPI = map[string]struct{}{
|
||||
"_IO_putc": {},
|
||||
"___errno_location": {},
|
||||
"__assert_fail": {},
|
||||
"__builtin___memcpy_chk": {},
|
||||
"__builtin___memmove_chk": {},
|
||||
"__builtin___memset_chk": {},
|
||||
"__builtin___snprintf_chk": {},
|
||||
"__builtin___sprintf_chk": {},
|
||||
"__builtin___strcat_chk": {},
|
||||
"__builtin___strcpy_chk": {},
|
||||
"__builtin___strncpy_chk": {},
|
||||
"__builtin___vsnprintf_chk": {},
|
||||
"__builtin_abort": {},
|
||||
"__builtin_abs": {},
|
||||
"__builtin_add_overflowInt64": {},
|
||||
"__builtin_add_overflowUint32": {},
|
||||
"__builtin_add_overflowUint64": {},
|
||||
"__builtin_bswap16": {},
|
||||
"__builtin_bswap32": {},
|
||||
"__builtin_bswap64": {},
|
||||
"__builtin_bzero": {},
|
||||
"__builtin_clz": {},
|
||||
"__builtin_clzl": {},
|
||||
"__builtin_clzll": {},
|
||||
"__builtin_constant_p_impl": {},
|
||||
"__builtin_copysign": {},
|
||||
"__builtin_copysignf": {},
|
||||
"__builtin_copysignl": {},
|
||||
"__builtin_exit": {},
|
||||
"__builtin_expect": {},
|
||||
"__builtin_fabs": {},
|
||||
"__builtin_fabsf": {},
|
||||
"__builtin_fabsl": {},
|
||||
"__builtin_free": {},
|
||||
"__builtin_getentropy": {},
|
||||
"__builtin_huge_val": {},
|
||||
"__builtin_huge_valf": {},
|
||||
"__builtin_inf": {},
|
||||
"__builtin_inff": {},
|
||||
"__builtin_infl": {},
|
||||
"__builtin_isnan": {},
|
||||
"__builtin_isunordered": {},
|
||||
"__builtin_llabs": {},
|
||||
"__builtin_malloc": {},
|
||||
"__builtin_memcmp": {},
|
||||
"__builtin_memcpy": {},
|
||||
"__builtin_memset": {},
|
||||
"__builtin_mmap": {},
|
||||
"__builtin_mul_overflowInt64": {},
|
||||
"__builtin_mul_overflowUint128": {},
|
||||
"__builtin_mul_overflowUint64": {},
|
||||
"__builtin_nan": {},
|
||||
"__builtin_nanf": {},
|
||||
"__builtin_nanl": {},
|
||||
"__builtin_object_size": {},
|
||||
"__builtin_popcount": {},
|
||||
"__builtin_popcountl": {},
|
||||
"__builtin_prefetch": {},
|
||||
"__builtin_printf": {},
|
||||
"__builtin_snprintf": {},
|
||||
"__builtin_sprintf": {},
|
||||
"__builtin_strchr": {},
|
||||
"__builtin_strcmp": {},
|
||||
"__builtin_strcpy": {},
|
||||
"__builtin_strlen": {},
|
||||
"__builtin_sub_overflowInt64": {},
|
||||
"__builtin_trap": {},
|
||||
"__builtin_unreachable": {},
|
||||
"__ccgo_dmesg": {},
|
||||
"__ccgo_getMutexType": {},
|
||||
"__ccgo_in6addr_anyp": {},
|
||||
"__ccgo_pthreadAttrGetDetachState": {},
|
||||
"__ccgo_pthreadMutexattrGettype": {},
|
||||
"__ccgo_sqlite3_log": {},
|
||||
"__cmsg_nxthdr": {},
|
||||
"__ctype_b_loc": {},
|
||||
"__ctype_get_mb_cur_max": {},
|
||||
"__errno_location": {},
|
||||
"__floatscan": {},
|
||||
"__fpclassify": {},
|
||||
"__fpclassifyf": {},
|
||||
"__fpclassifyl": {},
|
||||
"__fsmu8": {},
|
||||
"__h_errno_location": {},
|
||||
"__inet_aton": {},
|
||||
"__intscan": {},
|
||||
"__isalnum_l": {},
|
||||
"__isalpha_l": {},
|
||||
"__isdigit_l": {},
|
||||
"__islower_l": {},
|
||||
"__isnan": {},
|
||||
"__isnanf": {},
|
||||
"__isnanl": {},
|
||||
"__isoc99_sscanf": {},
|
||||
"__isprint_l": {},
|
||||
"__isupper_l": {},
|
||||
"__isxdigit_l": {},
|
||||
"__lockfile": {},
|
||||
"__lookup_ipliteral": {},
|
||||
"__lookup_name": {},
|
||||
"__lookup_serv": {},
|
||||
"__shgetc": {},
|
||||
"__shlim": {},
|
||||
"__strncasecmp_l": {},
|
||||
"__sync_add_and_fetch_uint32": {},
|
||||
"__sync_sub_and_fetch_uint32": {},
|
||||
"__syscall1": {},
|
||||
"__syscall3": {},
|
||||
"__syscall4": {},
|
||||
"__toread": {},
|
||||
"__toread_needs_stdio_exit": {},
|
||||
"__uflow": {},
|
||||
"__unlockfile": {},
|
||||
"_exit": {},
|
||||
"_longjmp": {},
|
||||
"_obstack_begin": {},
|
||||
"_obstack_newchunk": {},
|
||||
"_setjmp": {},
|
||||
"abort": {},
|
||||
"abs": {},
|
||||
"accept": {},
|
||||
"access": {},
|
||||
"acos": {},
|
||||
"acosh": {},
|
||||
"alarm": {},
|
||||
"asin": {},
|
||||
"asinh": {},
|
||||
"atan": {},
|
||||
"atan2": {},
|
||||
"atanh": {},
|
||||
"atexit": {},
|
||||
"atof": {},
|
||||
"atoi": {},
|
||||
"atol": {},
|
||||
"backtrace": {},
|
||||
"backtrace_symbols_fd": {},
|
||||
"bind": {},
|
||||
"bsearch": {},
|
||||
"bzero": {},
|
||||
"calloc": {},
|
||||
"ceil": {},
|
||||
"ceilf": {},
|
||||
"cfgetospeed": {},
|
||||
"cfsetispeed": {},
|
||||
"cfsetospeed": {},
|
||||
"chdir": {},
|
||||
"chmod": {},
|
||||
"chown": {},
|
||||
"clock_gettime": {},
|
||||
"close": {},
|
||||
"closedir": {},
|
||||
"confstr": {},
|
||||
"connect": {},
|
||||
"copysign": {},
|
||||
"copysignf": {},
|
||||
"copysignl": {},
|
||||
"cos": {},
|
||||
"cosf": {},
|
||||
"cosh": {},
|
||||
"ctime": {},
|
||||
"ctime_r": {},
|
||||
"dlclose": {},
|
||||
"dlerror": {},
|
||||
"dlopen": {},
|
||||
"dlsym": {},
|
||||
"dup2": {},
|
||||
"dup3": {},
|
||||
"endpwent": {},
|
||||
"environ": {},
|
||||
"execvp": {},
|
||||
"exit": {},
|
||||
"exp": {},
|
||||
"fabs": {},
|
||||
"fabsf": {},
|
||||
"fabsl": {},
|
||||
"faccessat": {},
|
||||
"fchmod": {},
|
||||
"fchmodat": {},
|
||||
"fchown": {},
|
||||
"fchownat": {},
|
||||
"fclose": {},
|
||||
"fcntl": {},
|
||||
"fcntl64": {},
|
||||
"fdopen": {},
|
||||
"ferror": {},
|
||||
"fflush": {},
|
||||
"fgetc": {},
|
||||
"fgets": {},
|
||||
"fileno": {},
|
||||
"floor": {},
|
||||
"fmod": {},
|
||||
"fmodl": {},
|
||||
"fopen": {},
|
||||
"fopen64": {},
|
||||
"fork": {},
|
||||
"fprintf": {},
|
||||
"fputc": {},
|
||||
"fputs": {},
|
||||
"fread": {},
|
||||
"free": {},
|
||||
"freeaddrinfo": {},
|
||||
"frexp": {},
|
||||
"fscanf": {},
|
||||
"fseek": {},
|
||||
"fstat": {},
|
||||
"fstat64": {},
|
||||
"fstatfs": {},
|
||||
"fsync": {},
|
||||
"ftell": {},
|
||||
"ftruncate": {},
|
||||
"ftruncate64": {},
|
||||
"fts64_close": {},
|
||||
"fts64_open": {},
|
||||
"fts64_read": {},
|
||||
"fts_close": {},
|
||||
"fts_open": {},
|
||||
"fts_read": {},
|
||||
"fwrite": {},
|
||||
"gai_strerror": {},
|
||||
"getaddrinfo": {},
|
||||
"getc": {},
|
||||
"getcwd": {},
|
||||
"getegid": {},
|
||||
"getentropy": {},
|
||||
"getenv": {},
|
||||
"geteuid": {},
|
||||
"getgid": {},
|
||||
"getgrgid": {},
|
||||
"getgrgid_r": {},
|
||||
"getgrnam": {},
|
||||
"getgrnam_r": {},
|
||||
"gethostbyaddr": {},
|
||||
"gethostbyaddr_r": {},
|
||||
"gethostbyname": {},
|
||||
"gethostbyname2": {},
|
||||
"gethostbyname2_r": {},
|
||||
"gethostbyname_r": {},
|
||||
"gethostname": {},
|
||||
"getnameinfo": {},
|
||||
"getpeername": {},
|
||||
"getpid": {},
|
||||
"getpwnam": {},
|
||||
"getpwnam_r": {},
|
||||
"getpwuid": {},
|
||||
"getpwuid_r": {},
|
||||
"getrandom": {},
|
||||
"getresgid": {},
|
||||
"getresuid": {},
|
||||
"getrlimit": {},
|
||||
"getrlimit64": {},
|
||||
"getrusage": {},
|
||||
"getservbyname": {},
|
||||
"getsockname": {},
|
||||
"getsockopt": {},
|
||||
"gettimeofday": {},
|
||||
"getuid": {},
|
||||
"gmtime_r": {},
|
||||
"h_errno": {},
|
||||
"htonl": {},
|
||||
"htons": {},
|
||||
"hypot": {},
|
||||
"inet_ntoa": {},
|
||||
"inet_ntop": {},
|
||||
"inet_pton": {},
|
||||
"initstate": {},
|
||||
"initstate_r": {},
|
||||
"ioctl": {},
|
||||
"isalnum": {},
|
||||
"isalpha": {},
|
||||
"isascii": {},
|
||||
"isatty": {},
|
||||
"isdigit": {},
|
||||
"islower": {},
|
||||
"isnan": {},
|
||||
"isnanf": {},
|
||||
"isnanl": {},
|
||||
"isprint": {},
|
||||
"isupper": {},
|
||||
"iswalnum": {},
|
||||
"iswspace": {},
|
||||
"isxdigit": {},
|
||||
"kill": {},
|
||||
"ldexp": {},
|
||||
"link": {},
|
||||
"linkat": {},
|
||||
"listen": {},
|
||||
"llabs": {},
|
||||
"localeconv": {},
|
||||
"localtime": {},
|
||||
"localtime_r": {},
|
||||
"log": {},
|
||||
"log10": {},
|
||||
"log2": {},
|
||||
"longjmp": {},
|
||||
"lrand48": {},
|
||||
"lseek": {},
|
||||
"lseek64": {},
|
||||
"lstat": {},
|
||||
"lstat64": {},
|
||||
"malloc": {},
|
||||
"mblen": {},
|
||||
"mbrtowc": {},
|
||||
"mbsinit": {},
|
||||
"mbstowcs": {},
|
||||
"mbtowc": {},
|
||||
"memchr": {},
|
||||
"memcmp": {},
|
||||
"memcpy": {},
|
||||
"memmove": {},
|
||||
"memset": {},
|
||||
"mkdir": {},
|
||||
"mkdirat": {},
|
||||
"mkfifo": {},
|
||||
"mknod": {},
|
||||
"mknodat": {},
|
||||
"mkostemp": {},
|
||||
"mkstemp": {},
|
||||
"mkstemp64": {},
|
||||
"mkstemps": {},
|
||||
"mkstemps64": {},
|
||||
"mktime": {},
|
||||
"mmap": {},
|
||||
"mmap64": {},
|
||||
"modf": {},
|
||||
"mremap": {},
|
||||
"munmap": {},
|
||||
"nanf": {},
|
||||
"nanosleep": {},
|
||||
"nl_langinfo": {},
|
||||
"ntohs": {},
|
||||
"obstack_free": {},
|
||||
"obstack_vprintf": {},
|
||||
"open": {},
|
||||
"open64": {},
|
||||
"openat": {},
|
||||
"opendir": {},
|
||||
"openpty": {},
|
||||
"pathconf": {},
|
||||
"pause": {},
|
||||
"pclose": {},
|
||||
"perror": {},
|
||||
"pipe": {},
|
||||
"pipe2": {},
|
||||
"poll": {},
|
||||
"popen": {},
|
||||
"posix_fadvise": {},
|
||||
"pow": {},
|
||||
"pread": {},
|
||||
"printf": {},
|
||||
"pselect": {},
|
||||
"pthread_attr_destroy": {},
|
||||
"pthread_attr_getdetachstate": {},
|
||||
"pthread_attr_init": {},
|
||||
"pthread_attr_setdetachstate": {},
|
||||
"pthread_attr_setscope": {},
|
||||
"pthread_attr_setstacksize": {},
|
||||
"pthread_cond_broadcast": {},
|
||||
"pthread_cond_destroy": {},
|
||||
"pthread_cond_init": {},
|
||||
"pthread_cond_signal": {},
|
||||
"pthread_cond_timedwait": {},
|
||||
"pthread_cond_wait": {},
|
||||
"pthread_create": {},
|
||||
"pthread_detach": {},
|
||||
"pthread_equal": {},
|
||||
"pthread_exit": {},
|
||||
"pthread_getspecific": {},
|
||||
"pthread_join": {},
|
||||
"pthread_key_create": {},
|
||||
"pthread_key_delete": {},
|
||||
"pthread_mutex_destroy": {},
|
||||
"pthread_mutex_init": {},
|
||||
"pthread_mutex_lock": {},
|
||||
"pthread_mutex_trylock": {},
|
||||
"pthread_mutex_unlock": {},
|
||||
"pthread_mutexattr_destroy": {},
|
||||
"pthread_mutexattr_init": {},
|
||||
"pthread_mutexattr_settype": {},
|
||||
"pthread_self": {},
|
||||
"pthread_setspecific": {},
|
||||
"putc": {},
|
||||
"putchar": {},
|
||||
"puts": {},
|
||||
"pwrite": {},
|
||||
"qsort": {},
|
||||
"raise": {},
|
||||
"rand": {},
|
||||
"rand_r": {},
|
||||
"random": {},
|
||||
"random_r": {},
|
||||
"read": {},
|
||||
"readdir": {},
|
||||
"readdir64": {},
|
||||
"readlink": {},
|
||||
"readlinkat": {},
|
||||
"readv": {},
|
||||
"realloc": {},
|
||||
"reallocarray": {},
|
||||
"realpath": {},
|
||||
"recv": {},
|
||||
"recvfrom": {},
|
||||
"recvmsg": {},
|
||||
"remove": {},
|
||||
"rename": {},
|
||||
"renameat2": {},
|
||||
"rewind": {},
|
||||
"rindex": {},
|
||||
"rint": {},
|
||||
"rmdir": {},
|
||||
"round": {},
|
||||
"scalbn": {},
|
||||
"scalbnl": {},
|
||||
"sched_yield": {},
|
||||
"select": {},
|
||||
"send": {},
|
||||
"sendmsg": {},
|
||||
"sendto": {},
|
||||
"setbuf": {},
|
||||
"setenv": {},
|
||||
"setjmp": {},
|
||||
"setlocale": {},
|
||||
"setrlimit": {},
|
||||
"setrlimit64": {},
|
||||
"setsid": {},
|
||||
"setsockopt": {},
|
||||
"setstate": {},
|
||||
"setvbuf": {},
|
||||
"shmat": {},
|
||||
"shmctl": {},
|
||||
"shmdt": {},
|
||||
"shutdown": {},
|
||||
"sigaction": {},
|
||||
"signal": {},
|
||||
"sin": {},
|
||||
"sinf": {},
|
||||
"sinh": {},
|
||||
"sleep": {},
|
||||
"snprintf": {},
|
||||
"socket": {},
|
||||
"sprintf": {},
|
||||
"sqrt": {},
|
||||
"srand48": {},
|
||||
"sscanf": {},
|
||||
"stat": {},
|
||||
"stat64": {},
|
||||
"stderr": {},
|
||||
"stdin": {},
|
||||
"stdout": {},
|
||||
"strcasecmp": {},
|
||||
"strcat": {},
|
||||
"strchr": {},
|
||||
"strcmp": {},
|
||||
"strcpy": {},
|
||||
"strcspn": {},
|
||||
"strdup": {},
|
||||
"strerror": {},
|
||||
"strerror_r": {},
|
||||
"strlcat": {},
|
||||
"strlcpy": {},
|
||||
"strlen": {},
|
||||
"strncasecmp": {},
|
||||
"strncat": {},
|
||||
"strncmp": {},
|
||||
"strncpy": {},
|
||||
"strnlen": {},
|
||||
"strpbrk": {},
|
||||
"strrchr": {},
|
||||
"strspn": {},
|
||||
"strstr": {},
|
||||
"strtod": {},
|
||||
"strtof": {},
|
||||
"strtoimax": {},
|
||||
"strtok": {},
|
||||
"strtol": {},
|
||||
"strtold": {},
|
||||
"strtoll": {},
|
||||
"strtoul": {},
|
||||
"strtoull": {},
|
||||
"strtoumax": {},
|
||||
"symlink": {},
|
||||
"symlinkat": {},
|
||||
"sysconf": {},
|
||||
"system": {},
|
||||
"tan": {},
|
||||
"tanh": {},
|
||||
"tcgetattr": {},
|
||||
"tcsendbreak": {},
|
||||
"tcsetattr": {},
|
||||
"time": {},
|
||||
"tmpfile": {},
|
||||
"tolower": {},
|
||||
"toupper": {},
|
||||
"trunc": {},
|
||||
"tzset": {},
|
||||
"umask": {},
|
||||
"uname": {},
|
||||
"ungetc": {},
|
||||
"unlink": {},
|
||||
"unlinkat": {},
|
||||
"unsetenv": {},
|
||||
"usleep": {},
|
||||
"utime": {},
|
||||
"utimensat": {},
|
||||
"utimes": {},
|
||||
"uuid_copy": {},
|
||||
"uuid_generate_random": {},
|
||||
"uuid_parse": {},
|
||||
"uuid_unparse": {},
|
||||
"vasprintf": {},
|
||||
"vfprintf": {},
|
||||
"vfscanf": {},
|
||||
"vprintf": {},
|
||||
"vsnprintf": {},
|
||||
"vsprintf": {},
|
||||
"vsscanf": {},
|
||||
"waitpid": {},
|
||||
"wcschr": {},
|
||||
"wctomb": {},
|
||||
"wcwidth": {},
|
||||
"write": {},
|
||||
"writev": {},
|
||||
"zero_struct_address": {},
|
||||
}
|
528
vendor/modernc.org/libc/capi_linux_mips64le.go
generated
vendored
Normal file
528
vendor/modernc.org/libc/capi_linux_mips64le.go
generated
vendored
Normal file
|
@ -0,0 +1,528 @@
|
|||
// Code generated by 'go generate' - DO NOT EDIT.
|
||||
|
||||
package libc // import "modernc.org/libc"
|
||||
|
||||
var CAPI = map[string]struct{}{
|
||||
"_IO_putc": {},
|
||||
"___errno_location": {},
|
||||
"__assert_fail": {},
|
||||
"__builtin___memcpy_chk": {},
|
||||
"__builtin___memmove_chk": {},
|
||||
"__builtin___memset_chk": {},
|
||||
"__builtin___snprintf_chk": {},
|
||||
"__builtin___sprintf_chk": {},
|
||||
"__builtin___strcat_chk": {},
|
||||
"__builtin___strcpy_chk": {},
|
||||
"__builtin___strncpy_chk": {},
|
||||
"__builtin___vsnprintf_chk": {},
|
||||
"__builtin_abort": {},
|
||||
"__builtin_abs": {},
|
||||
"__builtin_add_overflowInt64": {},
|
||||
"__builtin_add_overflowUint32": {},
|
||||
"__builtin_add_overflowUint64": {},
|
||||
"__builtin_bswap16": {},
|
||||
"__builtin_bswap32": {},
|
||||
"__builtin_bswap64": {},
|
||||
"__builtin_bzero": {},
|
||||
"__builtin_clz": {},
|
||||
"__builtin_clzl": {},
|
||||
"__builtin_clzll": {},
|
||||
"__builtin_constant_p_impl": {},
|
||||
"__builtin_copysign": {},
|
||||
"__builtin_copysignf": {},
|
||||
"__builtin_copysignl": {},
|
||||
"__builtin_exit": {},
|
||||
"__builtin_expect": {},
|
||||
"__builtin_fabs": {},
|
||||
"__builtin_fabsf": {},
|
||||
"__builtin_fabsl": {},
|
||||
"__builtin_free": {},
|
||||
"__builtin_getentropy": {},
|
||||
"__builtin_huge_val": {},
|
||||
"__builtin_huge_valf": {},
|
||||
"__builtin_inf": {},
|
||||
"__builtin_inff": {},
|
||||
"__builtin_infl": {},
|
||||
"__builtin_isnan": {},
|
||||
"__builtin_isunordered": {},
|
||||
"__builtin_llabs": {},
|
||||
"__builtin_malloc": {},
|
||||
"__builtin_memcmp": {},
|
||||
"__builtin_memcpy": {},
|
||||
"__builtin_memset": {},
|
||||
"__builtin_mmap": {},
|
||||
"__builtin_mul_overflowInt64": {},
|
||||
"__builtin_mul_overflowUint128": {},
|
||||
"__builtin_mul_overflowUint64": {},
|
||||
"__builtin_nan": {},
|
||||
"__builtin_nanf": {},
|
||||
"__builtin_nanl": {},
|
||||
"__builtin_object_size": {},
|
||||
"__builtin_popcount": {},
|
||||
"__builtin_popcountl": {},
|
||||
"__builtin_prefetch": {},
|
||||
"__builtin_printf": {},
|
||||
"__builtin_snprintf": {},
|
||||
"__builtin_sprintf": {},
|
||||
"__builtin_strchr": {},
|
||||
"__builtin_strcmp": {},
|
||||
"__builtin_strcpy": {},
|
||||
"__builtin_strlen": {},
|
||||
"__builtin_sub_overflowInt64": {},
|
||||
"__builtin_trap": {},
|
||||
"__builtin_unreachable": {},
|
||||
"__ccgo_dmesg": {},
|
||||
"__ccgo_getMutexType": {},
|
||||
"__ccgo_in6addr_anyp": {},
|
||||
"__ccgo_pthreadAttrGetDetachState": {},
|
||||
"__ccgo_pthreadMutexattrGettype": {},
|
||||
"__ccgo_sqlite3_log": {},
|
||||
"__cmsg_nxthdr": {},
|
||||
"__ctype_b_loc": {},
|
||||
"__ctype_get_mb_cur_max": {},
|
||||
"__errno_location": {},
|
||||
"__floatscan": {},
|
||||
"__fpclassify": {},
|
||||
"__fpclassifyf": {},
|
||||
"__fpclassifyl": {},
|
||||
"__fsmu8": {},
|
||||
"__h_errno_location": {},
|
||||
"__inet_aton": {},
|
||||
"__intscan": {},
|
||||
"__isalnum_l": {},
|
||||
"__isalpha_l": {},
|
||||
"__isdigit_l": {},
|
||||
"__islower_l": {},
|
||||
"__isnan": {},
|
||||
"__isnanf": {},
|
||||
"__isnanl": {},
|
||||
"__isoc99_sscanf": {},
|
||||
"__isprint_l": {},
|
||||
"__isupper_l": {},
|
||||
"__isxdigit_l": {},
|
||||
"__lockfile": {},
|
||||
"__lookup_ipliteral": {},
|
||||
"__lookup_name": {},
|
||||
"__lookup_serv": {},
|
||||
"__shgetc": {},
|
||||
"__shlim": {},
|
||||
"__strncasecmp_l": {},
|
||||
"__sync_add_and_fetch_uint32": {},
|
||||
"__sync_sub_and_fetch_uint32": {},
|
||||
"__syscall1": {},
|
||||
"__syscall3": {},
|
||||
"__syscall4": {},
|
||||
"__toread": {},
|
||||
"__toread_needs_stdio_exit": {},
|
||||
"__uflow": {},
|
||||
"__unlockfile": {},
|
||||
"_exit": {},
|
||||
"_longjmp": {},
|
||||
"_obstack_begin": {},
|
||||
"_obstack_newchunk": {},
|
||||
"_setjmp": {},
|
||||
"abort": {},
|
||||
"abs": {},
|
||||
"accept": {},
|
||||
"access": {},
|
||||
"acos": {},
|
||||
"acosh": {},
|
||||
"alarm": {},
|
||||
"asin": {},
|
||||
"asinh": {},
|
||||
"atan": {},
|
||||
"atan2": {},
|
||||
"atanh": {},
|
||||
"atexit": {},
|
||||
"atof": {},
|
||||
"atoi": {},
|
||||
"atol": {},
|
||||
"backtrace": {},
|
||||
"backtrace_symbols_fd": {},
|
||||
"bind": {},
|
||||
"bsearch": {},
|
||||
"bzero": {},
|
||||
"calloc": {},
|
||||
"ceil": {},
|
||||
"ceilf": {},
|
||||
"cfgetospeed": {},
|
||||
"cfsetispeed": {},
|
||||
"cfsetospeed": {},
|
||||
"chdir": {},
|
||||
"chmod": {},
|
||||
"chown": {},
|
||||
"clock_gettime": {},
|
||||
"close": {},
|
||||
"closedir": {},
|
||||
"confstr": {},
|
||||
"connect": {},
|
||||
"copysign": {},
|
||||
"copysignf": {},
|
||||
"copysignl": {},
|
||||
"cos": {},
|
||||
"cosf": {},
|
||||
"cosh": {},
|
||||
"ctime": {},
|
||||
"ctime_r": {},
|
||||
"dlclose": {},
|
||||
"dlerror": {},
|
||||
"dlopen": {},
|
||||
"dlsym": {},
|
||||
"dup2": {},
|
||||
"dup3": {},
|
||||
"endpwent": {},
|
||||
"environ": {},
|
||||
"execvp": {},
|
||||
"exit": {},
|
||||
"exp": {},
|
||||
"fabs": {},
|
||||
"fabsf": {},
|
||||
"fabsl": {},
|
||||
"faccessat": {},
|
||||
"fchmod": {},
|
||||
"fchmodat": {},
|
||||
"fchown": {},
|
||||
"fchownat": {},
|
||||
"fclose": {},
|
||||
"fcntl": {},
|
||||
"fcntl64": {},
|
||||
"fdopen": {},
|
||||
"ferror": {},
|
||||
"fflush": {},
|
||||
"fgetc": {},
|
||||
"fgets": {},
|
||||
"fileno": {},
|
||||
"floor": {},
|
||||
"fmod": {},
|
||||
"fmodl": {},
|
||||
"fopen": {},
|
||||
"fopen64": {},
|
||||
"fork": {},
|
||||
"fprintf": {},
|
||||
"fputc": {},
|
||||
"fputs": {},
|
||||
"fread": {},
|
||||
"free": {},
|
||||
"freeaddrinfo": {},
|
||||
"frexp": {},
|
||||
"fscanf": {},
|
||||
"fseek": {},
|
||||
"fstat": {},
|
||||
"fstat64": {},
|
||||
"fstatfs": {},
|
||||
"fsync": {},
|
||||
"ftell": {},
|
||||
"ftruncate": {},
|
||||
"ftruncate64": {},
|
||||
"fts64_close": {},
|
||||
"fts64_open": {},
|
||||
"fts64_read": {},
|
||||
"fts_close": {},
|
||||
"fts_open": {},
|
||||
"fts_read": {},
|
||||
"fwrite": {},
|
||||
"gai_strerror": {},
|
||||
"getaddrinfo": {},
|
||||
"getc": {},
|
||||
"getcwd": {},
|
||||
"getegid": {},
|
||||
"getentropy": {},
|
||||
"getenv": {},
|
||||
"geteuid": {},
|
||||
"getgid": {},
|
||||
"getgrgid": {},
|
||||
"getgrgid_r": {},
|
||||
"getgrnam": {},
|
||||
"getgrnam_r": {},
|
||||
"gethostbyaddr": {},
|
||||
"gethostbyaddr_r": {},
|
||||
"gethostbyname": {},
|
||||
"gethostbyname2": {},
|
||||
"gethostbyname2_r": {},
|
||||
"gethostbyname_r": {},
|
||||
"gethostname": {},
|
||||
"getnameinfo": {},
|
||||
"getpeername": {},
|
||||
"getpid": {},
|
||||
"getpwnam": {},
|
||||
"getpwnam_r": {},
|
||||
"getpwuid": {},
|
||||
"getpwuid_r": {},
|
||||
"getrandom": {},
|
||||
"getresgid": {},
|
||||
"getresuid": {},
|
||||
"getrlimit": {},
|
||||
"getrlimit64": {},
|
||||
"getrusage": {},
|
||||
"getservbyname": {},
|
||||
"getsockname": {},
|
||||
"getsockopt": {},
|
||||
"gettimeofday": {},
|
||||
"getuid": {},
|
||||
"gmtime_r": {},
|
||||
"h_errno": {},
|
||||
"htonl": {},
|
||||
"htons": {},
|
||||
"hypot": {},
|
||||
"inet_ntoa": {},
|
||||
"inet_ntop": {},
|
||||
"inet_pton": {},
|
||||
"initstate": {},
|
||||
"initstate_r": {},
|
||||
"ioctl": {},
|
||||
"isalnum": {},
|
||||
"isalpha": {},
|
||||
"isascii": {},
|
||||
"isatty": {},
|
||||
"isdigit": {},
|
||||
"islower": {},
|
||||
"isnan": {},
|
||||
"isnanf": {},
|
||||
"isnanl": {},
|
||||
"isprint": {},
|
||||
"isupper": {},
|
||||
"iswalnum": {},
|
||||
"iswspace": {},
|
||||
"isxdigit": {},
|
||||
"kill": {},
|
||||
"ldexp": {},
|
||||
"link": {},
|
||||
"linkat": {},
|
||||
"listen": {},
|
||||
"llabs": {},
|
||||
"localeconv": {},
|
||||
"localtime": {},
|
||||
"localtime_r": {},
|
||||
"log": {},
|
||||
"log10": {},
|
||||
"log2": {},
|
||||
"longjmp": {},
|
||||
"lrand48": {},
|
||||
"lseek": {},
|
||||
"lseek64": {},
|
||||
"lstat": {},
|
||||
"lstat64": {},
|
||||
"malloc": {},
|
||||
"mblen": {},
|
||||
"mbrtowc": {},
|
||||
"mbsinit": {},
|
||||
"mbstowcs": {},
|
||||
"mbtowc": {},
|
||||
"memchr": {},
|
||||
"memcmp": {},
|
||||
"memcpy": {},
|
||||
"memmove": {},
|
||||
"memset": {},
|
||||
"mkdir": {},
|
||||
"mkdirat": {},
|
||||
"mkfifo": {},
|
||||
"mknod": {},
|
||||
"mknodat": {},
|
||||
"mkostemp": {},
|
||||
"mkstemp": {},
|
||||
"mkstemp64": {},
|
||||
"mkstemps": {},
|
||||
"mkstemps64": {},
|
||||
"mktime": {},
|
||||
"mmap": {},
|
||||
"mmap64": {},
|
||||
"modf": {},
|
||||
"mremap": {},
|
||||
"munmap": {},
|
||||
"nanf": {},
|
||||
"nanosleep": {},
|
||||
"nl_langinfo": {},
|
||||
"ntohs": {},
|
||||
"obstack_free": {},
|
||||
"obstack_vprintf": {},
|
||||
"open": {},
|
||||
"open64": {},
|
||||
"openat": {},
|
||||
"opendir": {},
|
||||
"openpty": {},
|
||||
"pathconf": {},
|
||||
"pause": {},
|
||||
"pclose": {},
|
||||
"perror": {},
|
||||
"pipe": {},
|
||||
"pipe2": {},
|
||||
"poll": {},
|
||||
"popen": {},
|
||||
"posix_fadvise": {},
|
||||
"pow": {},
|
||||
"pread": {},
|
||||
"printf": {},
|
||||
"pselect": {},
|
||||
"pthread_attr_destroy": {},
|
||||
"pthread_attr_getdetachstate": {},
|
||||
"pthread_attr_init": {},
|
||||
"pthread_attr_setdetachstate": {},
|
||||
"pthread_attr_setscope": {},
|
||||
"pthread_attr_setstacksize": {},
|
||||
"pthread_cond_broadcast": {},
|
||||
"pthread_cond_destroy": {},
|
||||
"pthread_cond_init": {},
|
||||
"pthread_cond_signal": {},
|
||||
"pthread_cond_timedwait": {},
|
||||
"pthread_cond_wait": {},
|
||||
"pthread_create": {},
|
||||
"pthread_detach": {},
|
||||
"pthread_equal": {},
|
||||
"pthread_exit": {},
|
||||
"pthread_getspecific": {},
|
||||
"pthread_join": {},
|
||||
"pthread_key_create": {},
|
||||
"pthread_key_delete": {},
|
||||
"pthread_mutex_destroy": {},
|
||||
"pthread_mutex_init": {},
|
||||
"pthread_mutex_lock": {},
|
||||
"pthread_mutex_trylock": {},
|
||||
"pthread_mutex_unlock": {},
|
||||
"pthread_mutexattr_destroy": {},
|
||||
"pthread_mutexattr_init": {},
|
||||
"pthread_mutexattr_settype": {},
|
||||
"pthread_self": {},
|
||||
"pthread_setspecific": {},
|
||||
"putc": {},
|
||||
"putchar": {},
|
||||
"puts": {},
|
||||
"pwrite": {},
|
||||
"qsort": {},
|
||||
"raise": {},
|
||||
"rand": {},
|
||||
"rand_r": {},
|
||||
"random": {},
|
||||
"random_r": {},
|
||||
"read": {},
|
||||
"readdir": {},
|
||||
"readdir64": {},
|
||||
"readlink": {},
|
||||
"readlinkat": {},
|
||||
"readv": {},
|
||||
"realloc": {},
|
||||
"reallocarray": {},
|
||||
"realpath": {},
|
||||
"recv": {},
|
||||
"recvfrom": {},
|
||||
"recvmsg": {},
|
||||
"remove": {},
|
||||
"rename": {},
|
||||
"renameat2": {},
|
||||
"rewind": {},
|
||||
"rindex": {},
|
||||
"rint": {},
|
||||
"rmdir": {},
|
||||
"round": {},
|
||||
"scalbn": {},
|
||||
"scalbnl": {},
|
||||
"sched_yield": {},
|
||||
"select": {},
|
||||
"send": {},
|
||||
"sendmsg": {},
|
||||
"sendto": {},
|
||||
"setbuf": {},
|
||||
"setenv": {},
|
||||
"setjmp": {},
|
||||
"setlocale": {},
|
||||
"setrlimit": {},
|
||||
"setrlimit64": {},
|
||||
"setsid": {},
|
||||
"setsockopt": {},
|
||||
"setstate": {},
|
||||
"setvbuf": {},
|
||||
"shmat": {},
|
||||
"shmctl": {},
|
||||
"shmdt": {},
|
||||
"shutdown": {},
|
||||
"sigaction": {},
|
||||
"signal": {},
|
||||
"sin": {},
|
||||
"sinf": {},
|
||||
"sinh": {},
|
||||
"sleep": {},
|
||||
"snprintf": {},
|
||||
"socket": {},
|
||||
"sprintf": {},
|
||||
"sqrt": {},
|
||||
"srand48": {},
|
||||
"sscanf": {},
|
||||
"stat": {},
|
||||
"stat64": {},
|
||||
"stderr": {},
|
||||
"stdin": {},
|
||||
"stdout": {},
|
||||
"strcasecmp": {},
|
||||
"strcat": {},
|
||||
"strchr": {},
|
||||
"strcmp": {},
|
||||
"strcpy": {},
|
||||
"strcspn": {},
|
||||
"strdup": {},
|
||||
"strerror": {},
|
||||
"strerror_r": {},
|
||||
"strlcat": {},
|
||||
"strlcpy": {},
|
||||
"strlen": {},
|
||||
"strncasecmp": {},
|
||||
"strncat": {},
|
||||
"strncmp": {},
|
||||
"strncpy": {},
|
||||
"strnlen": {},
|
||||
"strpbrk": {},
|
||||
"strrchr": {},
|
||||
"strspn": {},
|
||||
"strstr": {},
|
||||
"strtod": {},
|
||||
"strtof": {},
|
||||
"strtoimax": {},
|
||||
"strtok": {},
|
||||
"strtol": {},
|
||||
"strtold": {},
|
||||
"strtoll": {},
|
||||
"strtoul": {},
|
||||
"strtoull": {},
|
||||
"strtoumax": {},
|
||||
"symlink": {},
|
||||
"symlinkat": {},
|
||||
"sysconf": {},
|
||||
"system": {},
|
||||
"tan": {},
|
||||
"tanh": {},
|
||||
"tcgetattr": {},
|
||||
"tcsendbreak": {},
|
||||
"tcsetattr": {},
|
||||
"time": {},
|
||||
"tmpfile": {},
|
||||
"tolower": {},
|
||||
"toupper": {},
|
||||
"trunc": {},
|
||||
"tzset": {},
|
||||
"umask": {},
|
||||
"uname": {},
|
||||
"ungetc": {},
|
||||
"unlink": {},
|
||||
"unlinkat": {},
|
||||
"unsetenv": {},
|
||||
"usleep": {},
|
||||
"utime": {},
|
||||
"utimensat": {},
|
||||
"utimes": {},
|
||||
"uuid_copy": {},
|
||||
"uuid_generate_random": {},
|
||||
"uuid_parse": {},
|
||||
"uuid_unparse": {},
|
||||
"vasprintf": {},
|
||||
"vfprintf": {},
|
||||
"vfscanf": {},
|
||||
"vprintf": {},
|
||||
"vsnprintf": {},
|
||||
"vsprintf": {},
|
||||
"vsscanf": {},
|
||||
"waitpid": {},
|
||||
"wcschr": {},
|
||||
"wctomb": {},
|
||||
"wcwidth": {},
|
||||
"write": {},
|
||||
"writev": {},
|
||||
"zero_struct_address": {},
|
||||
}
|
528
vendor/modernc.org/libc/capi_linux_ppc64le.go
generated
vendored
Normal file
528
vendor/modernc.org/libc/capi_linux_ppc64le.go
generated
vendored
Normal file
|
@ -0,0 +1,528 @@
|
|||
// Code generated by 'go generate' - DO NOT EDIT.
|
||||
|
||||
package libc // import "modernc.org/libc"
|
||||
|
||||
var CAPI = map[string]struct{}{
|
||||
"_IO_putc": {},
|
||||
"___errno_location": {},
|
||||
"__assert_fail": {},
|
||||
"__builtin___memcpy_chk": {},
|
||||
"__builtin___memmove_chk": {},
|
||||
"__builtin___memset_chk": {},
|
||||
"__builtin___snprintf_chk": {},
|
||||
"__builtin___sprintf_chk": {},
|
||||
"__builtin___strcat_chk": {},
|
||||
"__builtin___strcpy_chk": {},
|
||||
"__builtin___strncpy_chk": {},
|
||||
"__builtin___vsnprintf_chk": {},
|
||||
"__builtin_abort": {},
|
||||
"__builtin_abs": {},
|
||||
"__builtin_add_overflowInt64": {},
|
||||
"__builtin_add_overflowUint32": {},
|
||||
"__builtin_add_overflowUint64": {},
|
||||
"__builtin_bswap16": {},
|
||||
"__builtin_bswap32": {},
|
||||
"__builtin_bswap64": {},
|
||||
"__builtin_bzero": {},
|
||||
"__builtin_clz": {},
|
||||
"__builtin_clzl": {},
|
||||
"__builtin_clzll": {},
|
||||
"__builtin_constant_p_impl": {},
|
||||
"__builtin_copysign": {},
|
||||
"__builtin_copysignf": {},
|
||||
"__builtin_copysignl": {},
|
||||
"__builtin_exit": {},
|
||||
"__builtin_expect": {},
|
||||
"__builtin_fabs": {},
|
||||
"__builtin_fabsf": {},
|
||||
"__builtin_fabsl": {},
|
||||
"__builtin_free": {},
|
||||
"__builtin_getentropy": {},
|
||||
"__builtin_huge_val": {},
|
||||
"__builtin_huge_valf": {},
|
||||
"__builtin_inf": {},
|
||||
"__builtin_inff": {},
|
||||
"__builtin_infl": {},
|
||||
"__builtin_isnan": {},
|
||||
"__builtin_isunordered": {},
|
||||
"__builtin_llabs": {},
|
||||
"__builtin_malloc": {},
|
||||
"__builtin_memcmp": {},
|
||||
"__builtin_memcpy": {},
|
||||
"__builtin_memset": {},
|
||||
"__builtin_mmap": {},
|
||||
"__builtin_mul_overflowInt64": {},
|
||||
"__builtin_mul_overflowUint128": {},
|
||||
"__builtin_mul_overflowUint64": {},
|
||||
"__builtin_nan": {},
|
||||
"__builtin_nanf": {},
|
||||
"__builtin_nanl": {},
|
||||
"__builtin_object_size": {},
|
||||
"__builtin_popcount": {},
|
||||
"__builtin_popcountl": {},
|
||||
"__builtin_prefetch": {},
|
||||
"__builtin_printf": {},
|
||||
"__builtin_snprintf": {},
|
||||
"__builtin_sprintf": {},
|
||||
"__builtin_strchr": {},
|
||||
"__builtin_strcmp": {},
|
||||
"__builtin_strcpy": {},
|
||||
"__builtin_strlen": {},
|
||||
"__builtin_sub_overflowInt64": {},
|
||||
"__builtin_trap": {},
|
||||
"__builtin_unreachable": {},
|
||||
"__ccgo_dmesg": {},
|
||||
"__ccgo_getMutexType": {},
|
||||
"__ccgo_in6addr_anyp": {},
|
||||
"__ccgo_pthreadAttrGetDetachState": {},
|
||||
"__ccgo_pthreadMutexattrGettype": {},
|
||||
"__ccgo_sqlite3_log": {},
|
||||
"__cmsg_nxthdr": {},
|
||||
"__ctype_b_loc": {},
|
||||
"__ctype_get_mb_cur_max": {},
|
||||
"__errno_location": {},
|
||||
"__floatscan": {},
|
||||
"__fpclassify": {},
|
||||
"__fpclassifyf": {},
|
||||
"__fpclassifyl": {},
|
||||
"__fsmu8": {},
|
||||
"__h_errno_location": {},
|
||||
"__inet_aton": {},
|
||||
"__intscan": {},
|
||||
"__isalnum_l": {},
|
||||
"__isalpha_l": {},
|
||||
"__isdigit_l": {},
|
||||
"__islower_l": {},
|
||||
"__isnan": {},
|
||||
"__isnanf": {},
|
||||
"__isnanl": {},
|
||||
"__isoc99_sscanf": {},
|
||||
"__isprint_l": {},
|
||||
"__isupper_l": {},
|
||||
"__isxdigit_l": {},
|
||||
"__lockfile": {},
|
||||
"__lookup_ipliteral": {},
|
||||
"__lookup_name": {},
|
||||
"__lookup_serv": {},
|
||||
"__shgetc": {},
|
||||
"__shlim": {},
|
||||
"__strncasecmp_l": {},
|
||||
"__sync_add_and_fetch_uint32": {},
|
||||
"__sync_sub_and_fetch_uint32": {},
|
||||
"__syscall1": {},
|
||||
"__syscall3": {},
|
||||
"__syscall4": {},
|
||||
"__toread": {},
|
||||
"__toread_needs_stdio_exit": {},
|
||||
"__uflow": {},
|
||||
"__unlockfile": {},
|
||||
"_exit": {},
|
||||
"_longjmp": {},
|
||||
"_obstack_begin": {},
|
||||
"_obstack_newchunk": {},
|
||||
"_setjmp": {},
|
||||
"abort": {},
|
||||
"abs": {},
|
||||
"accept": {},
|
||||
"access": {},
|
||||
"acos": {},
|
||||
"acosh": {},
|
||||
"alarm": {},
|
||||
"asin": {},
|
||||
"asinh": {},
|
||||
"atan": {},
|
||||
"atan2": {},
|
||||
"atanh": {},
|
||||
"atexit": {},
|
||||
"atof": {},
|
||||
"atoi": {},
|
||||
"atol": {},
|
||||
"backtrace": {},
|
||||
"backtrace_symbols_fd": {},
|
||||
"bind": {},
|
||||
"bsearch": {},
|
||||
"bzero": {},
|
||||
"calloc": {},
|
||||
"ceil": {},
|
||||
"ceilf": {},
|
||||
"cfgetospeed": {},
|
||||
"cfsetispeed": {},
|
||||
"cfsetospeed": {},
|
||||
"chdir": {},
|
||||
"chmod": {},
|
||||
"chown": {},
|
||||
"clock_gettime": {},
|
||||
"close": {},
|
||||
"closedir": {},
|
||||
"confstr": {},
|
||||
"connect": {},
|
||||
"copysign": {},
|
||||
"copysignf": {},
|
||||
"copysignl": {},
|
||||
"cos": {},
|
||||
"cosf": {},
|
||||
"cosh": {},
|
||||
"ctime": {},
|
||||
"ctime_r": {},
|
||||
"dlclose": {},
|
||||
"dlerror": {},
|
||||
"dlopen": {},
|
||||
"dlsym": {},
|
||||
"dup2": {},
|
||||
"dup3": {},
|
||||
"endpwent": {},
|
||||
"environ": {},
|
||||
"execvp": {},
|
||||
"exit": {},
|
||||
"exp": {},
|
||||
"fabs": {},
|
||||
"fabsf": {},
|
||||
"fabsl": {},
|
||||
"faccessat": {},
|
||||
"fchmod": {},
|
||||
"fchmodat": {},
|
||||
"fchown": {},
|
||||
"fchownat": {},
|
||||
"fclose": {},
|
||||
"fcntl": {},
|
||||
"fcntl64": {},
|
||||
"fdopen": {},
|
||||
"ferror": {},
|
||||
"fflush": {},
|
||||
"fgetc": {},
|
||||
"fgets": {},
|
||||
"fileno": {},
|
||||
"floor": {},
|
||||
"fmod": {},
|
||||
"fmodl": {},
|
||||
"fopen": {},
|
||||
"fopen64": {},
|
||||
"fork": {},
|
||||
"fprintf": {},
|
||||
"fputc": {},
|
||||
"fputs": {},
|
||||
"fread": {},
|
||||
"free": {},
|
||||
"freeaddrinfo": {},
|
||||
"frexp": {},
|
||||
"fscanf": {},
|
||||
"fseek": {},
|
||||
"fstat": {},
|
||||
"fstat64": {},
|
||||
"fstatfs": {},
|
||||
"fsync": {},
|
||||
"ftell": {},
|
||||
"ftruncate": {},
|
||||
"ftruncate64": {},
|
||||
"fts64_close": {},
|
||||
"fts64_open": {},
|
||||
"fts64_read": {},
|
||||
"fts_close": {},
|
||||
"fts_open": {},
|
||||
"fts_read": {},
|
||||
"fwrite": {},
|
||||
"gai_strerror": {},
|
||||
"getaddrinfo": {},
|
||||
"getc": {},
|
||||
"getcwd": {},
|
||||
"getegid": {},
|
||||
"getentropy": {},
|
||||
"getenv": {},
|
||||
"geteuid": {},
|
||||
"getgid": {},
|
||||
"getgrgid": {},
|
||||
"getgrgid_r": {},
|
||||
"getgrnam": {},
|
||||
"getgrnam_r": {},
|
||||
"gethostbyaddr": {},
|
||||
"gethostbyaddr_r": {},
|
||||
"gethostbyname": {},
|
||||
"gethostbyname2": {},
|
||||
"gethostbyname2_r": {},
|
||||
"gethostbyname_r": {},
|
||||
"gethostname": {},
|
||||
"getnameinfo": {},
|
||||
"getpeername": {},
|
||||
"getpid": {},
|
||||
"getpwnam": {},
|
||||
"getpwnam_r": {},
|
||||
"getpwuid": {},
|
||||
"getpwuid_r": {},
|
||||
"getrandom": {},
|
||||
"getresgid": {},
|
||||
"getresuid": {},
|
||||
"getrlimit": {},
|
||||
"getrlimit64": {},
|
||||
"getrusage": {},
|
||||
"getservbyname": {},
|
||||
"getsockname": {},
|
||||
"getsockopt": {},
|
||||
"gettimeofday": {},
|
||||
"getuid": {},
|
||||
"gmtime_r": {},
|
||||
"h_errno": {},
|
||||
"htonl": {},
|
||||
"htons": {},
|
||||
"hypot": {},
|
||||
"inet_ntoa": {},
|
||||
"inet_ntop": {},
|
||||
"inet_pton": {},
|
||||
"initstate": {},
|
||||
"initstate_r": {},
|
||||
"ioctl": {},
|
||||
"isalnum": {},
|
||||
"isalpha": {},
|
||||
"isascii": {},
|
||||
"isatty": {},
|
||||
"isdigit": {},
|
||||
"islower": {},
|
||||
"isnan": {},
|
||||
"isnanf": {},
|
||||
"isnanl": {},
|
||||
"isprint": {},
|
||||
"isupper": {},
|
||||
"iswalnum": {},
|
||||
"iswspace": {},
|
||||
"isxdigit": {},
|
||||
"kill": {},
|
||||
"ldexp": {},
|
||||
"link": {},
|
||||
"linkat": {},
|
||||
"listen": {},
|
||||
"llabs": {},
|
||||
"localeconv": {},
|
||||
"localtime": {},
|
||||
"localtime_r": {},
|
||||
"log": {},
|
||||
"log10": {},
|
||||
"log2": {},
|
||||
"longjmp": {},
|
||||
"lrand48": {},
|
||||
"lseek": {},
|
||||
"lseek64": {},
|
||||
"lstat": {},
|
||||
"lstat64": {},
|
||||
"malloc": {},
|
||||
"mblen": {},
|
||||
"mbrtowc": {},
|
||||
"mbsinit": {},
|
||||
"mbstowcs": {},
|
||||
"mbtowc": {},
|
||||
"memchr": {},
|
||||
"memcmp": {},
|
||||
"memcpy": {},
|
||||
"memmove": {},
|
||||
"memset": {},
|
||||
"mkdir": {},
|
||||
"mkdirat": {},
|
||||
"mkfifo": {},
|
||||
"mknod": {},
|
||||
"mknodat": {},
|
||||
"mkostemp": {},
|
||||
"mkstemp": {},
|
||||
"mkstemp64": {},
|
||||
"mkstemps": {},
|
||||
"mkstemps64": {},
|
||||
"mktime": {},
|
||||
"mmap": {},
|
||||
"mmap64": {},
|
||||
"modf": {},
|
||||
"mremap": {},
|
||||
"munmap": {},
|
||||
"nanf": {},
|
||||
"nanosleep": {},
|
||||
"nl_langinfo": {},
|
||||
"ntohs": {},
|
||||
"obstack_free": {},
|
||||
"obstack_vprintf": {},
|
||||
"open": {},
|
||||
"open64": {},
|
||||
"openat": {},
|
||||
"opendir": {},
|
||||
"openpty": {},
|
||||
"pathconf": {},
|
||||
"pause": {},
|
||||
"pclose": {},
|
||||
"perror": {},
|
||||
"pipe": {},
|
||||
"pipe2": {},
|
||||
"poll": {},
|
||||
"popen": {},
|
||||
"posix_fadvise": {},
|
||||
"pow": {},
|
||||
"pread": {},
|
||||
"printf": {},
|
||||
"pselect": {},
|
||||
"pthread_attr_destroy": {},
|
||||
"pthread_attr_getdetachstate": {},
|
||||
"pthread_attr_init": {},
|
||||
"pthread_attr_setdetachstate": {},
|
||||
"pthread_attr_setscope": {},
|
||||
"pthread_attr_setstacksize": {},
|
||||
"pthread_cond_broadcast": {},
|
||||
"pthread_cond_destroy": {},
|
||||
"pthread_cond_init": {},
|
||||
"pthread_cond_signal": {},
|
||||
"pthread_cond_timedwait": {},
|
||||
"pthread_cond_wait": {},
|
||||
"pthread_create": {},
|
||||
"pthread_detach": {},
|
||||
"pthread_equal": {},
|
||||
"pthread_exit": {},
|
||||
"pthread_getspecific": {},
|
||||
"pthread_join": {},
|
||||
"pthread_key_create": {},
|
||||
"pthread_key_delete": {},
|
||||
"pthread_mutex_destroy": {},
|
||||
"pthread_mutex_init": {},
|
||||
"pthread_mutex_lock": {},
|
||||
"pthread_mutex_trylock": {},
|
||||
"pthread_mutex_unlock": {},
|
||||
"pthread_mutexattr_destroy": {},
|
||||
"pthread_mutexattr_init": {},
|
||||
"pthread_mutexattr_settype": {},
|
||||
"pthread_self": {},
|
||||
"pthread_setspecific": {},
|
||||
"putc": {},
|
||||
"putchar": {},
|
||||
"puts": {},
|
||||
"pwrite": {},
|
||||
"qsort": {},
|
||||
"raise": {},
|
||||
"rand": {},
|
||||
"rand_r": {},
|
||||
"random": {},
|
||||
"random_r": {},
|
||||
"read": {},
|
||||
"readdir": {},
|
||||
"readdir64": {},
|
||||
"readlink": {},
|
||||
"readlinkat": {},
|
||||
"readv": {},
|
||||
"realloc": {},
|
||||
"reallocarray": {},
|
||||
"realpath": {},
|
||||
"recv": {},
|
||||
"recvfrom": {},
|
||||
"recvmsg": {},
|
||||
"remove": {},
|
||||
"rename": {},
|
||||
"renameat2": {},
|
||||
"rewind": {},
|
||||
"rindex": {},
|
||||
"rint": {},
|
||||
"rmdir": {},
|
||||
"round": {},
|
||||
"scalbn": {},
|
||||
"scalbnl": {},
|
||||
"sched_yield": {},
|
||||
"select": {},
|
||||
"send": {},
|
||||
"sendmsg": {},
|
||||
"sendto": {},
|
||||
"setbuf": {},
|
||||
"setenv": {},
|
||||
"setjmp": {},
|
||||
"setlocale": {},
|
||||
"setrlimit": {},
|
||||
"setrlimit64": {},
|
||||
"setsid": {},
|
||||
"setsockopt": {},
|
||||
"setstate": {},
|
||||
"setvbuf": {},
|
||||
"shmat": {},
|
||||
"shmctl": {},
|
||||
"shmdt": {},
|
||||
"shutdown": {},
|
||||
"sigaction": {},
|
||||
"signal": {},
|
||||
"sin": {},
|
||||
"sinf": {},
|
||||
"sinh": {},
|
||||
"sleep": {},
|
||||
"snprintf": {},
|
||||
"socket": {},
|
||||
"sprintf": {},
|
||||
"sqrt": {},
|
||||
"srand48": {},
|
||||
"sscanf": {},
|
||||
"stat": {},
|
||||
"stat64": {},
|
||||
"stderr": {},
|
||||
"stdin": {},
|
||||
"stdout": {},
|
||||
"strcasecmp": {},
|
||||
"strcat": {},
|
||||
"strchr": {},
|
||||
"strcmp": {},
|
||||
"strcpy": {},
|
||||
"strcspn": {},
|
||||
"strdup": {},
|
||||
"strerror": {},
|
||||
"strerror_r": {},
|
||||
"strlcat": {},
|
||||
"strlcpy": {},
|
||||
"strlen": {},
|
||||
"strncasecmp": {},
|
||||
"strncat": {},
|
||||
"strncmp": {},
|
||||
"strncpy": {},
|
||||
"strnlen": {},
|
||||
"strpbrk": {},
|
||||
"strrchr": {},
|
||||
"strspn": {},
|
||||
"strstr": {},
|
||||
"strtod": {},
|
||||
"strtof": {},
|
||||
"strtoimax": {},
|
||||
"strtok": {},
|
||||
"strtol": {},
|
||||
"strtold": {},
|
||||
"strtoll": {},
|
||||
"strtoul": {},
|
||||
"strtoull": {},
|
||||
"strtoumax": {},
|
||||
"symlink": {},
|
||||
"symlinkat": {},
|
||||
"sysconf": {},
|
||||
"system": {},
|
||||
"tan": {},
|
||||
"tanh": {},
|
||||
"tcgetattr": {},
|
||||
"tcsendbreak": {},
|
||||
"tcsetattr": {},
|
||||
"time": {},
|
||||
"tmpfile": {},
|
||||
"tolower": {},
|
||||
"toupper": {},
|
||||
"trunc": {},
|
||||
"tzset": {},
|
||||
"umask": {},
|
||||
"uname": {},
|
||||
"ungetc": {},
|
||||
"unlink": {},
|
||||
"unlinkat": {},
|
||||
"unsetenv": {},
|
||||
"usleep": {},
|
||||
"utime": {},
|
||||
"utimensat": {},
|
||||
"utimes": {},
|
||||
"uuid_copy": {},
|
||||
"uuid_generate_random": {},
|
||||
"uuid_parse": {},
|
||||
"uuid_unparse": {},
|
||||
"vasprintf": {},
|
||||
"vfprintf": {},
|
||||
"vfscanf": {},
|
||||
"vprintf": {},
|
||||
"vsnprintf": {},
|
||||
"vsprintf": {},
|
||||
"vsscanf": {},
|
||||
"waitpid": {},
|
||||
"wcschr": {},
|
||||
"wctomb": {},
|
||||
"wcwidth": {},
|
||||
"write": {},
|
||||
"writev": {},
|
||||
"zero_struct_address": {},
|
||||
}
|
514
vendor/modernc.org/libc/capi_linux_riscv64.go
generated
vendored
Normal file
514
vendor/modernc.org/libc/capi_linux_riscv64.go
generated
vendored
Normal file
|
@ -0,0 +1,514 @@
|
|||
// Code generated by 'go generate' - DO NOT EDIT.
|
||||
|
||||
package libc // import "modernc.org/libc"
|
||||
|
||||
var CAPI = map[string]struct{}{
|
||||
"_IO_putc": {},
|
||||
"___errno_location": {},
|
||||
"__assert_fail": {},
|
||||
"__builtin___memcpy_chk": {},
|
||||
"__builtin___memmove_chk": {},
|
||||
"__builtin___memset_chk": {},
|
||||
"__builtin___snprintf_chk": {},
|
||||
"__builtin___sprintf_chk": {},
|
||||
"__builtin___strcat_chk": {},
|
||||
"__builtin___strcpy_chk": {},
|
||||
"__builtin___strncpy_chk": {},
|
||||
"__builtin___vsnprintf_chk": {},
|
||||
"__builtin_abort": {},
|
||||
"__builtin_abs": {},
|
||||
"__builtin_add_overflowInt64": {},
|
||||
"__builtin_add_overflowUint32": {},
|
||||
"__builtin_add_overflowUint64": {},
|
||||
"__builtin_bswap16": {},
|
||||
"__builtin_bswap32": {},
|
||||
"__builtin_bswap64": {},
|
||||
"__builtin_bzero": {},
|
||||
"__builtin_clz": {},
|
||||
"__builtin_clzl": {},
|
||||
"__builtin_clzll": {},
|
||||
"__builtin_constant_p_impl": {},
|
||||
"__builtin_copysign": {},
|
||||
"__builtin_copysignf": {},
|
||||
"__builtin_copysignl": {},
|
||||
"__builtin_exit": {},
|
||||
"__builtin_expect": {},
|
||||
"__builtin_fabs": {},
|
||||
"__builtin_fabsf": {},
|
||||
"__builtin_fabsl": {},
|
||||
"__builtin_free": {},
|
||||
"__builtin_getentropy": {},
|
||||
"__builtin_huge_val": {},
|
||||
"__builtin_huge_valf": {},
|
||||
"__builtin_inf": {},
|
||||
"__builtin_inff": {},
|
||||
"__builtin_infl": {},
|
||||
"__builtin_isnan": {},
|
||||
"__builtin_isunordered": {},
|
||||
"__builtin_llabs": {},
|
||||
"__builtin_malloc": {},
|
||||
"__builtin_memcmp": {},
|
||||
"__builtin_memcpy": {},
|
||||
"__builtin_memset": {},
|
||||
"__builtin_mmap": {},
|
||||
"__builtin_mul_overflowInt64": {},
|
||||
"__builtin_mul_overflowUint128": {},
|
||||
"__builtin_mul_overflowUint64": {},
|
||||
"__builtin_nan": {},
|
||||
"__builtin_nanf": {},
|
||||
"__builtin_nanl": {},
|
||||
"__builtin_object_size": {},
|
||||
"__builtin_popcount": {},
|
||||
"__builtin_popcountl": {},
|
||||
"__builtin_prefetch": {},
|
||||
"__builtin_printf": {},
|
||||
"__builtin_snprintf": {},
|
||||
"__builtin_sprintf": {},
|
||||
"__builtin_strchr": {},
|
||||
"__builtin_strcmp": {},
|
||||
"__builtin_strcpy": {},
|
||||
"__builtin_strlen": {},
|
||||
"__builtin_sub_overflowInt64": {},
|
||||
"__builtin_trap": {},
|
||||
"__builtin_unreachable": {},
|
||||
"__ccgo_dmesg": {},
|
||||
"__ccgo_getMutexType": {},
|
||||
"__ccgo_in6addr_anyp": {},
|
||||
"__ccgo_pthreadAttrGetDetachState": {},
|
||||
"__ccgo_pthreadMutexattrGettype": {},
|
||||
"__ccgo_sqlite3_log": {},
|
||||
"__cmsg_nxthdr": {},
|
||||
"__ctype_b_loc": {},
|
||||
"__ctype_get_mb_cur_max": {},
|
||||
"__errno_location": {},
|
||||
"__floatscan": {},
|
||||
"__fpclassify": {},
|
||||
"__fpclassifyf": {},
|
||||
"__fpclassifyl": {},
|
||||
"__fsmu8": {},
|
||||
"__h_errno_location": {},
|
||||
"__inet_aton": {},
|
||||
"__intscan": {},
|
||||
"__isalnum_l": {},
|
||||
"__isalpha_l": {},
|
||||
"__isdigit_l": {},
|
||||
"__islower_l": {},
|
||||
"__isnan": {},
|
||||
"__isnanf": {},
|
||||
"__isnanl": {},
|
||||
"__isoc99_sscanf": {},
|
||||
"__isprint_l": {},
|
||||
"__isupper_l": {},
|
||||
"__isxdigit_l": {},
|
||||
"__lockfile": {},
|
||||
"__lookup_ipliteral": {},
|
||||
"__lookup_name": {},
|
||||
"__lookup_serv": {},
|
||||
"__shgetc": {},
|
||||
"__shlim": {},
|
||||
"__strncasecmp_l": {},
|
||||
"__sync_add_and_fetch_uint32": {},
|
||||
"__sync_sub_and_fetch_uint32": {},
|
||||
"__syscall1": {},
|
||||
"__syscall3": {},
|
||||
"__syscall4": {},
|
||||
"__toread": {},
|
||||
"__toread_needs_stdio_exit": {},
|
||||
"__uflow": {},
|
||||
"__unlockfile": {},
|
||||
"_exit": {},
|
||||
"_longjmp": {},
|
||||
"_obstack_begin": {},
|
||||
"_obstack_newchunk": {},
|
||||
"_setjmp": {},
|
||||
"abort": {},
|
||||
"abs": {},
|
||||
"accept": {},
|
||||
"access": {},
|
||||
"acos": {},
|
||||
"acosh": {},
|
||||
"alarm": {},
|
||||
"asin": {},
|
||||
"asinh": {},
|
||||
"atan": {},
|
||||
"atan2": {},
|
||||
"atanh": {},
|
||||
"atexit": {},
|
||||
"atof": {},
|
||||
"atoi": {},
|
||||
"atol": {},
|
||||
"backtrace": {},
|
||||
"backtrace_symbols_fd": {},
|
||||
"bind": {},
|
||||
"bsearch": {},
|
||||
"bzero": {},
|
||||
"calloc": {},
|
||||
"ceil": {},
|
||||
"ceilf": {},
|
||||
"cfgetospeed": {},
|
||||
"cfsetispeed": {},
|
||||
"cfsetospeed": {},
|
||||
"chdir": {},
|
||||
"chmod": {},
|
||||
"chown": {},
|
||||
"clock_gettime": {},
|
||||
"close": {},
|
||||
"closedir": {},
|
||||
"confstr": {},
|
||||
"connect": {},
|
||||
"copysign": {},
|
||||
"copysignf": {},
|
||||
"copysignl": {},
|
||||
"cos": {},
|
||||
"cosf": {},
|
||||
"cosh": {},
|
||||
"ctime": {},
|
||||
"ctime_r": {},
|
||||
"dlclose": {},
|
||||
"dlerror": {},
|
||||
"dlopen": {},
|
||||
"dlsym": {},
|
||||
"dup2": {},
|
||||
"endpwent": {},
|
||||
"environ": {},
|
||||
"execvp": {},
|
||||
"exit": {},
|
||||
"exp": {},
|
||||
"fabs": {},
|
||||
"fabsf": {},
|
||||
"fabsl": {},
|
||||
"fchmod": {},
|
||||
"fchown": {},
|
||||
"fclose": {},
|
||||
"fcntl": {},
|
||||
"fcntl64": {},
|
||||
"fdopen": {},
|
||||
"ferror": {},
|
||||
"fflush": {},
|
||||
"fgetc": {},
|
||||
"fgets": {},
|
||||
"fileno": {},
|
||||
"floor": {},
|
||||
"fmod": {},
|
||||
"fmodl": {},
|
||||
"fopen": {},
|
||||
"fopen64": {},
|
||||
"fork": {},
|
||||
"fprintf": {},
|
||||
"fputc": {},
|
||||
"fputs": {},
|
||||
"fread": {},
|
||||
"free": {},
|
||||
"freeaddrinfo": {},
|
||||
"frexp": {},
|
||||
"fscanf": {},
|
||||
"fseek": {},
|
||||
"fstat": {},
|
||||
"fstat64": {},
|
||||
"fstatfs": {},
|
||||
"fsync": {},
|
||||
"ftell": {},
|
||||
"ftruncate": {},
|
||||
"ftruncate64": {},
|
||||
"fts64_close": {},
|
||||
"fts64_open": {},
|
||||
"fts64_read": {},
|
||||
"fts_close": {},
|
||||
"fts_open": {},
|
||||
"fts_read": {},
|
||||
"fwrite": {},
|
||||
"gai_strerror": {},
|
||||
"getaddrinfo": {},
|
||||
"getc": {},
|
||||
"getcwd": {},
|
||||
"getegid": {},
|
||||
"getentropy": {},
|
||||
"getenv": {},
|
||||
"geteuid": {},
|
||||
"getgid": {},
|
||||
"getgrgid": {},
|
||||
"getgrgid_r": {},
|
||||
"getgrnam": {},
|
||||
"getgrnam_r": {},
|
||||
"gethostbyaddr": {},
|
||||
"gethostbyaddr_r": {},
|
||||
"gethostbyname": {},
|
||||
"gethostbyname2": {},
|
||||
"gethostbyname2_r": {},
|
||||
"gethostbyname_r": {},
|
||||
"gethostname": {},
|
||||
"getnameinfo": {},
|
||||
"getpeername": {},
|
||||
"getpid": {},
|
||||
"getpwnam": {},
|
||||
"getpwnam_r": {},
|
||||
"getpwuid": {},
|
||||
"getpwuid_r": {},
|
||||
"getrandom": {},
|
||||
"getresgid": {},
|
||||
"getresuid": {},
|
||||
"getrlimit": {},
|
||||
"getrlimit64": {},
|
||||
"getrusage": {},
|
||||
"getservbyname": {},
|
||||
"getsockname": {},
|
||||
"getsockopt": {},
|
||||
"gettimeofday": {},
|
||||
"getuid": {},
|
||||
"gmtime_r": {},
|
||||
"h_errno": {},
|
||||
"htonl": {},
|
||||
"htons": {},
|
||||
"hypot": {},
|
||||
"inet_ntoa": {},
|
||||
"inet_ntop": {},
|
||||
"inet_pton": {},
|
||||
"initstate": {},
|
||||
"initstate_r": {},
|
||||
"ioctl": {},
|
||||
"isalnum": {},
|
||||
"isalpha": {},
|
||||
"isascii": {},
|
||||
"isatty": {},
|
||||
"isdigit": {},
|
||||
"islower": {},
|
||||
"isnan": {},
|
||||
"isnanf": {},
|
||||
"isnanl": {},
|
||||
"isprint": {},
|
||||
"isupper": {},
|
||||
"iswalnum": {},
|
||||
"iswspace": {},
|
||||
"isxdigit": {},
|
||||
"kill": {},
|
||||
"ldexp": {},
|
||||
"link": {},
|
||||
"listen": {},
|
||||
"llabs": {},
|
||||
"localeconv": {},
|
||||
"localtime": {},
|
||||
"localtime_r": {},
|
||||
"log": {},
|
||||
"log10": {},
|
||||
"log2": {},
|
||||
"longjmp": {},
|
||||
"lrand48": {},
|
||||
"lseek": {},
|
||||
"lseek64": {},
|
||||
"lstat": {},
|
||||
"lstat64": {},
|
||||
"malloc": {},
|
||||
"mblen": {},
|
||||
"mbrtowc": {},
|
||||
"mbsinit": {},
|
||||
"mbstowcs": {},
|
||||
"mbtowc": {},
|
||||
"memchr": {},
|
||||
"memcmp": {},
|
||||
"memcpy": {},
|
||||
"memmove": {},
|
||||
"memset": {},
|
||||
"mkdir": {},
|
||||
"mkfifo": {},
|
||||
"mknod": {},
|
||||
"mkostemp": {},
|
||||
"mkstemp": {},
|
||||
"mkstemp64": {},
|
||||
"mkstemps": {},
|
||||
"mkstemps64": {},
|
||||
"mktime": {},
|
||||
"mmap": {},
|
||||
"mmap64": {},
|
||||
"modf": {},
|
||||
"mremap": {},
|
||||
"munmap": {},
|
||||
"nanf": {},
|
||||
"nanosleep": {},
|
||||
"nl_langinfo": {},
|
||||
"ntohs": {},
|
||||
"obstack_free": {},
|
||||
"obstack_vprintf": {},
|
||||
"open": {},
|
||||
"open64": {},
|
||||
"opendir": {},
|
||||
"openpty": {},
|
||||
"pathconf": {},
|
||||
"pause": {},
|
||||
"pclose": {},
|
||||
"perror": {},
|
||||
"pipe": {},
|
||||
"poll": {},
|
||||
"popen": {},
|
||||
"posix_fadvise": {},
|
||||
"pow": {},
|
||||
"pread": {},
|
||||
"printf": {},
|
||||
"pselect": {},
|
||||
"pthread_attr_destroy": {},
|
||||
"pthread_attr_getdetachstate": {},
|
||||
"pthread_attr_init": {},
|
||||
"pthread_attr_setdetachstate": {},
|
||||
"pthread_attr_setscope": {},
|
||||
"pthread_attr_setstacksize": {},
|
||||
"pthread_cond_broadcast": {},
|
||||
"pthread_cond_destroy": {},
|
||||
"pthread_cond_init": {},
|
||||
"pthread_cond_signal": {},
|
||||
"pthread_cond_timedwait": {},
|
||||
"pthread_cond_wait": {},
|
||||
"pthread_create": {},
|
||||
"pthread_detach": {},
|
||||
"pthread_equal": {},
|
||||
"pthread_exit": {},
|
||||
"pthread_getspecific": {},
|
||||
"pthread_join": {},
|
||||
"pthread_key_create": {},
|
||||
"pthread_key_delete": {},
|
||||
"pthread_mutex_destroy": {},
|
||||
"pthread_mutex_init": {},
|
||||
"pthread_mutex_lock": {},
|
||||
"pthread_mutex_trylock": {},
|
||||
"pthread_mutex_unlock": {},
|
||||
"pthread_mutexattr_destroy": {},
|
||||
"pthread_mutexattr_init": {},
|
||||
"pthread_mutexattr_settype": {},
|
||||
"pthread_self": {},
|
||||
"pthread_setspecific": {},
|
||||
"putc": {},
|
||||
"putchar": {},
|
||||
"puts": {},
|
||||
"pwrite": {},
|
||||
"qsort": {},
|
||||
"raise": {},
|
||||
"rand": {},
|
||||
"rand_r": {},
|
||||
"random": {},
|
||||
"random_r": {},
|
||||
"read": {},
|
||||
"readdir": {},
|
||||
"readdir64": {},
|
||||
"readlink": {},
|
||||
"readv": {},
|
||||
"realloc": {},
|
||||
"reallocarray": {},
|
||||
"realpath": {},
|
||||
"recv": {},
|
||||
"recvfrom": {},
|
||||
"recvmsg": {},
|
||||
"remove": {},
|
||||
"rename": {},
|
||||
"rewind": {},
|
||||
"rindex": {},
|
||||
"rint": {},
|
||||
"rmdir": {},
|
||||
"round": {},
|
||||
"scalbn": {},
|
||||
"scalbnl": {},
|
||||
"sched_yield": {},
|
||||
"select": {},
|
||||
"send": {},
|
||||
"sendmsg": {},
|
||||
"sendto": {},
|
||||
"setbuf": {},
|
||||
"setenv": {},
|
||||
"setjmp": {},
|
||||
"setlocale": {},
|
||||
"setrlimit": {},
|
||||
"setrlimit64": {},
|
||||
"setsid": {},
|
||||
"setsockopt": {},
|
||||
"setstate": {},
|
||||
"setvbuf": {},
|
||||
"shmat": {},
|
||||
"shmctl": {},
|
||||
"shmdt": {},
|
||||
"shutdown": {},
|
||||
"sigaction": {},
|
||||
"signal": {},
|
||||
"sin": {},
|
||||
"sinf": {},
|
||||
"sinh": {},
|
||||
"sleep": {},
|
||||
"snprintf": {},
|
||||
"socket": {},
|
||||
"sprintf": {},
|
||||
"sqrt": {},
|
||||
"srand48": {},
|
||||
"sscanf": {},
|
||||
"stat": {},
|
||||
"stat64": {},
|
||||
"stderr": {},
|
||||
"stdin": {},
|
||||
"stdout": {},
|
||||
"strcasecmp": {},
|
||||
"strcat": {},
|
||||
"strchr": {},
|
||||
"strcmp": {},
|
||||
"strcpy": {},
|
||||
"strcspn": {},
|
||||
"strdup": {},
|
||||
"strerror": {},
|
||||
"strerror_r": {},
|
||||
"strlcat": {},
|
||||
"strlcpy": {},
|
||||
"strlen": {},
|
||||
"strncasecmp": {},
|
||||
"strncat": {},
|
||||
"strncmp": {},
|
||||
"strncpy": {},
|
||||
"strnlen": {},
|
||||
"strpbrk": {},
|
||||
"strrchr": {},
|
||||
"strspn": {},
|
||||
"strstr": {},
|
||||
"strtod": {},
|
||||
"strtof": {},
|
||||
"strtoimax": {},
|
||||
"strtok": {},
|
||||
"strtol": {},
|
||||
"strtold": {},
|
||||
"strtoll": {},
|
||||
"strtoul": {},
|
||||
"strtoull": {},
|
||||
"strtoumax": {},
|
||||
"symlink": {},
|
||||
"sysconf": {},
|
||||
"system": {},
|
||||
"tan": {},
|
||||
"tanh": {},
|
||||
"tcgetattr": {},
|
||||
"tcsendbreak": {},
|
||||
"tcsetattr": {},
|
||||
"time": {},
|
||||
"tmpfile": {},
|
||||
"tolower": {},
|
||||
"toupper": {},
|
||||
"trunc": {},
|
||||
"tzset": {},
|
||||
"umask": {},
|
||||
"uname": {},
|
||||
"ungetc": {},
|
||||
"unlink": {},
|
||||
"unsetenv": {},
|
||||
"usleep": {},
|
||||
"utime": {},
|
||||
"utimes": {},
|
||||
"uuid_copy": {},
|
||||
"uuid_generate_random": {},
|
||||
"uuid_parse": {},
|
||||
"uuid_unparse": {},
|
||||
"vasprintf": {},
|
||||
"vfprintf": {},
|
||||
"vfscanf": {},
|
||||
"vprintf": {},
|
||||
"vsnprintf": {},
|
||||
"vsprintf": {},
|
||||
"vsscanf": {},
|
||||
"waitpid": {},
|
||||
"wcschr": {},
|
||||
"wctomb": {},
|
||||
"wcwidth": {},
|
||||
"write": {},
|
||||
"writev": {},
|
||||
"zero_struct_address": {},
|
||||
}
|
512
vendor/modernc.org/libc/capi_linux_s390x.go
generated
vendored
Normal file
512
vendor/modernc.org/libc/capi_linux_s390x.go
generated
vendored
Normal file
|
@ -0,0 +1,512 @@
|
|||
// Code generated by 'go generate' - DO NOT EDIT.
|
||||
|
||||
package libc // import "modernc.org/libc"
|
||||
|
||||
var CAPI = map[string]struct{}{
|
||||
"_IO_putc": {},
|
||||
"___errno_location": {},
|
||||
"__assert_fail": {},
|
||||
"__builtin___memcpy_chk": {},
|
||||
"__builtin___memmove_chk": {},
|
||||
"__builtin___memset_chk": {},
|
||||
"__builtin___snprintf_chk": {},
|
||||
"__builtin___sprintf_chk": {},
|
||||
"__builtin___strcat_chk": {},
|
||||
"__builtin___strcpy_chk": {},
|
||||
"__builtin___strncpy_chk": {},
|
||||
"__builtin___vsnprintf_chk": {},
|
||||
"__builtin_abort": {},
|
||||
"__builtin_abs": {},
|
||||
"__builtin_add_overflowInt64": {},
|
||||
"__builtin_add_overflowUint32": {},
|
||||
"__builtin_add_overflowUint64": {},
|
||||
"__builtin_bswap16": {},
|
||||
"__builtin_bswap32": {},
|
||||
"__builtin_bswap64": {},
|
||||
"__builtin_bzero": {},
|
||||
"__builtin_clz": {},
|
||||
"__builtin_clzl": {},
|
||||
"__builtin_clzll": {},
|
||||
"__builtin_constant_p_impl": {},
|
||||
"__builtin_copysign": {},
|
||||
"__builtin_copysignf": {},
|
||||
"__builtin_copysignl": {},
|
||||
"__builtin_exit": {},
|
||||
"__builtin_expect": {},
|
||||
"__builtin_fabs": {},
|
||||
"__builtin_fabsf": {},
|
||||
"__builtin_fabsl": {},
|
||||
"__builtin_free": {},
|
||||
"__builtin_getentropy": {},
|
||||
"__builtin_huge_val": {},
|
||||
"__builtin_huge_valf": {},
|
||||
"__builtin_inf": {},
|
||||
"__builtin_inff": {},
|
||||
"__builtin_infl": {},
|
||||
"__builtin_isnan": {},
|
||||
"__builtin_isunordered": {},
|
||||
"__builtin_llabs": {},
|
||||
"__builtin_malloc": {},
|
||||
"__builtin_memcmp": {},
|
||||
"__builtin_memcpy": {},
|
||||
"__builtin_memset": {},
|
||||
"__builtin_mmap": {},
|
||||
"__builtin_mul_overflowInt64": {},
|
||||
"__builtin_mul_overflowUint128": {},
|
||||
"__builtin_mul_overflowUint64": {},
|
||||
"__builtin_nan": {},
|
||||
"__builtin_nanf": {},
|
||||
"__builtin_nanl": {},
|
||||
"__builtin_object_size": {},
|
||||
"__builtin_popcount": {},
|
||||
"__builtin_popcountl": {},
|
||||
"__builtin_prefetch": {},
|
||||
"__builtin_printf": {},
|
||||
"__builtin_snprintf": {},
|
||||
"__builtin_sprintf": {},
|
||||
"__builtin_strchr": {},
|
||||
"__builtin_strcmp": {},
|
||||
"__builtin_strcpy": {},
|
||||
"__builtin_strlen": {},
|
||||
"__builtin_sub_overflowInt64": {},
|
||||
"__builtin_trap": {},
|
||||
"__builtin_unreachable": {},
|
||||
"__ccgo_dmesg": {},
|
||||
"__ccgo_getMutexType": {},
|
||||
"__ccgo_in6addr_anyp": {},
|
||||
"__ccgo_pthreadAttrGetDetachState": {},
|
||||
"__ccgo_pthreadMutexattrGettype": {},
|
||||
"__ccgo_sqlite3_log": {},
|
||||
"__cmsg_nxthdr": {},
|
||||
"__ctype_b_loc": {},
|
||||
"__ctype_get_mb_cur_max": {},
|
||||
"__errno_location": {},
|
||||
"__floatscan": {},
|
||||
"__fpclassify": {},
|
||||
"__fpclassifyf": {},
|
||||
"__fpclassifyl": {},
|
||||
"__fsmu8": {},
|
||||
"__h_errno_location": {},
|
||||
"__inet_aton": {},
|
||||
"__intscan": {},
|
||||
"__isalnum_l": {},
|
||||
"__isalpha_l": {},
|
||||
"__isdigit_l": {},
|
||||
"__islower_l": {},
|
||||
"__isnan": {},
|
||||
"__isnanf": {},
|
||||
"__isnanl": {},
|
||||
"__isoc99_sscanf": {},
|
||||
"__isprint_l": {},
|
||||
"__isupper_l": {},
|
||||
"__isxdigit_l": {},
|
||||
"__lockfile": {},
|
||||
"__lookup_ipliteral": {},
|
||||
"__lookup_name": {},
|
||||
"__lookup_serv": {},
|
||||
"__shgetc": {},
|
||||
"__shlim": {},
|
||||
"__strncasecmp_l": {},
|
||||
"__sync_add_and_fetch_uint32": {},
|
||||
"__sync_sub_and_fetch_uint32": {},
|
||||
"__syscall1": {},
|
||||
"__syscall3": {},
|
||||
"__syscall4": {},
|
||||
"__toread": {},
|
||||
"__toread_needs_stdio_exit": {},
|
||||
"__uflow": {},
|
||||
"__unlockfile": {},
|
||||
"_exit": {},
|
||||
"_longjmp": {},
|
||||
"_obstack_begin": {},
|
||||
"_obstack_newchunk": {},
|
||||
"_setjmp": {},
|
||||
"abort": {},
|
||||
"abs": {},
|
||||
"accept": {},
|
||||
"access": {},
|
||||
"acos": {},
|
||||
"acosh": {},
|
||||
"alarm": {},
|
||||
"asin": {},
|
||||
"asinh": {},
|
||||
"atan": {},
|
||||
"atan2": {},
|
||||
"atanh": {},
|
||||
"atexit": {},
|
||||
"atof": {},
|
||||
"atoi": {},
|
||||
"atol": {},
|
||||
"backtrace": {},
|
||||
"backtrace_symbols_fd": {},
|
||||
"bind": {},
|
||||
"bsearch": {},
|
||||
"bzero": {},
|
||||
"calloc": {},
|
||||
"ceil": {},
|
||||
"ceilf": {},
|
||||
"cfgetospeed": {},
|
||||
"cfsetispeed": {},
|
||||
"cfsetospeed": {},
|
||||
"chdir": {},
|
||||
"chmod": {},
|
||||
"chown": {},
|
||||
"clock_gettime": {},
|
||||
"close": {},
|
||||
"closedir": {},
|
||||
"confstr": {},
|
||||
"connect": {},
|
||||
"copysign": {},
|
||||
"copysignf": {},
|
||||
"copysignl": {},
|
||||
"cos": {},
|
||||
"cosf": {},
|
||||
"cosh": {},
|
||||
"ctime": {},
|
||||
"ctime_r": {},
|
||||
"dlclose": {},
|
||||
"dlerror": {},
|
||||
"dlopen": {},
|
||||
"dlsym": {},
|
||||
"dup2": {},
|
||||
"endpwent": {},
|
||||
"environ": {},
|
||||
"execvp": {},
|
||||
"exit": {},
|
||||
"exp": {},
|
||||
"fabs": {},
|
||||
"fabsf": {},
|
||||
"fabsl": {},
|
||||
"fchmod": {},
|
||||
"fchown": {},
|
||||
"fclose": {},
|
||||
"fcntl": {},
|
||||
"fcntl64": {},
|
||||
"fdopen": {},
|
||||
"ferror": {},
|
||||
"fflush": {},
|
||||
"fgetc": {},
|
||||
"fgets": {},
|
||||
"fileno": {},
|
||||
"floor": {},
|
||||
"fmod": {},
|
||||
"fmodl": {},
|
||||
"fopen": {},
|
||||
"fopen64": {},
|
||||
"fork": {},
|
||||
"fprintf": {},
|
||||
"fputc": {},
|
||||
"fputs": {},
|
||||
"fread": {},
|
||||
"free": {},
|
||||
"freeaddrinfo": {},
|
||||
"frexp": {},
|
||||
"fscanf": {},
|
||||
"fseek": {},
|
||||
"fstat": {},
|
||||
"fstat64": {},
|
||||
"fstatfs": {},
|
||||
"fsync": {},
|
||||
"ftell": {},
|
||||
"ftruncate": {},
|
||||
"ftruncate64": {},
|
||||
"fts64_close": {},
|
||||
"fts64_open": {},
|
||||
"fts64_read": {},
|
||||
"fts_close": {},
|
||||
"fts_open": {},
|
||||
"fts_read": {},
|
||||
"fwrite": {},
|
||||
"gai_strerror": {},
|
||||
"getaddrinfo": {},
|
||||
"getc": {},
|
||||
"getcwd": {},
|
||||
"getegid": {},
|
||||
"getentropy": {},
|
||||
"getenv": {},
|
||||
"geteuid": {},
|
||||
"getgid": {},
|
||||
"getgrgid": {},
|
||||
"getgrgid_r": {},
|
||||
"getgrnam": {},
|
||||
"getgrnam_r": {},
|
||||
"gethostbyaddr": {},
|
||||
"gethostbyaddr_r": {},
|
||||
"gethostbyname": {},
|
||||
"gethostbyname2": {},
|
||||
"gethostbyname2_r": {},
|
||||
"gethostbyname_r": {},
|
||||
"gethostname": {},
|
||||
"getnameinfo": {},
|
||||
"getpeername": {},
|
||||
"getpid": {},
|
||||
"getpwnam": {},
|
||||
"getpwnam_r": {},
|
||||
"getpwuid": {},
|
||||
"getpwuid_r": {},
|
||||
"getrandom": {},
|
||||
"getresgid": {},
|
||||
"getresuid": {},
|
||||
"getrlimit": {},
|
||||
"getrlimit64": {},
|
||||
"getrusage": {},
|
||||
"getservbyname": {},
|
||||
"getsockname": {},
|
||||
"getsockopt": {},
|
||||
"gettimeofday": {},
|
||||
"getuid": {},
|
||||
"gmtime_r": {},
|
||||
"h_errno": {},
|
||||
"htonl": {},
|
||||
"htons": {},
|
||||
"hypot": {},
|
||||
"inet_ntoa": {},
|
||||
"inet_ntop": {},
|
||||
"inet_pton": {},
|
||||
"initstate": {},
|
||||
"initstate_r": {},
|
||||
"ioctl": {},
|
||||
"isalnum": {},
|
||||
"isalpha": {},
|
||||
"isascii": {},
|
||||
"isatty": {},
|
||||
"isdigit": {},
|
||||
"islower": {},
|
||||
"isnan": {},
|
||||
"isnanf": {},
|
||||
"isnanl": {},
|
||||
"isprint": {},
|
||||
"isupper": {},
|
||||
"isxdigit": {},
|
||||
"kill": {},
|
||||
"ldexp": {},
|
||||
"link": {},
|
||||
"listen": {},
|
||||
"llabs": {},
|
||||
"localeconv": {},
|
||||
"localtime": {},
|
||||
"localtime_r": {},
|
||||
"log": {},
|
||||
"log10": {},
|
||||
"log2": {},
|
||||
"longjmp": {},
|
||||
"lrand48": {},
|
||||
"lseek": {},
|
||||
"lseek64": {},
|
||||
"lstat": {},
|
||||
"lstat64": {},
|
||||
"malloc": {},
|
||||
"mblen": {},
|
||||
"mbrtowc": {},
|
||||
"mbsinit": {},
|
||||
"mbstowcs": {},
|
||||
"mbtowc": {},
|
||||
"memchr": {},
|
||||
"memcmp": {},
|
||||
"memcpy": {},
|
||||
"memmove": {},
|
||||
"memset": {},
|
||||
"mkdir": {},
|
||||
"mkfifo": {},
|
||||
"mknod": {},
|
||||
"mkostemp": {},
|
||||
"mkstemp": {},
|
||||
"mkstemp64": {},
|
||||
"mkstemps": {},
|
||||
"mkstemps64": {},
|
||||
"mktime": {},
|
||||
"mmap": {},
|
||||
"mmap64": {},
|
||||
"modf": {},
|
||||
"mremap": {},
|
||||
"munmap": {},
|
||||
"nanf": {},
|
||||
"nanosleep": {},
|
||||
"nl_langinfo": {},
|
||||
"ntohs": {},
|
||||
"obstack_free": {},
|
||||
"obstack_vprintf": {},
|
||||
"open": {},
|
||||
"open64": {},
|
||||
"opendir": {},
|
||||
"openpty": {},
|
||||
"pathconf": {},
|
||||
"pause": {},
|
||||
"pclose": {},
|
||||
"perror": {},
|
||||
"pipe": {},
|
||||
"poll": {},
|
||||
"popen": {},
|
||||
"posix_fadvise": {},
|
||||
"pow": {},
|
||||
"pread": {},
|
||||
"printf": {},
|
||||
"pselect": {},
|
||||
"pthread_attr_destroy": {},
|
||||
"pthread_attr_getdetachstate": {},
|
||||
"pthread_attr_init": {},
|
||||
"pthread_attr_setdetachstate": {},
|
||||
"pthread_attr_setscope": {},
|
||||
"pthread_attr_setstacksize": {},
|
||||
"pthread_cond_broadcast": {},
|
||||
"pthread_cond_destroy": {},
|
||||
"pthread_cond_init": {},
|
||||
"pthread_cond_signal": {},
|
||||
"pthread_cond_timedwait": {},
|
||||
"pthread_cond_wait": {},
|
||||
"pthread_create": {},
|
||||
"pthread_detach": {},
|
||||
"pthread_equal": {},
|
||||
"pthread_exit": {},
|
||||
"pthread_getspecific": {},
|
||||
"pthread_join": {},
|
||||
"pthread_key_create": {},
|
||||
"pthread_key_delete": {},
|
||||
"pthread_mutex_destroy": {},
|
||||
"pthread_mutex_init": {},
|
||||
"pthread_mutex_lock": {},
|
||||
"pthread_mutex_trylock": {},
|
||||
"pthread_mutex_unlock": {},
|
||||
"pthread_mutexattr_destroy": {},
|
||||
"pthread_mutexattr_init": {},
|
||||
"pthread_mutexattr_settype": {},
|
||||
"pthread_self": {},
|
||||
"pthread_setspecific": {},
|
||||
"putc": {},
|
||||
"putchar": {},
|
||||
"puts": {},
|
||||
"pwrite": {},
|
||||
"qsort": {},
|
||||
"raise": {},
|
||||
"rand": {},
|
||||
"rand_r": {},
|
||||
"random": {},
|
||||
"random_r": {},
|
||||
"read": {},
|
||||
"readdir": {},
|
||||
"readdir64": {},
|
||||
"readlink": {},
|
||||
"readv": {},
|
||||
"realloc": {},
|
||||
"reallocarray": {},
|
||||
"realpath": {},
|
||||
"recv": {},
|
||||
"recvfrom": {},
|
||||
"recvmsg": {},
|
||||
"remove": {},
|
||||
"rename": {},
|
||||
"rewind": {},
|
||||
"rindex": {},
|
||||
"rint": {},
|
||||
"rmdir": {},
|
||||
"round": {},
|
||||
"scalbn": {},
|
||||
"scalbnl": {},
|
||||
"sched_yield": {},
|
||||
"select": {},
|
||||
"send": {},
|
||||
"sendmsg": {},
|
||||
"sendto": {},
|
||||
"setbuf": {},
|
||||
"setenv": {},
|
||||
"setjmp": {},
|
||||
"setlocale": {},
|
||||
"setrlimit": {},
|
||||
"setrlimit64": {},
|
||||
"setsid": {},
|
||||
"setsockopt": {},
|
||||
"setstate": {},
|
||||
"setvbuf": {},
|
||||
"shmat": {},
|
||||
"shmctl": {},
|
||||
"shmdt": {},
|
||||
"shutdown": {},
|
||||
"sigaction": {},
|
||||
"signal": {},
|
||||
"sin": {},
|
||||
"sinf": {},
|
||||
"sinh": {},
|
||||
"sleep": {},
|
||||
"snprintf": {},
|
||||
"socket": {},
|
||||
"sprintf": {},
|
||||
"sqrt": {},
|
||||
"srand48": {},
|
||||
"sscanf": {},
|
||||
"stat": {},
|
||||
"stat64": {},
|
||||
"stderr": {},
|
||||
"stdin": {},
|
||||
"stdout": {},
|
||||
"strcasecmp": {},
|
||||
"strcat": {},
|
||||
"strchr": {},
|
||||
"strcmp": {},
|
||||
"strcpy": {},
|
||||
"strcspn": {},
|
||||
"strdup": {},
|
||||
"strerror": {},
|
||||
"strerror_r": {},
|
||||
"strlcat": {},
|
||||
"strlcpy": {},
|
||||
"strlen": {},
|
||||
"strncasecmp": {},
|
||||
"strncat": {},
|
||||
"strncmp": {},
|
||||
"strncpy": {},
|
||||
"strnlen": {},
|
||||
"strpbrk": {},
|
||||
"strrchr": {},
|
||||
"strspn": {},
|
||||
"strstr": {},
|
||||
"strtod": {},
|
||||
"strtof": {},
|
||||
"strtoimax": {},
|
||||
"strtok": {},
|
||||
"strtol": {},
|
||||
"strtold": {},
|
||||
"strtoll": {},
|
||||
"strtoul": {},
|
||||
"strtoull": {},
|
||||
"strtoumax": {},
|
||||
"symlink": {},
|
||||
"sysconf": {},
|
||||
"system": {},
|
||||
"tan": {},
|
||||
"tanh": {},
|
||||
"tcgetattr": {},
|
||||
"tcsendbreak": {},
|
||||
"tcsetattr": {},
|
||||
"time": {},
|
||||
"tmpfile": {},
|
||||
"tolower": {},
|
||||
"toupper": {},
|
||||
"trunc": {},
|
||||
"tzset": {},
|
||||
"umask": {},
|
||||
"uname": {},
|
||||
"ungetc": {},
|
||||
"unlink": {},
|
||||
"unsetenv": {},
|
||||
"usleep": {},
|
||||
"utime": {},
|
||||
"utimes": {},
|
||||
"uuid_copy": {},
|
||||
"uuid_generate_random": {},
|
||||
"uuid_parse": {},
|
||||
"uuid_unparse": {},
|
||||
"vasprintf": {},
|
||||
"vfprintf": {},
|
||||
"vfscanf": {},
|
||||
"vprintf": {},
|
||||
"vsnprintf": {},
|
||||
"vsprintf": {},
|
||||
"vsscanf": {},
|
||||
"waitpid": {},
|
||||
"wcschr": {},
|
||||
"wctomb": {},
|
||||
"wcwidth": {},
|
||||
"write": {},
|
||||
"writev": {},
|
||||
"zero_struct_address": {},
|
||||
}
|
501
vendor/modernc.org/libc/capi_netbsd_amd64.go
generated
vendored
Normal file
501
vendor/modernc.org/libc/capi_netbsd_amd64.go
generated
vendored
Normal file
|
@ -0,0 +1,501 @@
|
|||
// Code generated by 'go generate' - DO NOT EDIT.
|
||||
|
||||
package libc // import "modernc.org/libc"
|
||||
|
||||
var CAPI = map[string]struct{}{
|
||||
"_C_ctype_tab_": {},
|
||||
"_IO_putc": {},
|
||||
"_ThreadRuneLocale": {},
|
||||
"___errno_location": {},
|
||||
"___runetype": {},
|
||||
"__assert": {},
|
||||
"__assert13": {},
|
||||
"__assert_fail": {},
|
||||
"__builtin___memcpy_chk": {},
|
||||
"__builtin___memmove_chk": {},
|
||||
"__builtin___memset_chk": {},
|
||||
"__builtin___snprintf_chk": {},
|
||||
"__builtin___sprintf_chk": {},
|
||||
"__builtin___strcat_chk": {},
|
||||
"__builtin___strcpy_chk": {},
|
||||
"__builtin___strncpy_chk": {},
|
||||
"__builtin___vsnprintf_chk": {},
|
||||
"__builtin_abort": {},
|
||||
"__builtin_abs": {},
|
||||
"__builtin_add_overflowInt64": {},
|
||||
"__builtin_add_overflowUint32": {},
|
||||
"__builtin_add_overflowUint64": {},
|
||||
"__builtin_bswap16": {},
|
||||
"__builtin_bswap32": {},
|
||||
"__builtin_bswap64": {},
|
||||
"__builtin_bzero": {},
|
||||
"__builtin_clz": {},
|
||||
"__builtin_clzl": {},
|
||||
"__builtin_clzll": {},
|
||||
"__builtin_constant_p_impl": {},
|
||||
"__builtin_copysign": {},
|
||||
"__builtin_copysignf": {},
|
||||
"__builtin_copysignl": {},
|
||||
"__builtin_exit": {},
|
||||
"__builtin_expect": {},
|
||||
"__builtin_fabs": {},
|
||||
"__builtin_fabsf": {},
|
||||
"__builtin_fabsl": {},
|
||||
"__builtin_free": {},
|
||||
"__builtin_getentropy": {},
|
||||
"__builtin_huge_val": {},
|
||||
"__builtin_huge_valf": {},
|
||||
"__builtin_inf": {},
|
||||
"__builtin_inff": {},
|
||||
"__builtin_infl": {},
|
||||
"__builtin_isnan": {},
|
||||
"__builtin_isunordered": {},
|
||||
"__builtin_llabs": {},
|
||||
"__builtin_malloc": {},
|
||||
"__builtin_memcmp": {},
|
||||
"__builtin_memcpy": {},
|
||||
"__builtin_memset": {},
|
||||
"__builtin_mmap": {},
|
||||
"__builtin_mul_overflowInt64": {},
|
||||
"__builtin_mul_overflowUint128": {},
|
||||
"__builtin_mul_overflowUint64": {},
|
||||
"__builtin_nan": {},
|
||||
"__builtin_nanf": {},
|
||||
"__builtin_nanl": {},
|
||||
"__builtin_object_size": {},
|
||||
"__builtin_popcount": {},
|
||||
"__builtin_popcountl": {},
|
||||
"__builtin_prefetch": {},
|
||||
"__builtin_printf": {},
|
||||
"__builtin_snprintf": {},
|
||||
"__builtin_sprintf": {},
|
||||
"__builtin_strchr": {},
|
||||
"__builtin_strcmp": {},
|
||||
"__builtin_strcpy": {},
|
||||
"__builtin_strlen": {},
|
||||
"__builtin_sub_overflowInt64": {},
|
||||
"__builtin_trap": {},
|
||||
"__builtin_unreachable": {},
|
||||
"__ccgo_dmesg": {},
|
||||
"__ccgo_getMutexType": {},
|
||||
"__ccgo_in6addr_anyp": {},
|
||||
"__ccgo_pthreadAttrGetDetachState": {},
|
||||
"__ccgo_pthreadMutexattrGettype": {},
|
||||
"__ccgo_sqlite3_log": {},
|
||||
"__cmsg_nxthdr": {},
|
||||
"__ctype_get_mb_cur_max": {},
|
||||
"__errno": {},
|
||||
"__errno_location": {},
|
||||
"__error": {},
|
||||
"__floatscan": {},
|
||||
"__h_errno_location": {},
|
||||
"__inet_aton": {},
|
||||
"__inet_ntoa": {},
|
||||
"__intscan": {},
|
||||
"__isalnum_l": {},
|
||||
"__isalpha_l": {},
|
||||
"__isdigit_l": {},
|
||||
"__isnan": {},
|
||||
"__isnanf": {},
|
||||
"__isnanl": {},
|
||||
"__isoc99_sscanf": {},
|
||||
"__isprint_l": {},
|
||||
"__isthreaded": {},
|
||||
"__lookup_ipliteral": {},
|
||||
"__lookup_name": {},
|
||||
"__lookup_serv": {},
|
||||
"__mb_sb_limit": {},
|
||||
"__runes_for_locale": {},
|
||||
"__sF": {},
|
||||
"__shgetc": {},
|
||||
"__shlim": {},
|
||||
"__srget": {},
|
||||
"__stderrp": {},
|
||||
"__stdinp": {},
|
||||
"__stdoutp": {},
|
||||
"__swbuf": {},
|
||||
"__sync_add_and_fetch_uint32": {},
|
||||
"__sync_sub_and_fetch_uint32": {},
|
||||
"__syscall1": {},
|
||||
"__syscall3": {},
|
||||
"__syscall4": {},
|
||||
"__toread": {},
|
||||
"__toread_needs_stdio_exit": {},
|
||||
"__uflow": {},
|
||||
"__xuname": {},
|
||||
"_ctype_tab_": {},
|
||||
"_exit": {},
|
||||
"_longjmp": {},
|
||||
"_obstack_begin": {},
|
||||
"_obstack_newchunk": {},
|
||||
"_setjmp": {},
|
||||
"_tolower_tab_": {},
|
||||
"_toupper_tab_": {},
|
||||
"abort": {},
|
||||
"abs": {},
|
||||
"accept": {},
|
||||
"access": {},
|
||||
"acos": {},
|
||||
"acosh": {},
|
||||
"alarm": {},
|
||||
"asin": {},
|
||||
"asinh": {},
|
||||
"atan": {},
|
||||
"atan2": {},
|
||||
"atanh": {},
|
||||
"atexit": {},
|
||||
"atof": {},
|
||||
"atoi": {},
|
||||
"atol": {},
|
||||
"backtrace": {},
|
||||
"backtrace_symbols_fd": {},
|
||||
"bind": {},
|
||||
"bsearch": {},
|
||||
"bswap16": {},
|
||||
"bswap32": {},
|
||||
"bswap64": {},
|
||||
"bzero": {},
|
||||
"calloc": {},
|
||||
"ceil": {},
|
||||
"ceilf": {},
|
||||
"cfgetospeed": {},
|
||||
"cfsetispeed": {},
|
||||
"cfsetospeed": {},
|
||||
"chdir": {},
|
||||
"chflags": {},
|
||||
"chmod": {},
|
||||
"chown": {},
|
||||
"clock_gettime": {},
|
||||
"close": {},
|
||||
"closedir": {},
|
||||
"confstr": {},
|
||||
"connect": {},
|
||||
"copysign": {},
|
||||
"copysignf": {},
|
||||
"copysignl": {},
|
||||
"cos": {},
|
||||
"cosf": {},
|
||||
"cosh": {},
|
||||
"ctime": {},
|
||||
"ctime_r": {},
|
||||
"dlclose": {},
|
||||
"dlerror": {},
|
||||
"dlopen": {},
|
||||
"dlsym": {},
|
||||
"dup2": {},
|
||||
"endpwent": {},
|
||||
"environ": {},
|
||||
"execvp": {},
|
||||
"exit": {},
|
||||
"exp": {},
|
||||
"fabs": {},
|
||||
"fabsf": {},
|
||||
"fabsl": {},
|
||||
"fchmod": {},
|
||||
"fchown": {},
|
||||
"fclose": {},
|
||||
"fcntl": {},
|
||||
"fcntl64": {},
|
||||
"fdopen": {},
|
||||
"ferror": {},
|
||||
"fflush": {},
|
||||
"fgetc": {},
|
||||
"fgets": {},
|
||||
"fileno": {},
|
||||
"floor": {},
|
||||
"fmod": {},
|
||||
"fmodl": {},
|
||||
"fopen": {},
|
||||
"fopen64": {},
|
||||
"fork": {},
|
||||
"fprintf": {},
|
||||
"fputc": {},
|
||||
"fputs": {},
|
||||
"fread": {},
|
||||
"free": {},
|
||||
"freeaddrinfo": {},
|
||||
"frexp": {},
|
||||
"fscanf": {},
|
||||
"fseek": {},
|
||||
"fstat": {},
|
||||
"fstat64": {},
|
||||
"fsync": {},
|
||||
"ftell": {},
|
||||
"ftruncate": {},
|
||||
"fts64_close": {},
|
||||
"fts64_open": {},
|
||||
"fts64_read": {},
|
||||
"fts_close": {},
|
||||
"fts_open": {},
|
||||
"fts_read": {},
|
||||
"fwrite": {},
|
||||
"gai_strerror": {},
|
||||
"getaddrinfo": {},
|
||||
"getc": {},
|
||||
"getcwd": {},
|
||||
"getegid": {},
|
||||
"getentropy": {},
|
||||
"getenv": {},
|
||||
"geteuid": {},
|
||||
"getgid": {},
|
||||
"getgrgid": {},
|
||||
"getgrgid_r": {},
|
||||
"getgrnam": {},
|
||||
"getgrnam_r": {},
|
||||
"gethostbyaddr": {},
|
||||
"gethostbyaddr_r": {},
|
||||
"gethostbyname": {},
|
||||
"gethostbyname2": {},
|
||||
"gethostbyname2_r": {},
|
||||
"gethostname": {},
|
||||
"getnameinfo": {},
|
||||
"getpeername": {},
|
||||
"getpid": {},
|
||||
"getpwnam": {},
|
||||
"getpwnam_r": {},
|
||||
"getpwuid": {},
|
||||
"getpwuid_r": {},
|
||||
"getresgid": {},
|
||||
"getresuid": {},
|
||||
"getrlimit": {},
|
||||
"getrlimit64": {},
|
||||
"getrusage": {},
|
||||
"getservbyname": {},
|
||||
"getsockname": {},
|
||||
"getsockopt": {},
|
||||
"gettimeofday": {},
|
||||
"getuid": {},
|
||||
"gmtime_r": {},
|
||||
"h_errno": {},
|
||||
"htonl": {},
|
||||
"htons": {},
|
||||
"hypot": {},
|
||||
"inet_ntoa": {},
|
||||
"inet_ntop": {},
|
||||
"inet_pton": {},
|
||||
"initstate": {},
|
||||
"initstate_r": {},
|
||||
"ioctl": {},
|
||||
"isalnum": {},
|
||||
"isalpha": {},
|
||||
"isascii": {},
|
||||
"isatty": {},
|
||||
"isdigit": {},
|
||||
"isnan": {},
|
||||
"isnanf": {},
|
||||
"isnanl": {},
|
||||
"isprint": {},
|
||||
"kill": {},
|
||||
"ldexp": {},
|
||||
"link": {},
|
||||
"listen": {},
|
||||
"llabs": {},
|
||||
"localtime": {},
|
||||
"localtime_r": {},
|
||||
"log": {},
|
||||
"log10": {},
|
||||
"log2": {},
|
||||
"longjmp": {},
|
||||
"lrand48": {},
|
||||
"lseek": {},
|
||||
"lseek64": {},
|
||||
"lstat": {},
|
||||
"lstat64": {},
|
||||
"malloc": {},
|
||||
"mblen": {},
|
||||
"mbstowcs": {},
|
||||
"mbtowc": {},
|
||||
"memchr": {},
|
||||
"memcmp": {},
|
||||
"memcpy": {},
|
||||
"memmove": {},
|
||||
"memset": {},
|
||||
"mkdir": {},
|
||||
"mkfifo": {},
|
||||
"mknod": {},
|
||||
"mkostemp": {},
|
||||
"mkstemp": {},
|
||||
"mkstemp64": {},
|
||||
"mkstemps": {},
|
||||
"mkstemps64": {},
|
||||
"mktime": {},
|
||||
"mmap": {},
|
||||
"modf": {},
|
||||
"munmap": {},
|
||||
"nl_langinfo": {},
|
||||
"ntohs": {},
|
||||
"obstack_free": {},
|
||||
"obstack_vprintf": {},
|
||||
"open": {},
|
||||
"open64": {},
|
||||
"opendir": {},
|
||||
"openpty": {},
|
||||
"pathconf": {},
|
||||
"pause": {},
|
||||
"pclose": {},
|
||||
"perror": {},
|
||||
"pipe": {},
|
||||
"poll": {},
|
||||
"popen": {},
|
||||
"pow": {},
|
||||
"pread": {},
|
||||
"printf": {},
|
||||
"pselect": {},
|
||||
"pthread_attr_destroy": {},
|
||||
"pthread_attr_getdetachstate": {},
|
||||
"pthread_attr_init": {},
|
||||
"pthread_attr_setdetachstate": {},
|
||||
"pthread_attr_setscope": {},
|
||||
"pthread_attr_setstacksize": {},
|
||||
"pthread_cond_broadcast": {},
|
||||
"pthread_cond_destroy": {},
|
||||
"pthread_cond_init": {},
|
||||
"pthread_cond_signal": {},
|
||||
"pthread_cond_timedwait": {},
|
||||
"pthread_cond_wait": {},
|
||||
"pthread_create": {},
|
||||
"pthread_detach": {},
|
||||
"pthread_equal": {},
|
||||
"pthread_exit": {},
|
||||
"pthread_getspecific": {},
|
||||
"pthread_join": {},
|
||||
"pthread_key_create": {},
|
||||
"pthread_key_delete": {},
|
||||
"pthread_mutex_destroy": {},
|
||||
"pthread_mutex_init": {},
|
||||
"pthread_mutex_lock": {},
|
||||
"pthread_mutex_trylock": {},
|
||||
"pthread_mutex_unlock": {},
|
||||
"pthread_mutexattr_destroy": {},
|
||||
"pthread_mutexattr_init": {},
|
||||
"pthread_mutexattr_settype": {},
|
||||
"pthread_self": {},
|
||||
"pthread_setspecific": {},
|
||||
"putc": {},
|
||||
"putchar": {},
|
||||
"puts": {},
|
||||
"qsort": {},
|
||||
"raise": {},
|
||||
"rand": {},
|
||||
"random": {},
|
||||
"random_r": {},
|
||||
"read": {},
|
||||
"readdir": {},
|
||||
"readdir64": {},
|
||||
"readlink": {},
|
||||
"readv": {},
|
||||
"realloc": {},
|
||||
"reallocarray": {},
|
||||
"realpath": {},
|
||||
"recv": {},
|
||||
"recvfrom": {},
|
||||
"recvmsg": {},
|
||||
"remove": {},
|
||||
"rename": {},
|
||||
"rewind": {},
|
||||
"rindex": {},
|
||||
"rint": {},
|
||||
"rmdir": {},
|
||||
"round": {},
|
||||
"scalbn": {},
|
||||
"scalbnl": {},
|
||||
"sched_yield": {},
|
||||
"select": {},
|
||||
"send": {},
|
||||
"sendmsg": {},
|
||||
"sendto": {},
|
||||
"setbuf": {},
|
||||
"setenv": {},
|
||||
"setjmp": {},
|
||||
"setlocale": {},
|
||||
"setrlimit": {},
|
||||
"setrlimit64": {},
|
||||
"setsid": {},
|
||||
"setsockopt": {},
|
||||
"setstate": {},
|
||||
"setvbuf": {},
|
||||
"shmat": {},
|
||||
"shmctl": {},
|
||||
"shmdt": {},
|
||||
"shutdown": {},
|
||||
"sigaction": {},
|
||||
"signal": {},
|
||||
"sin": {},
|
||||
"sinf": {},
|
||||
"sinh": {},
|
||||
"sleep": {},
|
||||
"snprintf": {},
|
||||
"socket": {},
|
||||
"sprintf": {},
|
||||
"sqrt": {},
|
||||
"srand48": {},
|
||||
"sscanf": {},
|
||||
"stat": {},
|
||||
"stat64": {},
|
||||
"stderr": {},
|
||||
"stdin": {},
|
||||
"stdout": {},
|
||||
"strcasecmp": {},
|
||||
"strcat": {},
|
||||
"strchr": {},
|
||||
"strcmp": {},
|
||||
"strcpy": {},
|
||||
"strcspn": {},
|
||||
"strdup": {},
|
||||
"strerror": {},
|
||||
"strerror_r": {},
|
||||
"strlen": {},
|
||||
"strncmp": {},
|
||||
"strncpy": {},
|
||||
"strnlen": {},
|
||||
"strpbrk": {},
|
||||
"strrchr": {},
|
||||
"strspn": {},
|
||||
"strstr": {},
|
||||
"strtod": {},
|
||||
"strtof": {},
|
||||
"strtoimax": {},
|
||||
"strtol": {},
|
||||
"strtold": {},
|
||||
"strtoll": {},
|
||||
"strtoul": {},
|
||||
"strtoull": {},
|
||||
"strtoumax": {},
|
||||
"symlink": {},
|
||||
"sysconf": {},
|
||||
"system": {},
|
||||
"tan": {},
|
||||
"tanh": {},
|
||||
"tcgetattr": {},
|
||||
"tcsendbreak": {},
|
||||
"tcsetattr": {},
|
||||
"time": {},
|
||||
"tmpfile": {},
|
||||
"tolower": {},
|
||||
"toupper": {},
|
||||
"trunc": {},
|
||||
"tzset": {},
|
||||
"umask": {},
|
||||
"uname": {},
|
||||
"ungetc": {},
|
||||
"unlink": {},
|
||||
"unsetenv": {},
|
||||
"usleep": {},
|
||||
"utime": {},
|
||||
"utimes": {},
|
||||
"uuid_generate_random": {},
|
||||
"uuid_parse": {},
|
||||
"uuid_unparse": {},
|
||||
"vasprintf": {},
|
||||
"vfprintf": {},
|
||||
"vprintf": {},
|
||||
"vsnprintf": {},
|
||||
"vsprintf": {},
|
||||
"waitpid": {},
|
||||
"wcschr": {},
|
||||
"wctomb": {},
|
||||
"wcwidth": {},
|
||||
"write": {},
|
||||
"writev": {},
|
||||
"zero_struct_address": {},
|
||||
}
|
501
vendor/modernc.org/libc/capi_netbsd_arm.go
generated
vendored
Normal file
501
vendor/modernc.org/libc/capi_netbsd_arm.go
generated
vendored
Normal file
|
@ -0,0 +1,501 @@
|
|||
// Code generated by 'go generate' - DO NOT EDIT.
|
||||
|
||||
package libc // import "modernc.org/libc"
|
||||
|
||||
var CAPI = map[string]struct{}{
|
||||
"_C_ctype_tab_": {},
|
||||
"_IO_putc": {},
|
||||
"_ThreadRuneLocale": {},
|
||||
"___errno_location": {},
|
||||
"___runetype": {},
|
||||
"__assert": {},
|
||||
"__assert13": {},
|
||||
"__assert_fail": {},
|
||||
"__builtin___memcpy_chk": {},
|
||||
"__builtin___memmove_chk": {},
|
||||
"__builtin___memset_chk": {},
|
||||
"__builtin___snprintf_chk": {},
|
||||
"__builtin___sprintf_chk": {},
|
||||
"__builtin___strcat_chk": {},
|
||||
"__builtin___strcpy_chk": {},
|
||||
"__builtin___strncpy_chk": {},
|
||||
"__builtin___vsnprintf_chk": {},
|
||||
"__builtin_abort": {},
|
||||
"__builtin_abs": {},
|
||||
"__builtin_add_overflowInt64": {},
|
||||
"__builtin_add_overflowUint32": {},
|
||||
"__builtin_add_overflowUint64": {},
|
||||
"__builtin_bswap16": {},
|
||||
"__builtin_bswap32": {},
|
||||
"__builtin_bswap64": {},
|
||||
"__builtin_bzero": {},
|
||||
"__builtin_clz": {},
|
||||
"__builtin_clzl": {},
|
||||
"__builtin_clzll": {},
|
||||
"__builtin_constant_p_impl": {},
|
||||
"__builtin_copysign": {},
|
||||
"__builtin_copysignf": {},
|
||||
"__builtin_copysignl": {},
|
||||
"__builtin_exit": {},
|
||||
"__builtin_expect": {},
|
||||
"__builtin_fabs": {},
|
||||
"__builtin_fabsf": {},
|
||||
"__builtin_fabsl": {},
|
||||
"__builtin_free": {},
|
||||
"__builtin_getentropy": {},
|
||||
"__builtin_huge_val": {},
|
||||
"__builtin_huge_valf": {},
|
||||
"__builtin_inf": {},
|
||||
"__builtin_inff": {},
|
||||
"__builtin_infl": {},
|
||||
"__builtin_isnan": {},
|
||||
"__builtin_isunordered": {},
|
||||
"__builtin_llabs": {},
|
||||
"__builtin_malloc": {},
|
||||
"__builtin_memcmp": {},
|
||||
"__builtin_memcpy": {},
|
||||
"__builtin_memset": {},
|
||||
"__builtin_mmap": {},
|
||||
"__builtin_mul_overflowInt64": {},
|
||||
"__builtin_mul_overflowUint128": {},
|
||||
"__builtin_mul_overflowUint64": {},
|
||||
"__builtin_nan": {},
|
||||
"__builtin_nanf": {},
|
||||
"__builtin_nanl": {},
|
||||
"__builtin_object_size": {},
|
||||
"__builtin_popcount": {},
|
||||
"__builtin_popcountl": {},
|
||||
"__builtin_prefetch": {},
|
||||
"__builtin_printf": {},
|
||||
"__builtin_snprintf": {},
|
||||
"__builtin_sprintf": {},
|
||||
"__builtin_strchr": {},
|
||||
"__builtin_strcmp": {},
|
||||
"__builtin_strcpy": {},
|
||||
"__builtin_strlen": {},
|
||||
"__builtin_sub_overflowInt64": {},
|
||||
"__builtin_trap": {},
|
||||
"__builtin_unreachable": {},
|
||||
"__ccgo_dmesg": {},
|
||||
"__ccgo_getMutexType": {},
|
||||
"__ccgo_in6addr_anyp": {},
|
||||
"__ccgo_pthreadAttrGetDetachState": {},
|
||||
"__ccgo_pthreadMutexattrGettype": {},
|
||||
"__ccgo_sqlite3_log": {},
|
||||
"__cmsg_nxthdr": {},
|
||||
"__ctype_get_mb_cur_max": {},
|
||||
"__errno": {},
|
||||
"__errno_location": {},
|
||||
"__error": {},
|
||||
"__floatscan": {},
|
||||
"__h_errno_location": {},
|
||||
"__inet_aton": {},
|
||||
"__inet_ntoa": {},
|
||||
"__intscan": {},
|
||||
"__isalnum_l": {},
|
||||
"__isalpha_l": {},
|
||||
"__isdigit_l": {},
|
||||
"__isnan": {},
|
||||
"__isnanf": {},
|
||||
"__isnanl": {},
|
||||
"__isoc99_sscanf": {},
|
||||
"__isprint_l": {},
|
||||
"__isthreaded": {},
|
||||
"__lookup_ipliteral": {},
|
||||
"__lookup_name": {},
|
||||
"__lookup_serv": {},
|
||||
"__mb_sb_limit": {},
|
||||
"__runes_for_locale": {},
|
||||
"__sF": {},
|
||||
"__shgetc": {},
|
||||
"__shlim": {},
|
||||
"__srget": {},
|
||||
"__stderrp": {},
|
||||
"__stdinp": {},
|
||||
"__stdoutp": {},
|
||||
"__swbuf": {},
|
||||
"__sync_add_and_fetch_uint32": {},
|
||||
"__sync_sub_and_fetch_uint32": {},
|
||||
"__syscall1": {},
|
||||
"__syscall3": {},
|
||||
"__syscall4": {},
|
||||
"__toread": {},
|
||||
"__toread_needs_stdio_exit": {},
|
||||
"__uflow": {},
|
||||
"__xuname": {},
|
||||
"_ctype_tab_": {},
|
||||
"_exit": {},
|
||||
"_longjmp": {},
|
||||
"_obstack_begin": {},
|
||||
"_obstack_newchunk": {},
|
||||
"_setjmp": {},
|
||||
"_tolower_tab_": {},
|
||||
"_toupper_tab_": {},
|
||||
"abort": {},
|
||||
"abs": {},
|
||||
"accept": {},
|
||||
"access": {},
|
||||
"acos": {},
|
||||
"acosh": {},
|
||||
"alarm": {},
|
||||
"asin": {},
|
||||
"asinh": {},
|
||||
"atan": {},
|
||||
"atan2": {},
|
||||
"atanh": {},
|
||||
"atexit": {},
|
||||
"atof": {},
|
||||
"atoi": {},
|
||||
"atol": {},
|
||||
"backtrace": {},
|
||||
"backtrace_symbols_fd": {},
|
||||
"bind": {},
|
||||
"bsearch": {},
|
||||
"bswap16": {},
|
||||
"bswap32": {},
|
||||
"bswap64": {},
|
||||
"bzero": {},
|
||||
"calloc": {},
|
||||
"ceil": {},
|
||||
"ceilf": {},
|
||||
"cfgetospeed": {},
|
||||
"cfsetispeed": {},
|
||||
"cfsetospeed": {},
|
||||
"chdir": {},
|
||||
"chflags": {},
|
||||
"chmod": {},
|
||||
"chown": {},
|
||||
"clock_gettime": {},
|
||||
"close": {},
|
||||
"closedir": {},
|
||||
"confstr": {},
|
||||
"connect": {},
|
||||
"copysign": {},
|
||||
"copysignf": {},
|
||||
"copysignl": {},
|
||||
"cos": {},
|
||||
"cosf": {},
|
||||
"cosh": {},
|
||||
"ctime": {},
|
||||
"ctime_r": {},
|
||||
"dlclose": {},
|
||||
"dlerror": {},
|
||||
"dlopen": {},
|
||||
"dlsym": {},
|
||||
"dup2": {},
|
||||
"endpwent": {},
|
||||
"environ": {},
|
||||
"execvp": {},
|
||||
"exit": {},
|
||||
"exp": {},
|
||||
"fabs": {},
|
||||
"fabsf": {},
|
||||
"fabsl": {},
|
||||
"fchmod": {},
|
||||
"fchown": {},
|
||||
"fclose": {},
|
||||
"fcntl": {},
|
||||
"fcntl64": {},
|
||||
"fdopen": {},
|
||||
"ferror": {},
|
||||
"fflush": {},
|
||||
"fgetc": {},
|
||||
"fgets": {},
|
||||
"fileno": {},
|
||||
"floor": {},
|
||||
"fmod": {},
|
||||
"fmodl": {},
|
||||
"fopen": {},
|
||||
"fopen64": {},
|
||||
"fork": {},
|
||||
"fprintf": {},
|
||||
"fputc": {},
|
||||
"fputs": {},
|
||||
"fread": {},
|
||||
"free": {},
|
||||
"freeaddrinfo": {},
|
||||
"frexp": {},
|
||||
"fscanf": {},
|
||||
"fseek": {},
|
||||
"fstat": {},
|
||||
"fstat64": {},
|
||||
"fsync": {},
|
||||
"ftell": {},
|
||||
"ftruncate": {},
|
||||
"fts64_close": {},
|
||||
"fts64_open": {},
|
||||
"fts64_read": {},
|
||||
"fts_close": {},
|
||||
"fts_open": {},
|
||||
"fts_read": {},
|
||||
"fwrite": {},
|
||||
"gai_strerror": {},
|
||||
"getaddrinfo": {},
|
||||
"getc": {},
|
||||
"getcwd": {},
|
||||
"getegid": {},
|
||||
"getentropy": {},
|
||||
"getenv": {},
|
||||
"geteuid": {},
|
||||
"getgid": {},
|
||||
"getgrgid": {},
|
||||
"getgrgid_r": {},
|
||||
"getgrnam": {},
|
||||
"getgrnam_r": {},
|
||||
"gethostbyaddr": {},
|
||||
"gethostbyaddr_r": {},
|
||||
"gethostbyname": {},
|
||||
"gethostbyname2": {},
|
||||
"gethostbyname2_r": {},
|
||||
"gethostname": {},
|
||||
"getnameinfo": {},
|
||||
"getpeername": {},
|
||||
"getpid": {},
|
||||
"getpwnam": {},
|
||||
"getpwnam_r": {},
|
||||
"getpwuid": {},
|
||||
"getpwuid_r": {},
|
||||
"getresgid": {},
|
||||
"getresuid": {},
|
||||
"getrlimit": {},
|
||||
"getrlimit64": {},
|
||||
"getrusage": {},
|
||||
"getservbyname": {},
|
||||
"getsockname": {},
|
||||
"getsockopt": {},
|
||||
"gettimeofday": {},
|
||||
"getuid": {},
|
||||
"gmtime_r": {},
|
||||
"h_errno": {},
|
||||
"htonl": {},
|
||||
"htons": {},
|
||||
"hypot": {},
|
||||
"inet_ntoa": {},
|
||||
"inet_ntop": {},
|
||||
"inet_pton": {},
|
||||
"initstate": {},
|
||||
"initstate_r": {},
|
||||
"ioctl": {},
|
||||
"isalnum": {},
|
||||
"isalpha": {},
|
||||
"isascii": {},
|
||||
"isatty": {},
|
||||
"isdigit": {},
|
||||
"isnan": {},
|
||||
"isnanf": {},
|
||||
"isnanl": {},
|
||||
"isprint": {},
|
||||
"kill": {},
|
||||
"ldexp": {},
|
||||
"link": {},
|
||||
"listen": {},
|
||||
"llabs": {},
|
||||
"localtime": {},
|
||||
"localtime_r": {},
|
||||
"log": {},
|
||||
"log10": {},
|
||||
"log2": {},
|
||||
"longjmp": {},
|
||||
"lrand48": {},
|
||||
"lseek": {},
|
||||
"lseek64": {},
|
||||
"lstat": {},
|
||||
"lstat64": {},
|
||||
"malloc": {},
|
||||
"mblen": {},
|
||||
"mbstowcs": {},
|
||||
"mbtowc": {},
|
||||
"memchr": {},
|
||||
"memcmp": {},
|
||||
"memcpy": {},
|
||||
"memmove": {},
|
||||
"memset": {},
|
||||
"mkdir": {},
|
||||
"mkfifo": {},
|
||||
"mknod": {},
|
||||
"mkostemp": {},
|
||||
"mkstemp": {},
|
||||
"mkstemp64": {},
|
||||
"mkstemps": {},
|
||||
"mkstemps64": {},
|
||||
"mktime": {},
|
||||
"mmap": {},
|
||||
"modf": {},
|
||||
"munmap": {},
|
||||
"nl_langinfo": {},
|
||||
"ntohs": {},
|
||||
"obstack_free": {},
|
||||
"obstack_vprintf": {},
|
||||
"open": {},
|
||||
"open64": {},
|
||||
"opendir": {},
|
||||
"openpty": {},
|
||||
"pathconf": {},
|
||||
"pause": {},
|
||||
"pclose": {},
|
||||
"perror": {},
|
||||
"pipe": {},
|
||||
"poll": {},
|
||||
"popen": {},
|
||||
"pow": {},
|
||||
"pread": {},
|
||||
"printf": {},
|
||||
"pselect": {},
|
||||
"pthread_attr_destroy": {},
|
||||
"pthread_attr_getdetachstate": {},
|
||||
"pthread_attr_init": {},
|
||||
"pthread_attr_setdetachstate": {},
|
||||
"pthread_attr_setscope": {},
|
||||
"pthread_attr_setstacksize": {},
|
||||
"pthread_cond_broadcast": {},
|
||||
"pthread_cond_destroy": {},
|
||||
"pthread_cond_init": {},
|
||||
"pthread_cond_signal": {},
|
||||
"pthread_cond_timedwait": {},
|
||||
"pthread_cond_wait": {},
|
||||
"pthread_create": {},
|
||||
"pthread_detach": {},
|
||||
"pthread_equal": {},
|
||||
"pthread_exit": {},
|
||||
"pthread_getspecific": {},
|
||||
"pthread_join": {},
|
||||
"pthread_key_create": {},
|
||||
"pthread_key_delete": {},
|
||||
"pthread_mutex_destroy": {},
|
||||
"pthread_mutex_init": {},
|
||||
"pthread_mutex_lock": {},
|
||||
"pthread_mutex_trylock": {},
|
||||
"pthread_mutex_unlock": {},
|
||||
"pthread_mutexattr_destroy": {},
|
||||
"pthread_mutexattr_init": {},
|
||||
"pthread_mutexattr_settype": {},
|
||||
"pthread_self": {},
|
||||
"pthread_setspecific": {},
|
||||
"putc": {},
|
||||
"putchar": {},
|
||||
"puts": {},
|
||||
"qsort": {},
|
||||
"raise": {},
|
||||
"rand": {},
|
||||
"random": {},
|
||||
"random_r": {},
|
||||
"read": {},
|
||||
"readdir": {},
|
||||
"readdir64": {},
|
||||
"readlink": {},
|
||||
"readv": {},
|
||||
"realloc": {},
|
||||
"reallocarray": {},
|
||||
"realpath": {},
|
||||
"recv": {},
|
||||
"recvfrom": {},
|
||||
"recvmsg": {},
|
||||
"remove": {},
|
||||
"rename": {},
|
||||
"rewind": {},
|
||||
"rindex": {},
|
||||
"rint": {},
|
||||
"rmdir": {},
|
||||
"round": {},
|
||||
"scalbn": {},
|
||||
"scalbnl": {},
|
||||
"sched_yield": {},
|
||||
"select": {},
|
||||
"send": {},
|
||||
"sendmsg": {},
|
||||
"sendto": {},
|
||||
"setbuf": {},
|
||||
"setenv": {},
|
||||
"setjmp": {},
|
||||
"setlocale": {},
|
||||
"setrlimit": {},
|
||||
"setrlimit64": {},
|
||||
"setsid": {},
|
||||
"setsockopt": {},
|
||||
"setstate": {},
|
||||
"setvbuf": {},
|
||||
"shmat": {},
|
||||
"shmctl": {},
|
||||
"shmdt": {},
|
||||
"shutdown": {},
|
||||
"sigaction": {},
|
||||
"signal": {},
|
||||
"sin": {},
|
||||
"sinf": {},
|
||||
"sinh": {},
|
||||
"sleep": {},
|
||||
"snprintf": {},
|
||||
"socket": {},
|
||||
"sprintf": {},
|
||||
"sqrt": {},
|
||||
"srand48": {},
|
||||
"sscanf": {},
|
||||
"stat": {},
|
||||
"stat64": {},
|
||||
"stderr": {},
|
||||
"stdin": {},
|
||||
"stdout": {},
|
||||
"strcasecmp": {},
|
||||
"strcat": {},
|
||||
"strchr": {},
|
||||
"strcmp": {},
|
||||
"strcpy": {},
|
||||
"strcspn": {},
|
||||
"strdup": {},
|
||||
"strerror": {},
|
||||
"strerror_r": {},
|
||||
"strlen": {},
|
||||
"strncmp": {},
|
||||
"strncpy": {},
|
||||
"strnlen": {},
|
||||
"strpbrk": {},
|
||||
"strrchr": {},
|
||||
"strspn": {},
|
||||
"strstr": {},
|
||||
"strtod": {},
|
||||
"strtof": {},
|
||||
"strtoimax": {},
|
||||
"strtol": {},
|
||||
"strtold": {},
|
||||
"strtoll": {},
|
||||
"strtoul": {},
|
||||
"strtoull": {},
|
||||
"strtoumax": {},
|
||||
"symlink": {},
|
||||
"sysconf": {},
|
||||
"system": {},
|
||||
"tan": {},
|
||||
"tanh": {},
|
||||
"tcgetattr": {},
|
||||
"tcsendbreak": {},
|
||||
"tcsetattr": {},
|
||||
"time": {},
|
||||
"tmpfile": {},
|
||||
"tolower": {},
|
||||
"toupper": {},
|
||||
"trunc": {},
|
||||
"tzset": {},
|
||||
"umask": {},
|
||||
"uname": {},
|
||||
"ungetc": {},
|
||||
"unlink": {},
|
||||
"unsetenv": {},
|
||||
"usleep": {},
|
||||
"utime": {},
|
||||
"utimes": {},
|
||||
"uuid_generate_random": {},
|
||||
"uuid_parse": {},
|
||||
"uuid_unparse": {},
|
||||
"vasprintf": {},
|
||||
"vfprintf": {},
|
||||
"vprintf": {},
|
||||
"vsnprintf": {},
|
||||
"vsprintf": {},
|
||||
"waitpid": {},
|
||||
"wcschr": {},
|
||||
"wctomb": {},
|
||||
"wcwidth": {},
|
||||
"write": {},
|
||||
"writev": {},
|
||||
"zero_struct_address": {},
|
||||
}
|
512
vendor/modernc.org/libc/capi_openbsd_386.go
generated
vendored
Normal file
512
vendor/modernc.org/libc/capi_openbsd_386.go
generated
vendored
Normal file
|
@ -0,0 +1,512 @@
|
|||
// Code generated by 'go generate' - DO NOT EDIT.
|
||||
|
||||
package libc // import "modernc.org/libc"
|
||||
|
||||
var CAPI = map[string]struct{}{
|
||||
"_C_ctype_": {},
|
||||
"_IO_putc": {},
|
||||
"_ThreadRuneLocale": {},
|
||||
"___errno_location": {},
|
||||
"___runetype": {},
|
||||
"__assert": {},
|
||||
"__assert13": {},
|
||||
"__assert2": {},
|
||||
"__assert_fail": {},
|
||||
"__builtin___memcpy_chk": {},
|
||||
"__builtin___memmove_chk": {},
|
||||
"__builtin___memset_chk": {},
|
||||
"__builtin___snprintf_chk": {},
|
||||
"__builtin___sprintf_chk": {},
|
||||
"__builtin___strcat_chk": {},
|
||||
"__builtin___strcpy_chk": {},
|
||||
"__builtin___strncpy_chk": {},
|
||||
"__builtin___vsnprintf_chk": {},
|
||||
"__builtin_abort": {},
|
||||
"__builtin_abs": {},
|
||||
"__builtin_add_overflowInt64": {},
|
||||
"__builtin_add_overflowUint32": {},
|
||||
"__builtin_add_overflowUint64": {},
|
||||
"__builtin_bswap16": {},
|
||||
"__builtin_bswap32": {},
|
||||
"__builtin_bswap64": {},
|
||||
"__builtin_bzero": {},
|
||||
"__builtin_clz": {},
|
||||
"__builtin_clzl": {},
|
||||
"__builtin_clzll": {},
|
||||
"__builtin_constant_p_impl": {},
|
||||
"__builtin_copysign": {},
|
||||
"__builtin_copysignf": {},
|
||||
"__builtin_copysignl": {},
|
||||
"__builtin_exit": {},
|
||||
"__builtin_expect": {},
|
||||
"__builtin_fabs": {},
|
||||
"__builtin_fabsf": {},
|
||||
"__builtin_fabsl": {},
|
||||
"__builtin_free": {},
|
||||
"__builtin_getentropy": {},
|
||||
"__builtin_huge_val": {},
|
||||
"__builtin_huge_valf": {},
|
||||
"__builtin_inf": {},
|
||||
"__builtin_inff": {},
|
||||
"__builtin_infl": {},
|
||||
"__builtin_isnan": {},
|
||||
"__builtin_isunordered": {},
|
||||
"__builtin_llabs": {},
|
||||
"__builtin_malloc": {},
|
||||
"__builtin_memcmp": {},
|
||||
"__builtin_memcpy": {},
|
||||
"__builtin_memset": {},
|
||||
"__builtin_mmap": {},
|
||||
"__builtin_mul_overflowInt64": {},
|
||||
"__builtin_mul_overflowUint128": {},
|
||||
"__builtin_mul_overflowUint64": {},
|
||||
"__builtin_nan": {},
|
||||
"__builtin_nanf": {},
|
||||
"__builtin_nanl": {},
|
||||
"__builtin_object_size": {},
|
||||
"__builtin_popcount": {},
|
||||
"__builtin_popcountl": {},
|
||||
"__builtin_prefetch": {},
|
||||
"__builtin_printf": {},
|
||||
"__builtin_snprintf": {},
|
||||
"__builtin_sprintf": {},
|
||||
"__builtin_strchr": {},
|
||||
"__builtin_strcmp": {},
|
||||
"__builtin_strcpy": {},
|
||||
"__builtin_strlen": {},
|
||||
"__builtin_sub_overflowInt64": {},
|
||||
"__builtin_trap": {},
|
||||
"__builtin_unreachable": {},
|
||||
"__ccgo_dmesg": {},
|
||||
"__ccgo_getMutexType": {},
|
||||
"__ccgo_in6addr_anyp": {},
|
||||
"__ccgo_pthreadAttrGetDetachState": {},
|
||||
"__ccgo_pthreadMutexattrGettype": {},
|
||||
"__ccgo_sqlite3_log": {},
|
||||
"__cmsg_nxthdr": {},
|
||||
"__ctype_get_mb_cur_max": {},
|
||||
"__errno": {},
|
||||
"__errno_location": {},
|
||||
"__error": {},
|
||||
"__floatscan": {},
|
||||
"__h_errno_location": {},
|
||||
"__inet_aton": {},
|
||||
"__inet_ntoa": {},
|
||||
"__intscan": {},
|
||||
"__isalnum_l": {},
|
||||
"__isalpha_l": {},
|
||||
"__isdigit_l": {},
|
||||
"__islower_l": {},
|
||||
"__isnan": {},
|
||||
"__isnanf": {},
|
||||
"__isnanl": {},
|
||||
"__isoc99_sscanf": {},
|
||||
"__isprint_l": {},
|
||||
"__isspace_l": {},
|
||||
"__isthreaded": {},
|
||||
"__isupper_l": {},
|
||||
"__isxdigit_l": {},
|
||||
"__lookup_ipliteral": {},
|
||||
"__lookup_name": {},
|
||||
"__lookup_serv": {},
|
||||
"__mb_sb_limit": {},
|
||||
"__runes_for_locale": {},
|
||||
"__sF": {},
|
||||
"__shgetc": {},
|
||||
"__shlim": {},
|
||||
"__srget": {},
|
||||
"__stderrp": {},
|
||||
"__stdinp": {},
|
||||
"__stdoutp": {},
|
||||
"__swbuf": {},
|
||||
"__sync_add_and_fetch_uint32": {},
|
||||
"__sync_sub_and_fetch_uint32": {},
|
||||
"__syscall1": {},
|
||||
"__syscall3": {},
|
||||
"__syscall4": {},
|
||||
"__toread": {},
|
||||
"__toread_needs_stdio_exit": {},
|
||||
"__uflow": {},
|
||||
"__xuname": {},
|
||||
"_ctype_": {},
|
||||
"_exit": {},
|
||||
"_longjmp": {},
|
||||
"_obstack_begin": {},
|
||||
"_obstack_newchunk": {},
|
||||
"_setjmp": {},
|
||||
"_tolower_tab_": {},
|
||||
"_toupper_tab_": {},
|
||||
"abort": {},
|
||||
"abs": {},
|
||||
"accept": {},
|
||||
"access": {},
|
||||
"acos": {},
|
||||
"acosh": {},
|
||||
"alarm": {},
|
||||
"asin": {},
|
||||
"asinh": {},
|
||||
"atan": {},
|
||||
"atan2": {},
|
||||
"atanh": {},
|
||||
"atexit": {},
|
||||
"atof": {},
|
||||
"atoi": {},
|
||||
"atol": {},
|
||||
"backtrace": {},
|
||||
"backtrace_symbols_fd": {},
|
||||
"bind": {},
|
||||
"bsearch": {},
|
||||
"bswap16": {},
|
||||
"bswap32": {},
|
||||
"bswap64": {},
|
||||
"bzero": {},
|
||||
"calloc": {},
|
||||
"ceil": {},
|
||||
"ceilf": {},
|
||||
"cfgetospeed": {},
|
||||
"cfsetispeed": {},
|
||||
"cfsetospeed": {},
|
||||
"chdir": {},
|
||||
"chflags": {},
|
||||
"chmod": {},
|
||||
"chown": {},
|
||||
"clock_gettime": {},
|
||||
"close": {},
|
||||
"closedir": {},
|
||||
"confstr": {},
|
||||
"connect": {},
|
||||
"copysign": {},
|
||||
"copysignf": {},
|
||||
"copysignl": {},
|
||||
"cos": {},
|
||||
"cosf": {},
|
||||
"cosh": {},
|
||||
"ctime": {},
|
||||
"ctime_r": {},
|
||||
"dlclose": {},
|
||||
"dlerror": {},
|
||||
"dlopen": {},
|
||||
"dlsym": {},
|
||||
"dup2": {},
|
||||
"endpwent": {},
|
||||
"environ": {},
|
||||
"execvp": {},
|
||||
"exit": {},
|
||||
"exp": {},
|
||||
"fabs": {},
|
||||
"fabsf": {},
|
||||
"fabsl": {},
|
||||
"fchmod": {},
|
||||
"fchown": {},
|
||||
"fclose": {},
|
||||
"fcntl": {},
|
||||
"fcntl64": {},
|
||||
"fdopen": {},
|
||||
"ferror": {},
|
||||
"fflush": {},
|
||||
"fgetc": {},
|
||||
"fgets": {},
|
||||
"fileno": {},
|
||||
"floor": {},
|
||||
"fmod": {},
|
||||
"fmodl": {},
|
||||
"fopen": {},
|
||||
"fopen64": {},
|
||||
"fork": {},
|
||||
"fprintf": {},
|
||||
"fputc": {},
|
||||
"fputs": {},
|
||||
"fread": {},
|
||||
"free": {},
|
||||
"freeaddrinfo": {},
|
||||
"frexp": {},
|
||||
"fscanf": {},
|
||||
"fseek": {},
|
||||
"fstat": {},
|
||||
"fstat64": {},
|
||||
"fsync": {},
|
||||
"ftell": {},
|
||||
"ftruncate": {},
|
||||
"fts64_close": {},
|
||||
"fts64_open": {},
|
||||
"fts64_read": {},
|
||||
"fts_close": {},
|
||||
"fts_open": {},
|
||||
"fts_read": {},
|
||||
"fwrite": {},
|
||||
"gai_strerror": {},
|
||||
"getaddrinfo": {},
|
||||
"getc": {},
|
||||
"getcwd": {},
|
||||
"getegid": {},
|
||||
"getentropy": {},
|
||||
"getenv": {},
|
||||
"geteuid": {},
|
||||
"getgid": {},
|
||||
"getgrgid": {},
|
||||
"getgrgid_r": {},
|
||||
"getgrnam": {},
|
||||
"getgrnam_r": {},
|
||||
"gethostbyaddr": {},
|
||||
"gethostbyaddr_r": {},
|
||||
"gethostbyname": {},
|
||||
"gethostbyname2": {},
|
||||
"gethostbyname2_r": {},
|
||||
"gethostname": {},
|
||||
"getnameinfo": {},
|
||||
"getpagesize": {},
|
||||
"getpeername": {},
|
||||
"getpid": {},
|
||||
"getpwnam": {},
|
||||
"getpwnam_r": {},
|
||||
"getpwuid": {},
|
||||
"getpwuid_r": {},
|
||||
"getresgid": {},
|
||||
"getresuid": {},
|
||||
"getrlimit": {},
|
||||
"getrlimit64": {},
|
||||
"getrusage": {},
|
||||
"getservbyname": {},
|
||||
"getsockname": {},
|
||||
"getsockopt": {},
|
||||
"gettimeofday": {},
|
||||
"getuid": {},
|
||||
"gmtime_r": {},
|
||||
"h_errno": {},
|
||||
"htonl": {},
|
||||
"htons": {},
|
||||
"hypot": {},
|
||||
"inet_ntoa": {},
|
||||
"inet_ntop": {},
|
||||
"inet_pton": {},
|
||||
"initstate": {},
|
||||
"initstate_r": {},
|
||||
"ioctl": {},
|
||||
"isalnum": {},
|
||||
"isalpha": {},
|
||||
"isascii": {},
|
||||
"isatty": {},
|
||||
"isblank": {},
|
||||
"isdigit": {},
|
||||
"islower": {},
|
||||
"isnan": {},
|
||||
"isnanf": {},
|
||||
"isnanl": {},
|
||||
"isprint": {},
|
||||
"isspace": {},
|
||||
"isupper": {},
|
||||
"isxdigit": {},
|
||||
"kill": {},
|
||||
"ldexp": {},
|
||||
"link": {},
|
||||
"listen": {},
|
||||
"llabs": {},
|
||||
"localtime": {},
|
||||
"localtime_r": {},
|
||||
"log": {},
|
||||
"log10": {},
|
||||
"log2": {},
|
||||
"longjmp": {},
|
||||
"lrand48": {},
|
||||
"lseek": {},
|
||||
"lseek64": {},
|
||||
"lstat": {},
|
||||
"lstat64": {},
|
||||
"malloc": {},
|
||||
"mblen": {},
|
||||
"mbstowcs": {},
|
||||
"mbtowc": {},
|
||||
"memchr": {},
|
||||
"memcmp": {},
|
||||
"memcpy": {},
|
||||
"memmove": {},
|
||||
"memset": {},
|
||||
"mkdir": {},
|
||||
"mkfifo": {},
|
||||
"mknod": {},
|
||||
"mkostemp": {},
|
||||
"mkstemp": {},
|
||||
"mkstemp64": {},
|
||||
"mkstemps": {},
|
||||
"mkstemps64": {},
|
||||
"mktime": {},
|
||||
"mmap": {},
|
||||
"modf": {},
|
||||
"munmap": {},
|
||||
"nl_langinfo": {},
|
||||
"ntohs": {},
|
||||
"obstack_free": {},
|
||||
"obstack_vprintf": {},
|
||||
"open": {},
|
||||
"open64": {},
|
||||
"opendir": {},
|
||||
"openpty": {},
|
||||
"pathconf": {},
|
||||
"pause": {},
|
||||
"pclose": {},
|
||||
"perror": {},
|
||||
"pipe": {},
|
||||
"poll": {},
|
||||
"popen": {},
|
||||
"pow": {},
|
||||
"pread": {},
|
||||
"printf": {},
|
||||
"pselect": {},
|
||||
"pthread_attr_destroy": {},
|
||||
"pthread_attr_getdetachstate": {},
|
||||
"pthread_attr_init": {},
|
||||
"pthread_attr_setdetachstate": {},
|
||||
"pthread_attr_setscope": {},
|
||||
"pthread_attr_setstacksize": {},
|
||||
"pthread_cond_broadcast": {},
|
||||
"pthread_cond_destroy": {},
|
||||
"pthread_cond_init": {},
|
||||
"pthread_cond_signal": {},
|
||||
"pthread_cond_timedwait": {},
|
||||
"pthread_cond_wait": {},
|
||||
"pthread_create": {},
|
||||
"pthread_detach": {},
|
||||
"pthread_equal": {},
|
||||
"pthread_exit": {},
|
||||
"pthread_getspecific": {},
|
||||
"pthread_join": {},
|
||||
"pthread_key_create": {},
|
||||
"pthread_key_delete": {},
|
||||
"pthread_mutex_destroy": {},
|
||||
"pthread_mutex_init": {},
|
||||
"pthread_mutex_lock": {},
|
||||
"pthread_mutex_trylock": {},
|
||||
"pthread_mutex_unlock": {},
|
||||
"pthread_mutexattr_destroy": {},
|
||||
"pthread_mutexattr_init": {},
|
||||
"pthread_mutexattr_settype": {},
|
||||
"pthread_self": {},
|
||||
"pthread_setspecific": {},
|
||||
"putc": {},
|
||||
"putchar": {},
|
||||
"puts": {},
|
||||
"qsort": {},
|
||||
"raise": {},
|
||||
"rand": {},
|
||||
"random": {},
|
||||
"random_r": {},
|
||||
"read": {},
|
||||
"readdir": {},
|
||||
"readdir64": {},
|
||||
"readlink": {},
|
||||
"readv": {},
|
||||
"realloc": {},
|
||||
"reallocarray": {},
|
||||
"realpath": {},
|
||||
"recv": {},
|
||||
"recvfrom": {},
|
||||
"recvmsg": {},
|
||||
"remove": {},
|
||||
"rename": {},
|
||||
"rewind": {},
|
||||
"rindex": {},
|
||||
"rint": {},
|
||||
"rmdir": {},
|
||||
"round": {},
|
||||
"scalbn": {},
|
||||
"scalbnl": {},
|
||||
"sched_yield": {},
|
||||
"select": {},
|
||||
"send": {},
|
||||
"sendmsg": {},
|
||||
"sendto": {},
|
||||
"setbuf": {},
|
||||
"setenv": {},
|
||||
"setjmp": {},
|
||||
"setlocale": {},
|
||||
"setrlimit": {},
|
||||
"setrlimit64": {},
|
||||
"setsid": {},
|
||||
"setsockopt": {},
|
||||
"setstate": {},
|
||||
"setvbuf": {},
|
||||
"shmat": {},
|
||||
"shmctl": {},
|
||||
"shmdt": {},
|
||||
"shutdown": {},
|
||||
"sigaction": {},
|
||||
"signal": {},
|
||||
"sin": {},
|
||||
"sinf": {},
|
||||
"sinh": {},
|
||||
"sleep": {},
|
||||
"snprintf": {},
|
||||
"socket": {},
|
||||
"sprintf": {},
|
||||
"sqrt": {},
|
||||
"srand48": {},
|
||||
"sscanf": {},
|
||||
"stat": {},
|
||||
"stat64": {},
|
||||
"stderr": {},
|
||||
"stdin": {},
|
||||
"stdout": {},
|
||||
"strcasecmp": {},
|
||||
"strcat": {},
|
||||
"strchr": {},
|
||||
"strcmp": {},
|
||||
"strcpy": {},
|
||||
"strcspn": {},
|
||||
"strdup": {},
|
||||
"strerror": {},
|
||||
"strerror_r": {},
|
||||
"strlen": {},
|
||||
"strncmp": {},
|
||||
"strncpy": {},
|
||||
"strnlen": {},
|
||||
"strpbrk": {},
|
||||
"strrchr": {},
|
||||
"strspn": {},
|
||||
"strstr": {},
|
||||
"strtod": {},
|
||||
"strtof": {},
|
||||
"strtoimax": {},
|
||||
"strtol": {},
|
||||
"strtold": {},
|
||||
"strtoll": {},
|
||||
"strtoul": {},
|
||||
"strtoull": {},
|
||||
"strtoumax": {},
|
||||
"symlink": {},
|
||||
"sysconf": {},
|
||||
"system": {},
|
||||
"tan": {},
|
||||
"tanh": {},
|
||||
"tcgetattr": {},
|
||||
"tcsendbreak": {},
|
||||
"tcsetattr": {},
|
||||
"time": {},
|
||||
"tmpfile": {},
|
||||
"tolower": {},
|
||||
"toupper": {},
|
||||
"trunc": {},
|
||||
"tzset": {},
|
||||
"umask": {},
|
||||
"uname": {},
|
||||
"ungetc": {},
|
||||
"unlink": {},
|
||||
"unsetenv": {},
|
||||
"usleep": {},
|
||||
"utime": {},
|
||||
"utimes": {},
|
||||
"uuid_generate_random": {},
|
||||
"uuid_parse": {},
|
||||
"uuid_unparse": {},
|
||||
"vasprintf": {},
|
||||
"vfprintf": {},
|
||||
"vprintf": {},
|
||||
"vsnprintf": {},
|
||||
"vsprintf": {},
|
||||
"waitpid": {},
|
||||
"wcschr": {},
|
||||
"wctomb": {},
|
||||
"wcwidth": {},
|
||||
"write": {},
|
||||
"writev": {},
|
||||
"zero_struct_address": {},
|
||||
}
|
513
vendor/modernc.org/libc/capi_openbsd_amd64.go
generated
vendored
Normal file
513
vendor/modernc.org/libc/capi_openbsd_amd64.go
generated
vendored
Normal file
|
@ -0,0 +1,513 @@
|
|||
// Code generated by 'go generate' - DO NOT EDIT.
|
||||
|
||||
package libc // import "modernc.org/libc"
|
||||
|
||||
var CAPI = map[string]struct{}{
|
||||
"_C_ctype_": {},
|
||||
"_IO_putc": {},
|
||||
"_ThreadRuneLocale": {},
|
||||
"___errno_location": {},
|
||||
"___runetype": {},
|
||||
"__assert": {},
|
||||
"__assert13": {},
|
||||
"__assert2": {},
|
||||
"__assert_fail": {},
|
||||
"__builtin___memcpy_chk": {},
|
||||
"__builtin___memmove_chk": {},
|
||||
"__builtin___memset_chk": {},
|
||||
"__builtin___snprintf_chk": {},
|
||||
"__builtin___sprintf_chk": {},
|
||||
"__builtin___strcat_chk": {},
|
||||
"__builtin___strcpy_chk": {},
|
||||
"__builtin___strncpy_chk": {},
|
||||
"__builtin___vsnprintf_chk": {},
|
||||
"__builtin_abort": {},
|
||||
"__builtin_abs": {},
|
||||
"__builtin_add_overflowInt64": {},
|
||||
"__builtin_add_overflowUint32": {},
|
||||
"__builtin_add_overflowUint64": {},
|
||||
"__builtin_bswap16": {},
|
||||
"__builtin_bswap32": {},
|
||||
"__builtin_bswap64": {},
|
||||
"__builtin_bzero": {},
|
||||
"__builtin_clz": {},
|
||||
"__builtin_clzl": {},
|
||||
"__builtin_clzll": {},
|
||||
"__builtin_constant_p_impl": {},
|
||||
"__builtin_copysign": {},
|
||||
"__builtin_copysignf": {},
|
||||
"__builtin_copysignl": {},
|
||||
"__builtin_exit": {},
|
||||
"__builtin_expect": {},
|
||||
"__builtin_fabs": {},
|
||||
"__builtin_fabsf": {},
|
||||
"__builtin_fabsl": {},
|
||||
"__builtin_free": {},
|
||||
"__builtin_getentropy": {},
|
||||
"__builtin_huge_val": {},
|
||||
"__builtin_huge_valf": {},
|
||||
"__builtin_inf": {},
|
||||
"__builtin_inff": {},
|
||||
"__builtin_infl": {},
|
||||
"__builtin_isblank": {},
|
||||
"__builtin_isnan": {},
|
||||
"__builtin_isunordered": {},
|
||||
"__builtin_llabs": {},
|
||||
"__builtin_malloc": {},
|
||||
"__builtin_memcmp": {},
|
||||
"__builtin_memcpy": {},
|
||||
"__builtin_memset": {},
|
||||
"__builtin_mmap": {},
|
||||
"__builtin_mul_overflowInt64": {},
|
||||
"__builtin_mul_overflowUint128": {},
|
||||
"__builtin_mul_overflowUint64": {},
|
||||
"__builtin_nan": {},
|
||||
"__builtin_nanf": {},
|
||||
"__builtin_nanl": {},
|
||||
"__builtin_object_size": {},
|
||||
"__builtin_popcount": {},
|
||||
"__builtin_popcountl": {},
|
||||
"__builtin_prefetch": {},
|
||||
"__builtin_printf": {},
|
||||
"__builtin_snprintf": {},
|
||||
"__builtin_sprintf": {},
|
||||
"__builtin_strchr": {},
|
||||
"__builtin_strcmp": {},
|
||||
"__builtin_strcpy": {},
|
||||
"__builtin_strlen": {},
|
||||
"__builtin_sub_overflowInt64": {},
|
||||
"__builtin_trap": {},
|
||||
"__builtin_unreachable": {},
|
||||
"__ccgo_dmesg": {},
|
||||
"__ccgo_getMutexType": {},
|
||||
"__ccgo_in6addr_anyp": {},
|
||||
"__ccgo_pthreadAttrGetDetachState": {},
|
||||
"__ccgo_pthreadMutexattrGettype": {},
|
||||
"__ccgo_sqlite3_log": {},
|
||||
"__cmsg_nxthdr": {},
|
||||
"__ctype_get_mb_cur_max": {},
|
||||
"__errno": {},
|
||||
"__errno_location": {},
|
||||
"__error": {},
|
||||
"__floatscan": {},
|
||||
"__h_errno_location": {},
|
||||
"__inet_aton": {},
|
||||
"__inet_ntoa": {},
|
||||
"__intscan": {},
|
||||
"__isalnum_l": {},
|
||||
"__isalpha_l": {},
|
||||
"__isdigit_l": {},
|
||||
"__islower_l": {},
|
||||
"__isnan": {},
|
||||
"__isnanf": {},
|
||||
"__isnanl": {},
|
||||
"__isoc99_sscanf": {},
|
||||
"__isprint_l": {},
|
||||
"__isspace_l": {},
|
||||
"__isthreaded": {},
|
||||
"__isupper_l": {},
|
||||
"__isxdigit_l": {},
|
||||
"__lookup_ipliteral": {},
|
||||
"__lookup_name": {},
|
||||
"__lookup_serv": {},
|
||||
"__mb_sb_limit": {},
|
||||
"__runes_for_locale": {},
|
||||
"__sF": {},
|
||||
"__shgetc": {},
|
||||
"__shlim": {},
|
||||
"__srget": {},
|
||||
"__stderrp": {},
|
||||
"__stdinp": {},
|
||||
"__stdoutp": {},
|
||||
"__swbuf": {},
|
||||
"__sync_add_and_fetch_uint32": {},
|
||||
"__sync_sub_and_fetch_uint32": {},
|
||||
"__syscall1": {},
|
||||
"__syscall3": {},
|
||||
"__syscall4": {},
|
||||
"__toread": {},
|
||||
"__toread_needs_stdio_exit": {},
|
||||
"__uflow": {},
|
||||
"__xuname": {},
|
||||
"_ctype_": {},
|
||||
"_exit": {},
|
||||
"_longjmp": {},
|
||||
"_obstack_begin": {},
|
||||
"_obstack_newchunk": {},
|
||||
"_setjmp": {},
|
||||
"_tolower_tab_": {},
|
||||
"_toupper_tab_": {},
|
||||
"abort": {},
|
||||
"abs": {},
|
||||
"accept": {},
|
||||
"access": {},
|
||||
"acos": {},
|
||||
"acosh": {},
|
||||
"alarm": {},
|
||||
"asin": {},
|
||||
"asinh": {},
|
||||
"atan": {},
|
||||
"atan2": {},
|
||||
"atanh": {},
|
||||
"atexit": {},
|
||||
"atof": {},
|
||||
"atoi": {},
|
||||
"atol": {},
|
||||
"backtrace": {},
|
||||
"backtrace_symbols_fd": {},
|
||||
"bind": {},
|
||||
"bsearch": {},
|
||||
"bswap16": {},
|
||||
"bswap32": {},
|
||||
"bswap64": {},
|
||||
"bzero": {},
|
||||
"calloc": {},
|
||||
"ceil": {},
|
||||
"ceilf": {},
|
||||
"cfgetospeed": {},
|
||||
"cfsetispeed": {},
|
||||
"cfsetospeed": {},
|
||||
"chdir": {},
|
||||
"chflags": {},
|
||||
"chmod": {},
|
||||
"chown": {},
|
||||
"clock_gettime": {},
|
||||
"close": {},
|
||||
"closedir": {},
|
||||
"confstr": {},
|
||||
"connect": {},
|
||||
"copysign": {},
|
||||
"copysignf": {},
|
||||
"copysignl": {},
|
||||
"cos": {},
|
||||
"cosf": {},
|
||||
"cosh": {},
|
||||
"ctime": {},
|
||||
"ctime_r": {},
|
||||
"dlclose": {},
|
||||
"dlerror": {},
|
||||
"dlopen": {},
|
||||
"dlsym": {},
|
||||
"dup2": {},
|
||||
"endpwent": {},
|
||||
"environ": {},
|
||||
"execvp": {},
|
||||
"exit": {},
|
||||
"exp": {},
|
||||
"fabs": {},
|
||||
"fabsf": {},
|
||||
"fabsl": {},
|
||||
"fchmod": {},
|
||||
"fchown": {},
|
||||
"fclose": {},
|
||||
"fcntl": {},
|
||||
"fcntl64": {},
|
||||
"fdopen": {},
|
||||
"ferror": {},
|
||||
"fflush": {},
|
||||
"fgetc": {},
|
||||
"fgets": {},
|
||||
"fileno": {},
|
||||
"floor": {},
|
||||
"fmod": {},
|
||||
"fmodl": {},
|
||||
"fopen": {},
|
||||
"fopen64": {},
|
||||
"fork": {},
|
||||
"fprintf": {},
|
||||
"fputc": {},
|
||||
"fputs": {},
|
||||
"fread": {},
|
||||
"free": {},
|
||||
"freeaddrinfo": {},
|
||||
"frexp": {},
|
||||
"fscanf": {},
|
||||
"fseek": {},
|
||||
"fstat": {},
|
||||
"fstat64": {},
|
||||
"fsync": {},
|
||||
"ftell": {},
|
||||
"ftruncate": {},
|
||||
"fts64_close": {},
|
||||
"fts64_open": {},
|
||||
"fts64_read": {},
|
||||
"fts_close": {},
|
||||
"fts_open": {},
|
||||
"fts_read": {},
|
||||
"fwrite": {},
|
||||
"gai_strerror": {},
|
||||
"getaddrinfo": {},
|
||||
"getc": {},
|
||||
"getcwd": {},
|
||||
"getegid": {},
|
||||
"getentropy": {},
|
||||
"getenv": {},
|
||||
"geteuid": {},
|
||||
"getgid": {},
|
||||
"getgrgid": {},
|
||||
"getgrgid_r": {},
|
||||
"getgrnam": {},
|
||||
"getgrnam_r": {},
|
||||
"gethostbyaddr": {},
|
||||
"gethostbyaddr_r": {},
|
||||
"gethostbyname": {},
|
||||
"gethostbyname2": {},
|
||||
"gethostbyname2_r": {},
|
||||
"gethostname": {},
|
||||
"getnameinfo": {},
|
||||
"getpagesize": {},
|
||||
"getpeername": {},
|
||||
"getpid": {},
|
||||
"getpwnam": {},
|
||||
"getpwnam_r": {},
|
||||
"getpwuid": {},
|
||||
"getpwuid_r": {},
|
||||
"getresgid": {},
|
||||
"getresuid": {},
|
||||
"getrlimit": {},
|
||||
"getrlimit64": {},
|
||||
"getrusage": {},
|
||||
"getservbyname": {},
|
||||
"getsockname": {},
|
||||
"getsockopt": {},
|
||||
"gettimeofday": {},
|
||||
"getuid": {},
|
||||
"gmtime_r": {},
|
||||
"h_errno": {},
|
||||
"htonl": {},
|
||||
"htons": {},
|
||||
"hypot": {},
|
||||
"inet_ntoa": {},
|
||||
"inet_ntop": {},
|
||||
"inet_pton": {},
|
||||
"initstate": {},
|
||||
"initstate_r": {},
|
||||
"ioctl": {},
|
||||
"isalnum": {},
|
||||
"isalpha": {},
|
||||
"isascii": {},
|
||||
"isatty": {},
|
||||
"isblank": {},
|
||||
"isdigit": {},
|
||||
"islower": {},
|
||||
"isnan": {},
|
||||
"isnanf": {},
|
||||
"isnanl": {},
|
||||
"isprint": {},
|
||||
"isspace": {},
|
||||
"isupper": {},
|
||||
"isxdigit": {},
|
||||
"kill": {},
|
||||
"ldexp": {},
|
||||
"link": {},
|
||||
"listen": {},
|
||||
"llabs": {},
|
||||
"localtime": {},
|
||||
"localtime_r": {},
|
||||
"log": {},
|
||||
"log10": {},
|
||||
"log2": {},
|
||||
"longjmp": {},
|
||||
"lrand48": {},
|
||||
"lseek": {},
|
||||
"lseek64": {},
|
||||
"lstat": {},
|
||||
"lstat64": {},
|
||||
"malloc": {},
|
||||
"mblen": {},
|
||||
"mbstowcs": {},
|
||||
"mbtowc": {},
|
||||
"memchr": {},
|
||||
"memcmp": {},
|
||||
"memcpy": {},
|
||||
"memmove": {},
|
||||
"memset": {},
|
||||
"mkdir": {},
|
||||
"mkfifo": {},
|
||||
"mknod": {},
|
||||
"mkostemp": {},
|
||||
"mkstemp": {},
|
||||
"mkstemp64": {},
|
||||
"mkstemps": {},
|
||||
"mkstemps64": {},
|
||||
"mktime": {},
|
||||
"mmap": {},
|
||||
"modf": {},
|
||||
"munmap": {},
|
||||
"nl_langinfo": {},
|
||||
"ntohs": {},
|
||||
"obstack_free": {},
|
||||
"obstack_vprintf": {},
|
||||
"open": {},
|
||||
"open64": {},
|
||||
"opendir": {},
|
||||
"openpty": {},
|
||||
"pathconf": {},
|
||||
"pause": {},
|
||||
"pclose": {},
|
||||
"perror": {},
|
||||
"pipe": {},
|
||||
"poll": {},
|
||||
"popen": {},
|
||||
"pow": {},
|
||||
"pread": {},
|
||||
"printf": {},
|
||||
"pselect": {},
|
||||
"pthread_attr_destroy": {},
|
||||
"pthread_attr_getdetachstate": {},
|
||||
"pthread_attr_init": {},
|
||||
"pthread_attr_setdetachstate": {},
|
||||
"pthread_attr_setscope": {},
|
||||
"pthread_attr_setstacksize": {},
|
||||
"pthread_cond_broadcast": {},
|
||||
"pthread_cond_destroy": {},
|
||||
"pthread_cond_init": {},
|
||||
"pthread_cond_signal": {},
|
||||
"pthread_cond_timedwait": {},
|
||||
"pthread_cond_wait": {},
|
||||
"pthread_create": {},
|
||||
"pthread_detach": {},
|
||||
"pthread_equal": {},
|
||||
"pthread_exit": {},
|
||||
"pthread_getspecific": {},
|
||||
"pthread_join": {},
|
||||
"pthread_key_create": {},
|
||||
"pthread_key_delete": {},
|
||||
"pthread_mutex_destroy": {},
|
||||
"pthread_mutex_init": {},
|
||||
"pthread_mutex_lock": {},
|
||||
"pthread_mutex_trylock": {},
|
||||
"pthread_mutex_unlock": {},
|
||||
"pthread_mutexattr_destroy": {},
|
||||
"pthread_mutexattr_init": {},
|
||||
"pthread_mutexattr_settype": {},
|
||||
"pthread_self": {},
|
||||
"pthread_setspecific": {},
|
||||
"putc": {},
|
||||
"putchar": {},
|
||||
"puts": {},
|
||||
"qsort": {},
|
||||
"raise": {},
|
||||
"rand": {},
|
||||
"random": {},
|
||||
"random_r": {},
|
||||
"read": {},
|
||||
"readdir": {},
|
||||
"readdir64": {},
|
||||
"readlink": {},
|
||||
"readv": {},
|
||||
"realloc": {},
|
||||
"reallocarray": {},
|
||||
"realpath": {},
|
||||
"recv": {},
|
||||
"recvfrom": {},
|
||||
"recvmsg": {},
|
||||
"remove": {},
|
||||
"rename": {},
|
||||
"rewind": {},
|
||||
"rindex": {},
|
||||
"rint": {},
|
||||
"rmdir": {},
|
||||
"round": {},
|
||||
"scalbn": {},
|
||||
"scalbnl": {},
|
||||
"sched_yield": {},
|
||||
"select": {},
|
||||
"send": {},
|
||||
"sendmsg": {},
|
||||
"sendto": {},
|
||||
"setbuf": {},
|
||||
"setenv": {},
|
||||
"setjmp": {},
|
||||
"setlocale": {},
|
||||
"setrlimit": {},
|
||||
"setrlimit64": {},
|
||||
"setsid": {},
|
||||
"setsockopt": {},
|
||||
"setstate": {},
|
||||
"setvbuf": {},
|
||||
"shmat": {},
|
||||
"shmctl": {},
|
||||
"shmdt": {},
|
||||
"shutdown": {},
|
||||
"sigaction": {},
|
||||
"signal": {},
|
||||
"sin": {},
|
||||
"sinf": {},
|
||||
"sinh": {},
|
||||
"sleep": {},
|
||||
"snprintf": {},
|
||||
"socket": {},
|
||||
"sprintf": {},
|
||||
"sqrt": {},
|
||||
"srand48": {},
|
||||
"sscanf": {},
|
||||
"stat": {},
|
||||
"stat64": {},
|
||||
"stderr": {},
|
||||
"stdin": {},
|
||||
"stdout": {},
|
||||
"strcasecmp": {},
|
||||
"strcat": {},
|
||||
"strchr": {},
|
||||
"strcmp": {},
|
||||
"strcpy": {},
|
||||
"strcspn": {},
|
||||
"strdup": {},
|
||||
"strerror": {},
|
||||
"strerror_r": {},
|
||||
"strlen": {},
|
||||
"strncmp": {},
|
||||
"strncpy": {},
|
||||
"strnlen": {},
|
||||
"strpbrk": {},
|
||||
"strrchr": {},
|
||||
"strspn": {},
|
||||
"strstr": {},
|
||||
"strtod": {},
|
||||
"strtof": {},
|
||||
"strtoimax": {},
|
||||
"strtol": {},
|
||||
"strtold": {},
|
||||
"strtoll": {},
|
||||
"strtoul": {},
|
||||
"strtoull": {},
|
||||
"strtoumax": {},
|
||||
"symlink": {},
|
||||
"sysconf": {},
|
||||
"system": {},
|
||||
"tan": {},
|
||||
"tanh": {},
|
||||
"tcgetattr": {},
|
||||
"tcsendbreak": {},
|
||||
"tcsetattr": {},
|
||||
"time": {},
|
||||
"tmpfile": {},
|
||||
"tolower": {},
|
||||
"toupper": {},
|
||||
"trunc": {},
|
||||
"tzset": {},
|
||||
"umask": {},
|
||||
"uname": {},
|
||||
"ungetc": {},
|
||||
"unlink": {},
|
||||
"unsetenv": {},
|
||||
"usleep": {},
|
||||
"utime": {},
|
||||
"utimes": {},
|
||||
"uuid_generate_random": {},
|
||||
"uuid_parse": {},
|
||||
"uuid_unparse": {},
|
||||
"vasprintf": {},
|
||||
"vfprintf": {},
|
||||
"vprintf": {},
|
||||
"vsnprintf": {},
|
||||
"vsprintf": {},
|
||||
"waitpid": {},
|
||||
"wcschr": {},
|
||||
"wctomb": {},
|
||||
"wcwidth": {},
|
||||
"write": {},
|
||||
"writev": {},
|
||||
"zero_struct_address": {},
|
||||
}
|
513
vendor/modernc.org/libc/capi_openbsd_arm64.go
generated
vendored
Normal file
513
vendor/modernc.org/libc/capi_openbsd_arm64.go
generated
vendored
Normal file
|
@ -0,0 +1,513 @@
|
|||
// Code generated by 'go generate' - DO NOT EDIT.
|
||||
|
||||
package libc // import "modernc.org/libc"
|
||||
|
||||
var CAPI = map[string]struct{}{
|
||||
"_C_ctype_": {},
|
||||
"_IO_putc": {},
|
||||
"_ThreadRuneLocale": {},
|
||||
"___errno_location": {},
|
||||
"___runetype": {},
|
||||
"__assert": {},
|
||||
"__assert13": {},
|
||||
"__assert2": {},
|
||||
"__assert_fail": {},
|
||||
"__builtin___memcpy_chk": {},
|
||||
"__builtin___memmove_chk": {},
|
||||
"__builtin___memset_chk": {},
|
||||
"__builtin___snprintf_chk": {},
|
||||
"__builtin___sprintf_chk": {},
|
||||
"__builtin___strcat_chk": {},
|
||||
"__builtin___strcpy_chk": {},
|
||||
"__builtin___strncpy_chk": {},
|
||||
"__builtin___vsnprintf_chk": {},
|
||||
"__builtin_abort": {},
|
||||
"__builtin_abs": {},
|
||||
"__builtin_add_overflowInt64": {},
|
||||
"__builtin_add_overflowUint32": {},
|
||||
"__builtin_add_overflowUint64": {},
|
||||
"__builtin_bswap16": {},
|
||||
"__builtin_bswap32": {},
|
||||
"__builtin_bswap64": {},
|
||||
"__builtin_bzero": {},
|
||||
"__builtin_clz": {},
|
||||
"__builtin_clzl": {},
|
||||
"__builtin_clzll": {},
|
||||
"__builtin_constant_p_impl": {},
|
||||
"__builtin_copysign": {},
|
||||
"__builtin_copysignf": {},
|
||||
"__builtin_copysignl": {},
|
||||
"__builtin_exit": {},
|
||||
"__builtin_expect": {},
|
||||
"__builtin_fabs": {},
|
||||
"__builtin_fabsf": {},
|
||||
"__builtin_fabsl": {},
|
||||
"__builtin_free": {},
|
||||
"__builtin_getentropy": {},
|
||||
"__builtin_huge_val": {},
|
||||
"__builtin_huge_valf": {},
|
||||
"__builtin_inf": {},
|
||||
"__builtin_inff": {},
|
||||
"__builtin_infl": {},
|
||||
"__builtin_isblank": {},
|
||||
"__builtin_isnan": {},
|
||||
"__builtin_isunordered": {},
|
||||
"__builtin_llabs": {},
|
||||
"__builtin_malloc": {},
|
||||
"__builtin_memcmp": {},
|
||||
"__builtin_memcpy": {},
|
||||
"__builtin_memset": {},
|
||||
"__builtin_mmap": {},
|
||||
"__builtin_mul_overflowInt64": {},
|
||||
"__builtin_mul_overflowUint128": {},
|
||||
"__builtin_mul_overflowUint64": {},
|
||||
"__builtin_nan": {},
|
||||
"__builtin_nanf": {},
|
||||
"__builtin_nanl": {},
|
||||
"__builtin_object_size": {},
|
||||
"__builtin_popcount": {},
|
||||
"__builtin_popcountl": {},
|
||||
"__builtin_prefetch": {},
|
||||
"__builtin_printf": {},
|
||||
"__builtin_snprintf": {},
|
||||
"__builtin_sprintf": {},
|
||||
"__builtin_strchr": {},
|
||||
"__builtin_strcmp": {},
|
||||
"__builtin_strcpy": {},
|
||||
"__builtin_strlen": {},
|
||||
"__builtin_sub_overflowInt64": {},
|
||||
"__builtin_trap": {},
|
||||
"__builtin_unreachable": {},
|
||||
"__ccgo_dmesg": {},
|
||||
"__ccgo_getMutexType": {},
|
||||
"__ccgo_in6addr_anyp": {},
|
||||
"__ccgo_pthreadAttrGetDetachState": {},
|
||||
"__ccgo_pthreadMutexattrGettype": {},
|
||||
"__ccgo_sqlite3_log": {},
|
||||
"__cmsg_nxthdr": {},
|
||||
"__ctype_get_mb_cur_max": {},
|
||||
"__errno": {},
|
||||
"__errno_location": {},
|
||||
"__error": {},
|
||||
"__floatscan": {},
|
||||
"__h_errno_location": {},
|
||||
"__inet_aton": {},
|
||||
"__inet_ntoa": {},
|
||||
"__intscan": {},
|
||||
"__isalnum_l": {},
|
||||
"__isalpha_l": {},
|
||||
"__isdigit_l": {},
|
||||
"__islower_l": {},
|
||||
"__isnan": {},
|
||||
"__isnanf": {},
|
||||
"__isnanl": {},
|
||||
"__isoc99_sscanf": {},
|
||||
"__isprint_l": {},
|
||||
"__isspace_l": {},
|
||||
"__isthreaded": {},
|
||||
"__isupper_l": {},
|
||||
"__isxdigit_l": {},
|
||||
"__lookup_ipliteral": {},
|
||||
"__lookup_name": {},
|
||||
"__lookup_serv": {},
|
||||
"__mb_sb_limit": {},
|
||||
"__runes_for_locale": {},
|
||||
"__sF": {},
|
||||
"__shgetc": {},
|
||||
"__shlim": {},
|
||||
"__srget": {},
|
||||
"__stderrp": {},
|
||||
"__stdinp": {},
|
||||
"__stdoutp": {},
|
||||
"__swbuf": {},
|
||||
"__sync_add_and_fetch_uint32": {},
|
||||
"__sync_sub_and_fetch_uint32": {},
|
||||
"__syscall1": {},
|
||||
"__syscall3": {},
|
||||
"__syscall4": {},
|
||||
"__toread": {},
|
||||
"__toread_needs_stdio_exit": {},
|
||||
"__uflow": {},
|
||||
"__xuname": {},
|
||||
"_ctype_": {},
|
||||
"_exit": {},
|
||||
"_longjmp": {},
|
||||
"_obstack_begin": {},
|
||||
"_obstack_newchunk": {},
|
||||
"_setjmp": {},
|
||||
"_tolower_tab_": {},
|
||||
"_toupper_tab_": {},
|
||||
"abort": {},
|
||||
"abs": {},
|
||||
"accept": {},
|
||||
"access": {},
|
||||
"acos": {},
|
||||
"acosh": {},
|
||||
"alarm": {},
|
||||
"asin": {},
|
||||
"asinh": {},
|
||||
"atan": {},
|
||||
"atan2": {},
|
||||
"atanh": {},
|
||||
"atexit": {},
|
||||
"atof": {},
|
||||
"atoi": {},
|
||||
"atol": {},
|
||||
"backtrace": {},
|
||||
"backtrace_symbols_fd": {},
|
||||
"bind": {},
|
||||
"bsearch": {},
|
||||
"bswap16": {},
|
||||
"bswap32": {},
|
||||
"bswap64": {},
|
||||
"bzero": {},
|
||||
"calloc": {},
|
||||
"ceil": {},
|
||||
"ceilf": {},
|
||||
"cfgetospeed": {},
|
||||
"cfsetispeed": {},
|
||||
"cfsetospeed": {},
|
||||
"chdir": {},
|
||||
"chflags": {},
|
||||
"chmod": {},
|
||||
"chown": {},
|
||||
"clock_gettime": {},
|
||||
"close": {},
|
||||
"closedir": {},
|
||||
"confstr": {},
|
||||
"connect": {},
|
||||
"copysign": {},
|
||||
"copysignf": {},
|
||||
"copysignl": {},
|
||||
"cos": {},
|
||||
"cosf": {},
|
||||
"cosh": {},
|
||||
"ctime": {},
|
||||
"ctime_r": {},
|
||||
"dlclose": {},
|
||||
"dlerror": {},
|
||||
"dlopen": {},
|
||||
"dlsym": {},
|
||||
"dup2": {},
|
||||
"endpwent": {},
|
||||
"environ": {},
|
||||
"execvp": {},
|
||||
"exit": {},
|
||||
"exp": {},
|
||||
"fabs": {},
|
||||
"fabsf": {},
|
||||
"fabsl": {},
|
||||
"fchmod": {},
|
||||
"fchown": {},
|
||||
"fclose": {},
|
||||
"fcntl": {},
|
||||
"fcntl64": {},
|
||||
"fdopen": {},
|
||||
"ferror": {},
|
||||
"fflush": {},
|
||||
"fgetc": {},
|
||||
"fgets": {},
|
||||
"fileno": {},
|
||||
"floor": {},
|
||||
"fmod": {},
|
||||
"fmodl": {},
|
||||
"fopen": {},
|
||||
"fopen64": {},
|
||||
"fork": {},
|
||||
"fprintf": {},
|
||||
"fputc": {},
|
||||
"fputs": {},
|
||||
"fread": {},
|
||||
"free": {},
|
||||
"freeaddrinfo": {},
|
||||
"frexp": {},
|
||||
"fscanf": {},
|
||||
"fseek": {},
|
||||
"fstat": {},
|
||||
"fstat64": {},
|
||||
"fsync": {},
|
||||
"ftell": {},
|
||||
"ftruncate": {},
|
||||
"fts64_close": {},
|
||||
"fts64_open": {},
|
||||
"fts64_read": {},
|
||||
"fts_close": {},
|
||||
"fts_open": {},
|
||||
"fts_read": {},
|
||||
"fwrite": {},
|
||||
"gai_strerror": {},
|
||||
"getaddrinfo": {},
|
||||
"getc": {},
|
||||
"getcwd": {},
|
||||
"getegid": {},
|
||||
"getentropy": {},
|
||||
"getenv": {},
|
||||
"geteuid": {},
|
||||
"getgid": {},
|
||||
"getgrgid": {},
|
||||
"getgrgid_r": {},
|
||||
"getgrnam": {},
|
||||
"getgrnam_r": {},
|
||||
"gethostbyaddr": {},
|
||||
"gethostbyaddr_r": {},
|
||||
"gethostbyname": {},
|
||||
"gethostbyname2": {},
|
||||
"gethostbyname2_r": {},
|
||||
"gethostname": {},
|
||||
"getnameinfo": {},
|
||||
"getpagesize": {},
|
||||
"getpeername": {},
|
||||
"getpid": {},
|
||||
"getpwnam": {},
|
||||
"getpwnam_r": {},
|
||||
"getpwuid": {},
|
||||
"getpwuid_r": {},
|
||||
"getresgid": {},
|
||||
"getresuid": {},
|
||||
"getrlimit": {},
|
||||
"getrlimit64": {},
|
||||
"getrusage": {},
|
||||
"getservbyname": {},
|
||||
"getsockname": {},
|
||||
"getsockopt": {},
|
||||
"gettimeofday": {},
|
||||
"getuid": {},
|
||||
"gmtime_r": {},
|
||||
"h_errno": {},
|
||||
"htonl": {},
|
||||
"htons": {},
|
||||
"hypot": {},
|
||||
"inet_ntoa": {},
|
||||
"inet_ntop": {},
|
||||
"inet_pton": {},
|
||||
"initstate": {},
|
||||
"initstate_r": {},
|
||||
"ioctl": {},
|
||||
"isalnum": {},
|
||||
"isalpha": {},
|
||||
"isascii": {},
|
||||
"isatty": {},
|
||||
"isblank": {},
|
||||
"isdigit": {},
|
||||
"islower": {},
|
||||
"isnan": {},
|
||||
"isnanf": {},
|
||||
"isnanl": {},
|
||||
"isprint": {},
|
||||
"isspace": {},
|
||||
"isupper": {},
|
||||
"isxdigit": {},
|
||||
"kill": {},
|
||||
"ldexp": {},
|
||||
"link": {},
|
||||
"listen": {},
|
||||
"llabs": {},
|
||||
"localtime": {},
|
||||
"localtime_r": {},
|
||||
"log": {},
|
||||
"log10": {},
|
||||
"log2": {},
|
||||
"longjmp": {},
|
||||
"lrand48": {},
|
||||
"lseek": {},
|
||||
"lseek64": {},
|
||||
"lstat": {},
|
||||
"lstat64": {},
|
||||
"malloc": {},
|
||||
"mblen": {},
|
||||
"mbstowcs": {},
|
||||
"mbtowc": {},
|
||||
"memchr": {},
|
||||
"memcmp": {},
|
||||
"memcpy": {},
|
||||
"memmove": {},
|
||||
"memset": {},
|
||||
"mkdir": {},
|
||||
"mkfifo": {},
|
||||
"mknod": {},
|
||||
"mkostemp": {},
|
||||
"mkstemp": {},
|
||||
"mkstemp64": {},
|
||||
"mkstemps": {},
|
||||
"mkstemps64": {},
|
||||
"mktime": {},
|
||||
"mmap": {},
|
||||
"modf": {},
|
||||
"munmap": {},
|
||||
"nl_langinfo": {},
|
||||
"ntohs": {},
|
||||
"obstack_free": {},
|
||||
"obstack_vprintf": {},
|
||||
"open": {},
|
||||
"open64": {},
|
||||
"opendir": {},
|
||||
"openpty": {},
|
||||
"pathconf": {},
|
||||
"pause": {},
|
||||
"pclose": {},
|
||||
"perror": {},
|
||||
"pipe": {},
|
||||
"poll": {},
|
||||
"popen": {},
|
||||
"pow": {},
|
||||
"pread": {},
|
||||
"printf": {},
|
||||
"pselect": {},
|
||||
"pthread_attr_destroy": {},
|
||||
"pthread_attr_getdetachstate": {},
|
||||
"pthread_attr_init": {},
|
||||
"pthread_attr_setdetachstate": {},
|
||||
"pthread_attr_setscope": {},
|
||||
"pthread_attr_setstacksize": {},
|
||||
"pthread_cond_broadcast": {},
|
||||
"pthread_cond_destroy": {},
|
||||
"pthread_cond_init": {},
|
||||
"pthread_cond_signal": {},
|
||||
"pthread_cond_timedwait": {},
|
||||
"pthread_cond_wait": {},
|
||||
"pthread_create": {},
|
||||
"pthread_detach": {},
|
||||
"pthread_equal": {},
|
||||
"pthread_exit": {},
|
||||
"pthread_getspecific": {},
|
||||
"pthread_join": {},
|
||||
"pthread_key_create": {},
|
||||
"pthread_key_delete": {},
|
||||
"pthread_mutex_destroy": {},
|
||||
"pthread_mutex_init": {},
|
||||
"pthread_mutex_lock": {},
|
||||
"pthread_mutex_trylock": {},
|
||||
"pthread_mutex_unlock": {},
|
||||
"pthread_mutexattr_destroy": {},
|
||||
"pthread_mutexattr_init": {},
|
||||
"pthread_mutexattr_settype": {},
|
||||
"pthread_self": {},
|
||||
"pthread_setspecific": {},
|
||||
"putc": {},
|
||||
"putchar": {},
|
||||
"puts": {},
|
||||
"qsort": {},
|
||||
"raise": {},
|
||||
"rand": {},
|
||||
"random": {},
|
||||
"random_r": {},
|
||||
"read": {},
|
||||
"readdir": {},
|
||||
"readdir64": {},
|
||||
"readlink": {},
|
||||
"readv": {},
|
||||
"realloc": {},
|
||||
"reallocarray": {},
|
||||
"realpath": {},
|
||||
"recv": {},
|
||||
"recvfrom": {},
|
||||
"recvmsg": {},
|
||||
"remove": {},
|
||||
"rename": {},
|
||||
"rewind": {},
|
||||
"rindex": {},
|
||||
"rint": {},
|
||||
"rmdir": {},
|
||||
"round": {},
|
||||
"scalbn": {},
|
||||
"scalbnl": {},
|
||||
"sched_yield": {},
|
||||
"select": {},
|
||||
"send": {},
|
||||
"sendmsg": {},
|
||||
"sendto": {},
|
||||
"setbuf": {},
|
||||
"setenv": {},
|
||||
"setjmp": {},
|
||||
"setlocale": {},
|
||||
"setrlimit": {},
|
||||
"setrlimit64": {},
|
||||
"setsid": {},
|
||||
"setsockopt": {},
|
||||
"setstate": {},
|
||||
"setvbuf": {},
|
||||
"shmat": {},
|
||||
"shmctl": {},
|
||||
"shmdt": {},
|
||||
"shutdown": {},
|
||||
"sigaction": {},
|
||||
"signal": {},
|
||||
"sin": {},
|
||||
"sinf": {},
|
||||
"sinh": {},
|
||||
"sleep": {},
|
||||
"snprintf": {},
|
||||
"socket": {},
|
||||
"sprintf": {},
|
||||
"sqrt": {},
|
||||
"srand48": {},
|
||||
"sscanf": {},
|
||||
"stat": {},
|
||||
"stat64": {},
|
||||
"stderr": {},
|
||||
"stdin": {},
|
||||
"stdout": {},
|
||||
"strcasecmp": {},
|
||||
"strcat": {},
|
||||
"strchr": {},
|
||||
"strcmp": {},
|
||||
"strcpy": {},
|
||||
"strcspn": {},
|
||||
"strdup": {},
|
||||
"strerror": {},
|
||||
"strerror_r": {},
|
||||
"strlen": {},
|
||||
"strncmp": {},
|
||||
"strncpy": {},
|
||||
"strnlen": {},
|
||||
"strpbrk": {},
|
||||
"strrchr": {},
|
||||
"strspn": {},
|
||||
"strstr": {},
|
||||
"strtod": {},
|
||||
"strtof": {},
|
||||
"strtoimax": {},
|
||||
"strtol": {},
|
||||
"strtold": {},
|
||||
"strtoll": {},
|
||||
"strtoul": {},
|
||||
"strtoull": {},
|
||||
"strtoumax": {},
|
||||
"symlink": {},
|
||||
"sysconf": {},
|
||||
"system": {},
|
||||
"tan": {},
|
||||
"tanh": {},
|
||||
"tcgetattr": {},
|
||||
"tcsendbreak": {},
|
||||
"tcsetattr": {},
|
||||
"time": {},
|
||||
"tmpfile": {},
|
||||
"tolower": {},
|
||||
"toupper": {},
|
||||
"trunc": {},
|
||||
"tzset": {},
|
||||
"umask": {},
|
||||
"uname": {},
|
||||
"ungetc": {},
|
||||
"unlink": {},
|
||||
"unsetenv": {},
|
||||
"usleep": {},
|
||||
"utime": {},
|
||||
"utimes": {},
|
||||
"uuid_generate_random": {},
|
||||
"uuid_parse": {},
|
||||
"uuid_unparse": {},
|
||||
"vasprintf": {},
|
||||
"vfprintf": {},
|
||||
"vprintf": {},
|
||||
"vsnprintf": {},
|
||||
"vsprintf": {},
|
||||
"waitpid": {},
|
||||
"wcschr": {},
|
||||
"wctomb": {},
|
||||
"wcwidth": {},
|
||||
"write": {},
|
||||
"writev": {},
|
||||
"zero_struct_address": {},
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue