-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
codegen: add testdata with a minimalistic working setup
- Loading branch information
Showing
15 changed files
with
255 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
all: | ||
mkdir -p output | ||
cd output; \ | ||
go run ../.. --verbose --package mypkg --include header.h --preset ..//preset.json -lng -lg -d ../deffinitions.json -e ../structs_and_enums.json -t ../typedefs_dict.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"FuncName": { | ||
"ov_cimguiname": "Foo", | ||
"original_func_name": "OrgFoo", | ||
"args": "(A a)", | ||
"argsT": [ | ||
{ | ||
"name": "a", | ||
"type": "A", | ||
"custom_type": "" | ||
} | ||
], | ||
"defaults": { | ||
"a": "1" | ||
}, | ||
"nonUDT": 0, | ||
"comment": "function comment (optional)", | ||
"location": 15 | ||
} | ||
} | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Code generated by cmd/codegen from https://github.com/AllenDang/cimgui-go. | ||
// DO NOT EDIT. | ||
|
||
|
||
#include <string.h> | ||
#include "wrapper.h" | ||
#include "structs_accessor.h" | ||
|
||
void wrap_B_SetField1(B *BPtr, int v) { BPtr->Field1 = v; } | ||
int wrap_B_GetField1(B *self) { return self->Field1; } | ||
void wrap_B_SetField2(B *BPtr, A v) { BPtr->Field2 = v; } | ||
A wrap_B_GetField2(B *self) { return self->Field2; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Code generated by cmd/codegen from https://github.com/AllenDang/cimgui-go. | ||
// DO NOT EDIT. | ||
|
||
#pragma once | ||
|
||
#include "wrapper.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
extern void wrap_B_SetField1(B *BPtr, int v); | ||
extern int wrap_B_GetField1(B *self); | ||
extern void wrap_B_SetField2(B *BPtr, A v); | ||
extern A wrap_B_GetField2(B *self); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Code generated by cmd/codegen from https://github.com/AllenDang/cimgui-go. | ||
// DO NOT EDIT. | ||
|
||
|
||
#include "typedefs.h" | ||
#include "header.h" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Code generated by cmd/codegen from https://github.com/AllenDang/cimgui-go. | ||
// DO NOT EDIT. | ||
|
||
|
||
#pragma once | ||
|
||
#include "header.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Code generated by cmd/codegen from https://github.com/AllenDang/cimgui-go. | ||
// DO NOT EDIT. | ||
|
||
#include "wrapper.h" | ||
#include "header.h" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Code generated by cmd/codegen from https://github.com/AllenDang/cimgui-go. | ||
// DO NOT EDIT. | ||
|
||
#pragma once | ||
|
||
#include "header.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
|
||
#ifdef __cplusplus | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"PackagePath": "example.com/mypkg", | ||
"TypedefsPoolSize": 32, | ||
"DefaultArgReplace": { | ||
"nullptr": "0", | ||
"NULL": "0", | ||
"((void*)0)": "0" | ||
}, | ||
"DefaultArgArbitraryValue": { | ||
"text_end": "0", | ||
"text_end_": "0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"structs":{ | ||
"B":[ | ||
{ | ||
"name": "Field1", | ||
"type": "int" | ||
}, | ||
{ | ||
"name": "Field2", | ||
"type": "A" | ||
} | ||
] | ||
}, | ||
"struct_comments": { | ||
"B": { | ||
"above": "// this is an example struct" | ||
} | ||
}, | ||
"enums": { | ||
"A_": [ | ||
{ | ||
"calc_value": 0, | ||
"comment": "// A default value of A", | ||
"name": "A_Default", | ||
"value": "0" | ||
}, | ||
{ | ||
"calc_value": 1, | ||
"name": "A_One", | ||
"value": "1 << 0" | ||
} | ||
] | ||
}, | ||
"enum_comments": { | ||
"A_": { | ||
"above": "// this is an example enum" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"A": "int", | ||
"B": "struct B" | ||
} |