diff --git a/codegen/codegen.py b/codegen/codegen.py index 159919f..f7d524f 100644 --- a/codegen/codegen.py +++ b/codegen/codegen.py @@ -1,4 +1,5 @@ from pathlib import Path +from .utils import load_func_body_from_file from .datatypes import ( CDataType, CStruct, @@ -307,8 +308,3 @@ def test_doubly_linked_list(): header.save(Path(".")) source.save(Path(".")) - - -def load_func_body_from_file(filename: Path) -> str: - with open(filename, "r") as infile: - return infile.read() diff --git a/codegen/utils.py b/codegen/utils.py new file mode 100644 index 0000000..5247512 --- /dev/null +++ b/codegen/utils.py @@ -0,0 +1,6 @@ +from pathlib import Path + + +def load_func_body_from_file(filename: Path) -> str: + with open(filename, "r") as infile: + return infile.read()