summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authoromniscient <17525998+omnisci3nce@users.noreply.github.com>2024-07-20 19:47:25 +1000
committeromniscient <17525998+omnisci3nce@users.noreply.github.com>2024-07-20 19:47:25 +1000
commit58a748dcd77d0caacc9d6ef7a7e7e073ac849ad3 (patch)
tree054108cf40ad4e9c147db4e8723485e72d9a7b98 /scripts
parent0a984656f5fec68c90acc612b01f897918c0070b (diff)
resize viewport and fix skybox
Diffstat (limited to 'scripts')
-rw-r--r--scripts/amalgamation/gen_amalgamation.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/scripts/amalgamation/gen_amalgamation.py b/scripts/amalgamation/gen_amalgamation.py
new file mode 100644
index 0000000..45a1c21
--- /dev/null
+++ b/scripts/amalgamation/gen_amalgamation.py
@@ -0,0 +1,24 @@
+# Generates a single amalgamation C header file that includes all public types and functions.
+#
+# This makes including and linking Celeritas very easy.
+import re
+import sys
+
+def find_pub_functions(filepath):
+ pattern = r'PUB\s+(\w+\s+)*(\w+)\s+(\w+)\s*\((.*?)\)'
+
+ with open(filepath, 'r') as file:
+ content = file.read()
+
+ matches = re.finditer(pattern, content, re.MULTILINE)
+
+ for match in matches:
+ print(match.group(0))
+
+if __name__ == "__main__":
+ if len(sys.argv) != 2:
+ print("Usage: python script.py <path_to_c_file>")
+ sys.exit(1)
+
+ file_path = sys.argv[1]
+ find_pub_functions(file_path)