Skip to content

Commit

Permalink
Add non-working PoC using c-for-go
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed Nov 27, 2023
1 parent fbbbcd4 commit 02a93ef
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
5 changes: 5 additions & 0 deletions go/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
all: .check
c-for-go radare2.yml

.check:
c-for-go || echo "https://github.com/xlab/c-for-go"
53 changes: 53 additions & 0 deletions go/radare2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
GENERATOR:
PackageName: radare2
PackageDescription: "Package radare2 provides Go bindings for radare2."
PackageLicense: "LGPLv2"
FlagGroups:
- {name: LDFLAGS, flags: [-lr_core]}
SysIncludes:
- r_core.h

PARSER:
Arch: arm
SourcesPaths:
- r_core.h
IncludePaths:
# NOTE: Replace these paths if you want to re-generate.
- ../../radare2/libr/include
- /usr/local/include/libr
- /usr/include/libr
Defines:
R2_GO: {}

TRANSLATOR:
ConstRules:
defines: expand
enum: expand
PtrTips:
function:
- {target: ^r_*$, tips: [0,arr,size,ref]}
TypeTips:
type:
- {target: R*$, self: plain}
function:
- {target: ^r_$, self: plain}
Rules:
global:
- {action: accept, from: "^R_API"}
- {action: replace, from: "^EGL"}
function:
- {action: accept, from: ^r_}
- {action: replace, from: ^r_}
- {action: ignore, from: ^_}
type:
- {action: replace, from: "_t$"}
const:
- {action: ignore, from: R2_DEFAULT_DISPLAY}
- {transform: lower}
private:
- {transform: unexport}
post-global:
- {action: doc, from: "^egl", to: "https://www.radare.org"}
- {transform: export}
- {load: snakecase}

0 comments on commit 02a93ef

Please sign in to comment.