diff --git a/CLAUDE.md b/CLAUDE.md index 79f1970fc..19bdbfb2b 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -140,7 +140,7 @@ Each contains: When adding a new feature to llcppg, follow this workflow to verify your changes: 1. **Create a test case** in `cl/internal/convert/_testdata/` with: - - A `conf/` directory containing `llcppg.cfg` and `llcppg.symb.json` + - A `conf/` directory containing `llcppg.cfg` and `llcppg.sym.json` - An `hfile/` directory with your test header files - Configuration that exercises your new feature @@ -163,7 +163,7 @@ When adding a new feature to llcppg, follow this workflow to verify your changes cl/internal/convert/_testdata/yourfeature/ ├── conf/ │ ├── llcppg.cfg -│ └── llcppg.symb.json +│ └── llcppg.sym.json ├── hfile/ │ └── test.h └── gogensig.expect (generated with gen:true) diff --git a/_cmptest/llcppgend_test.go b/_cmptest/llcppgend_test.go index 6515a1371..2e0ea7d11 100644 --- a/_cmptest/llcppgend_test.go +++ b/_cmptest/llcppgend_test.go @@ -225,7 +225,7 @@ func testFrom(t *testing.T, tc testCase, isStatic bool, gen bool) { t.Fatal(err) } - // llcppg.symb.json is a middle file + // llcppg.sym.json is a middle file os.Remove(filepath.Join(resultDir, config.LLCPPG_SYMB)) copyFile(cfgPath, filepath.Join(resultDir, tc.pkg.Name, config.LLCPPG_CFG)) diff --git a/cl/internal/convert/_testdata/_depcjson/conf/llcppg.symb.json b/cl/internal/convert/_testdata/_depcjson/conf/llcppg.sym.json similarity index 100% rename from cl/internal/convert/_testdata/_depcjson/conf/llcppg.symb.json rename to cl/internal/convert/_testdata/_depcjson/conf/llcppg.sym.json diff --git a/cl/internal/convert/_testdata/_depwithversion/conf/llcppg.symb.json b/cl/internal/convert/_testdata/_depwithversion/conf/llcppg.sym.json similarity index 100% rename from cl/internal/convert/_testdata/_depwithversion/conf/llcppg.symb.json rename to cl/internal/convert/_testdata/_depwithversion/conf/llcppg.sym.json diff --git a/cl/internal/convert/_testdata/_systopkg/conf/llcppg.symb.json b/cl/internal/convert/_testdata/_systopkg/conf/llcppg.sym.json similarity index 100% rename from cl/internal/convert/_testdata/_systopkg/conf/llcppg.symb.json rename to cl/internal/convert/_testdata/_systopkg/conf/llcppg.sym.json diff --git a/cl/internal/convert/_testdata/avoidkeyword/conf/llcppg.symb.json b/cl/internal/convert/_testdata/avoidkeyword/conf/llcppg.sym.json similarity index 100% rename from cl/internal/convert/_testdata/avoidkeyword/conf/llcppg.symb.json rename to cl/internal/convert/_testdata/avoidkeyword/conf/llcppg.sym.json diff --git a/cl/internal/convert/_testdata/forwarddecl/conf/llcppg.symb.json b/cl/internal/convert/_testdata/forwarddecl/conf/llcppg.sym.json similarity index 100% rename from cl/internal/convert/_testdata/forwarddecl/conf/llcppg.symb.json rename to cl/internal/convert/_testdata/forwarddecl/conf/llcppg.sym.json diff --git a/cl/internal/convert/_testdata/funcrefer/conf/llcppg.symb.json b/cl/internal/convert/_testdata/funcrefer/conf/llcppg.sym.json similarity index 100% rename from cl/internal/convert/_testdata/funcrefer/conf/llcppg.symb.json rename to cl/internal/convert/_testdata/funcrefer/conf/llcppg.sym.json diff --git a/cl/internal/convert/_testdata/gettext/conf/llcppg.symb.json b/cl/internal/convert/_testdata/gettext/conf/llcppg.sym.json similarity index 100% rename from cl/internal/convert/_testdata/gettext/conf/llcppg.symb.json rename to cl/internal/convert/_testdata/gettext/conf/llcppg.sym.json diff --git a/cl/internal/convert/_testdata/gpgerror/conf/llcppg.symb.json b/cl/internal/convert/_testdata/gpgerror/conf/llcppg.sym.json similarity index 100% rename from cl/internal/convert/_testdata/gpgerror/conf/llcppg.symb.json rename to cl/internal/convert/_testdata/gpgerror/conf/llcppg.sym.json diff --git a/cl/internal/convert/_testdata/ignoresym/conf/llcppg.symb.json b/cl/internal/convert/_testdata/ignoresym/conf/llcppg.sym.json similarity index 100% rename from cl/internal/convert/_testdata/ignoresym/conf/llcppg.symb.json rename to cl/internal/convert/_testdata/ignoresym/conf/llcppg.sym.json diff --git a/cl/internal/convert/_testdata/keepcomment/conf/llcppg.symb.json b/cl/internal/convert/_testdata/keepcomment/conf/llcppg.sym.json similarity index 100% rename from cl/internal/convert/_testdata/keepcomment/conf/llcppg.symb.json rename to cl/internal/convert/_testdata/keepcomment/conf/llcppg.sym.json diff --git a/cl/internal/convert/_testdata/methodreturn/conf/llcppg.symb.json b/cl/internal/convert/_testdata/methodreturn/conf/llcppg.sym.json similarity index 100% rename from cl/internal/convert/_testdata/methodreturn/conf/llcppg.symb.json rename to cl/internal/convert/_testdata/methodreturn/conf/llcppg.sym.json diff --git a/cl/internal/convert/_testdata/pubfile/conf/llcppg.symb.json b/cl/internal/convert/_testdata/pubfile/conf/llcppg.sym.json similarity index 100% rename from cl/internal/convert/_testdata/pubfile/conf/llcppg.symb.json rename to cl/internal/convert/_testdata/pubfile/conf/llcppg.sym.json diff --git a/cl/internal/convert/_testdata/receiver/conf/llcppg.symb.json b/cl/internal/convert/_testdata/receiver/conf/llcppg.sym.json similarity index 100% rename from cl/internal/convert/_testdata/receiver/conf/llcppg.symb.json rename to cl/internal/convert/_testdata/receiver/conf/llcppg.sym.json diff --git a/cl/internal/convert/_testdata/redefine/conf/llcppg.symb.json b/cl/internal/convert/_testdata/redefine/conf/llcppg.sym.json similarity index 100% rename from cl/internal/convert/_testdata/redefine/conf/llcppg.symb.json rename to cl/internal/convert/_testdata/redefine/conf/llcppg.sym.json diff --git a/cl/internal/convert/_testdata/stdtype/conf/llcppg.symb.json b/cl/internal/convert/_testdata/stdtype/conf/llcppg.sym.json similarity index 100% rename from cl/internal/convert/_testdata/stdtype/conf/llcppg.symb.json rename to cl/internal/convert/_testdata/stdtype/conf/llcppg.sym.json diff --git a/cl/internal/convert/_testdata/xml2/conf/llcppg.symb.json b/cl/internal/convert/_testdata/xml2/conf/llcppg.sym.json similarity index 100% rename from cl/internal/convert/_testdata/xml2/conf/llcppg.symb.json rename to cl/internal/convert/_testdata/xml2/conf/llcppg.sym.json diff --git a/cl/internal/convert/funcname.go b/cl/internal/convert/funcname.go index 69c24c9b7..e3fa2b247 100644 --- a/cl/internal/convert/funcname.go +++ b/cl/internal/convert/funcname.go @@ -7,7 +7,7 @@ import ( ) // GoFuncSpec parses and stores components of a Go function name -// Input examples from llcppg.symb.json's "go" field: +// Input examples from llcppg.sym.json's "go" field: // 1. Simple function: "AddPatchToArray" // 2. Method with pointer receiver: "(*Sqlite3Stmt).Sqlite3BindParameterIndex" // 3. Method with value receiver: "CJSONBool.CJSONCreateBool" diff --git a/cmd/gogensig/testdata/cjson/conf/llcppg.symb.json b/cmd/gogensig/testdata/cjson/conf/llcppg.sym.json similarity index 100% rename from cmd/gogensig/testdata/cjson/conf/llcppg.symb.json rename to cmd/gogensig/testdata/cjson/conf/llcppg.sym.json diff --git a/cmd/gogensig/testdata/lua/conf/llcppg.symb.json b/cmd/gogensig/testdata/lua/conf/llcppg.sym.json similarity index 100% rename from cmd/gogensig/testdata/lua/conf/llcppg.symb.json rename to cmd/gogensig/testdata/lua/conf/llcppg.sym.json diff --git a/cmd/gogensig/testdata/sqlite/conf/llcppg.symb.json b/cmd/gogensig/testdata/sqlite/conf/llcppg.sym.json similarity index 100% rename from cmd/gogensig/testdata/sqlite/conf/llcppg.symb.json rename to cmd/gogensig/testdata/sqlite/conf/llcppg.sym.json diff --git a/cmd/llcppg/llcppg.go b/cmd/llcppg/llcppg.go index 39de3505d..05f5e15c4 100644 --- a/cmd/llcppg/llcppg.go +++ b/cmd/llcppg/llcppg.go @@ -114,7 +114,7 @@ func main() { flag.BoolVar(&vSigfetch, "vfetch", false, "Enable verbose of llcppsigfetch") flag.BoolVar(&vSymg, "vsymg", false, "Enable verbose of llcppsymg") flag.BoolVar(&vGogen, "vgogen", false, "Enable verbose of gogensig") - flag.BoolVar(&symbGen, "symbgen", false, "Only use llcppsymg to generate llcppg.symb.json") + flag.BoolVar(&symbGen, "symbgen", false, "Only use llcppsymg to generate llcppg.sym.json") flag.BoolVar(&codeGen, "codegen", false, "Only use (llcppsigfetch & gogensig) to generate go code binding") flag.BoolVar(&help, "h", false, "Display help information") flag.BoolVar(&help, "help", false, "Display help information") diff --git a/config/config.go b/config/config.go index ae703d724..566113ed7 100644 --- a/config/config.go +++ b/config/config.go @@ -8,7 +8,7 @@ import ( ) const LLCPPG_CFG = "llcppg.cfg" -const LLCPPG_SYMB = "llcppg.symb.json" +const LLCPPG_SYMB = "llcppg.sym.json" const LLCPPG_SIGFETCH = "llcppg.sigfetch.json" const LLCPPG_PUB = "llcppg.pub" diff --git a/config/load.go b/config/load.go index 402bdf46f..d7bdf3e30 100644 --- a/config/load.go +++ b/config/load.go @@ -34,7 +34,7 @@ func ConfigFromReader(reader io.Reader) (Config, error) { return config, nil } -// llcppg.symb.json +// llcppg.sym.json func GetSymTableFromFile(symFile string) (symTable *SymTable, err error) { bytes, err := os.ReadFile(symFile) if err != nil { diff --git a/config/testdata/llcppg.symb.json b/config/testdata/llcppg.sym.json similarity index 100% rename from config/testdata/llcppg.symb.json rename to config/testdata/llcppg.sym.json diff --git a/doc/en/dev/llcppg.md b/doc/en/dev/llcppg.md index 3bb86ad06..7b975f0a6 100644 --- a/doc/en/dev/llcppg.md +++ b/doc/en/dev/llcppg.md @@ -828,7 +828,7 @@ llcppsymg is the symbol table generator in the llcppg toolchain, responsible for 1. Parse library symbols: Extract exported symbols from libraries using the nm tool 2. Parse header file declarations: Analyze C/C++ header files using libclang for function declarations -3. Find intersection: Match library symbols with header declarations and then generate symbol table named `llcppg.symb.json`. +3. Find intersection: Match library symbols with header declarations and then generate symbol table named `llcppg.sym.json`. #### Static Library Support @@ -888,7 +888,7 @@ For example, to convert `(*CJSON).PrintUnformatted` from a method to a function, } } ``` -and the `llcppg.symb.json` will be: +and the `llcppg.sym.json` will be: ```json [ { @@ -949,7 +949,7 @@ gogensig - # read pkg-info-file from stdin ``` #### Function Generation -During execution, gogensig only generates functions whose corresponding mangle exists in `llcppg.symb.json`, determining whether to generate functions/methods with specified Go names by parsing the go field corresponding to the mangle. +During execution, gogensig only generates functions whose corresponding mangle exists in `llcppg.sym.json`, determining whether to generate functions/methods with specified Go names by parsing the go field corresponding to the mangle. 1. Regular function format: "FunctionName" * Generates regular functions, using `//go:linkname` annotation