Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: goplus/llpkg
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: bzip2/v1.0.1
Choose a base ref
...
head repository: goplus/llpkg
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: sqlite3/v1.0.1
Choose a head ref
  • 2 commits
  • 14 files changed
  • 2 contributors

Commits on May 23, 2025

  1. Copy the full SHA
    070323c View commit details

Commits on May 26, 2025

  1. Release-as: sqlite3/v1.0.1 (#68)

    Co-authored-by: Rick Guo <coopticks@outlook.com>
    luoliwoshang and MeteorsLiu authored May 26, 2025
    Copy the full SHA
    ce0d81f View commit details
Showing with 615 additions and 1,761 deletions.
  1. +1 −1 bzip3/_demo/test/test.go
  2. +2 −0 bzip3/bzip3_autogen_link.go
  3. +1 −1 bzip3/go.mod
  4. +2 −2 bzip3/go.sum
  5. +12 −12 bzip3/libbz3.go
  6. +0 −49 bzip3/llcppg.symb.json
  7. +2 −2 sqlite3/_demo/hello/hello.go
  8. +1 −1 sqlite3/go.mod
  9. +2 −2 sqlite3/go.sum
  10. +13 −1 sqlite3/llcppg.cfg
  11. +0 −1,113 sqlite3/llcppg.symb.json
  12. +575 −575 sqlite3/sqlite3.go
  13. +2 −0 sqlite3/sqlite3_autogen_link.go
  14. +2 −2 sqlite3/sqlite3ext.go
2 changes: 1 addition & 1 deletion bzip3/_demo/test/test.go
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ package main
import (
"fmt"

"github.com/goplus/llgo/c"
"github.com/goplus/lib/c"
zip "github.com/goplus/llpkg/bzip3"
)

2 changes: 2 additions & 0 deletions bzip3/bzip3_autogen_link.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package bzip3

import _ "github.com/goplus/lib/c"

const LLGoPackage string = "link: $(pkg-config --libs bzip3);"
2 changes: 1 addition & 1 deletion bzip3/go.mod
Original file line number Diff line number Diff line change
@@ -2,4 +2,4 @@ module github.com/goplus/llpkg/bzip3

go 1.20

require github.com/goplus/llgo v0.10.0
require github.com/goplus/lib v0.2.0
4 changes: 2 additions & 2 deletions bzip3/go.sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github.com/goplus/llgo v0.10.0 h1:s3U3cnO3cploF1xCCJleAb16NQFAmHxdUmdrNhRH3hY=
github.com/goplus/llgo v0.10.0/go.mod h1:YfOHsT/g3lc9b4GclLj812YzdSsJr0kd3CCB830TqHE=
github.com/goplus/lib v0.2.0 h1:AjqkN1XK5H23wZMMlpaUYAMCDAdSBQ2NMFrLtSh7W4g=
github.com/goplus/lib v0.2.0/go.mod h1:SgJv3oPqLLHCu0gcL46ejOP3x7/2ry2Jtxu7ta32kp0=
24 changes: 12 additions & 12 deletions bzip3/libbz3.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package bzip3

import (
"github.com/goplus/llgo/c"
"github.com/goplus/lib/c"
_ "unsafe"
)

@@ -15,21 +15,21 @@ type State struct {
* @brief Get bzip3 version.
*/
//go:linkname Version C.bz3_version
func Version() *int8
func Version() *c.Char

/**
* @brief Get the last error number associated with a given state.
*/
// llgo:link (*State).LastError C.bz3_last_error
func (recv_ *State) LastError() int8 {
func (recv_ *State) LastError() c.Int8T {
return 0
}

/**
* @brief Return a user-readable message explaining the cause of the last error.
*/
// llgo:link (*State).Strerror C.bz3_strerror
func (recv_ *State) Strerror() *int8 {
func (recv_ *State) Strerror() *c.Char {
return nil
}

@@ -39,7 +39,7 @@ func (recv_ *State) Strerror() *int8 {
* Returns NULL in case allocation fails or the block size is not between 65K and 511M
*/
//go:linkname New C.bz3_new
func New(block_size int32) *State
func New(block_size c.Int32T) *State

/**
* @brief Free the memory occupied by a block encoder state.
@@ -52,7 +52,7 @@ func (recv_ *State) Free() {
* @brief Return the recommended size of the output buffer for the compression functions.
*/
//go:linkname Bound C.bz3_bound
func Bound(input_size uintptr) uintptr
func Bound(input_size c.SizeT) c.SizeT

/**
* @brief Compress a frame. This function does not support parallelism
@@ -63,7 +63,7 @@ func Bound(input_size uintptr) uintptr
* out_size must be at least equal to `bz3_bound(in_size)'.
*/
//go:linkname Compress C.bz3_compress
func Compress(block_size uint32, in *uint8, out *uint8, in_size uintptr, out_size *uintptr) c.Int
func Compress(block_size c.Uint32T, in *c.Uint8T, out *c.Uint8T, in_size c.SizeT, out_size *c.SizeT) c.Int

/**
* @brief Decompress a frame. This function does not support parallelism
@@ -73,7 +73,7 @@ func Compress(block_size uint32, in *uint8, out *uint8, in_size uintptr, out_siz
* Make sure to set out_size to the size of the output buffer before the operation.
*/
//go:linkname Decompress C.bz3_decompress
func Decompress(in *uint8, out *uint8, in_size uintptr, out_size *uintptr) c.Int
func Decompress(in *c.Uint8T, out *c.Uint8T, in_size c.SizeT, out_size *c.SizeT) c.Int

/**
* @brief Calculate the minimal memory required for compression with the given block size.
@@ -131,15 +131,15 @@ func Decompress(in *uint8, out *uint8, in_size uintptr, out_size *uintptr) c.Int
* @return The total number of bytes required for compression, or 0 if block_size is invalid
*/
//go:linkname MinMemoryNeeded C.bz3_min_memory_needed
func MinMemoryNeeded(block_size int32) uintptr
func MinMemoryNeeded(block_size c.Int32T) c.SizeT

/**
* @brief Encode a single block. Returns the amount of bytes written to `buffer'.
* `buffer' must be able to hold at least `bz3_bound(size)' bytes. The size must not
* exceed the block size associated with the state.
*/
// llgo:link (*State).EncodeBlock C.bz3_encode_block
func (recv_ *State) EncodeBlock(buffer *uint8, size int32) int32 {
func (recv_ *State) EncodeBlock(buffer *c.Uint8T, size c.Int32T) c.Int32T {
return 0
}

@@ -160,7 +160,7 @@ func (recv_ *State) EncodeBlock(buffer *uint8, size int32) int32 {
* @param orig_size The original size of the data before compression.
*/
// llgo:link (*State).DecodeBlock C.bz3_decode_block
func (recv_ *State) DecodeBlock(buffer *uint8, buffer_size uintptr, compressed_size int32, orig_size int32) int32 {
func (recv_ *State) DecodeBlock(buffer *c.Uint8T, buffer_size c.SizeT, compressed_size c.Int32T, orig_size c.Int32T) c.Int32T {
return 0
}

@@ -185,4 +185,4 @@ func (recv_ *State) DecodeBlock(buffer *uint8, buffer_size uintptr, compressed_s
* in turn
*/
//go:linkname OrigSizeSufficientForDecode C.bz3_orig_size_sufficient_for_decode
func OrigSizeSufficientForDecode(block *uint8, block_size uintptr, orig_size int32) c.Int
func OrigSizeSufficientForDecode(block *c.Uint8T, block_size c.SizeT, orig_size c.Int32T) c.Int
49 changes: 0 additions & 49 deletions bzip3/llcppg.symb.json

This file was deleted.

4 changes: 2 additions & 2 deletions sqlite3/_demo/hello/hello.go
Original file line number Diff line number Diff line change
@@ -3,8 +3,8 @@ package main
import (
"github.com/goplus/llpkg/sqlite3"

"github.com/goplus/llgo/c"
"github.com/goplus/llgo/c/os"
"github.com/goplus/lib/c"
"github.com/goplus/lib/c/os"
)

func main() {
2 changes: 1 addition & 1 deletion sqlite3/go.mod
Original file line number Diff line number Diff line change
@@ -2,4 +2,4 @@ module github.com/goplus/llpkg/sqlite3

go 1.20

require github.com/goplus/llgo v0.10.0
require github.com/goplus/lib v0.2.0
4 changes: 2 additions & 2 deletions sqlite3/go.sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github.com/goplus/llgo v0.10.0 h1:s3U3cnO3cploF1xCCJleAb16NQFAmHxdUmdrNhRH3hY=
github.com/goplus/llgo v0.10.0/go.mod h1:YfOHsT/g3lc9b4GclLj812YzdSsJr0kd3CCB830TqHE=
github.com/goplus/lib v0.2.0 h1:AjqkN1XK5H23wZMMlpaUYAMCDAdSBQ2NMFrLtSh7W4g=
github.com/goplus/lib v0.2.0/go.mod h1:SgJv3oPqLLHCu0gcL46ejOP3x7/2ry2Jtxu7ta32kp0=
14 changes: 13 additions & 1 deletion sqlite3/llcppg.cfg
Original file line number Diff line number Diff line change
@@ -7,5 +7,17 @@
"sqlite3.h"
],
"trimPrefixes": ["sqlite3_","SQLITE_"],
"cplusplus": false
"cplusplus": false,
"symMap":{
"sqlite3_finalize":".Close",
"sqlite3_open":"DoOpen",
"sqlite3_open16":"DoOpen16",
"sqlite3_open_v2":"DoOpenV2",
"sqlite3_prepare":".DoPrepare",
"sqlite3_prepare16":".DoPrepare16",
"sqlite3_prepare16_v3":".DoPrepare16V3",
"sqlite3_prepare_v2":".DoPrepareV2",
"sqlite3_prepare_v3":".DoPrepareV3",
"sqlite3_prepare16_v2":".DoPrepare16V2"
}
}
1,113 changes: 0 additions & 1,113 deletions sqlite3/llcppg.symb.json

This file was deleted.

1,150 changes: 575 additions & 575 deletions sqlite3/sqlite3.go

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions sqlite3/sqlite3_autogen_link.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package sqlite3

import _ "github.com/goplus/lib/c"

const LLGoPackage string = "link: $(pkg-config --libs sqlite3);"
4 changes: 2 additions & 2 deletions sqlite3/sqlite3ext.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package sqlite3

import (
"github.com/goplus/llgo/c"
"github.com/goplus/lib/c"
_ "unsafe"
)

// llgo:type C
type LoadextEntry func(*Sqlite3, **int8, *ApiRoutines) c.Int
type LoadextEntry func(*Sqlite3, **c.Char, *ApiRoutines) c.Int