aboutsummaryrefslogtreecommitdiffstats
path: root/text.py
diff options
context:
space:
mode:
authorbloodstalker <thabogre@gmail.com>2018-07-11 11:56:59 +0000
committerbloodstalker <thabogre@gmail.com>2018-07-11 11:56:59 +0000
commit60bc4ced88a10b8b7c903fa41e828cba15e6ee22 (patch)
treeb093df46411b7904fb02bbf66b14b0d5b94799ca /text.py
parentupdate (diff)
downloadfaultreiber-60bc4ced88a10b8b7c903fa41e828cba15e6ee22.tar.gz
faultreiber-60bc4ced88a10b8b7c903fa41e828cba15e6ee22.zip
update
Diffstat (limited to 'text.py')
-rw-r--r--text.py21
1 files changed, 16 insertions, 5 deletions
diff --git a/text.py b/text.py
index 52a84b1..a012cba 100644
--- a/text.py
+++ b/text.py
@@ -1,11 +1,7 @@
# _*_ coding=utf-8 _*_
class text():
- header_list = """#include <fcntl.h>\n
- #include <inttypes.h>\n
- #include <stdio.h>\n
- #include <stdlib.h>\n
- #include <unistd.h>\n"""
+ header_list = """#include <fcntl.h>\n#include <inttypes.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <unistd.h>\n"""
header_inttype = "#include <inttypes.h>\n"
main_sig = 'int main(int argc, char** argv)'
pragma_weak_main = '#pragma weak main'
@@ -15,3 +11,18 @@ class text():
autogen_warning = "// this file has been automatically generated by faultreiber\n"
last_comment = "// last line intentionally left blank\n\n"
read_func_sig = "int read_structured_file(char* path)"
+ c_read_elem_sig = "XXX ft_read_YYY(char* _ft_file_path, int _fd) {\n"
+ c_read_elem_sig_1 = "ft_read_XXX(_ft_file_path, _fd)"
+ c_open_file = "int ft_read_file = open(_ft_file_path, RDONLY);\n"
+ c_function_close = "}\n"
+ c_function_dummy_dec = "XXX dummy;\n"
+ c_function_return_type = "return dummy;\n"
+ c_read_def_1 = "uint8_t XXX;\n"
+ c_read_def_2 = "uint16_t XXX;\n"
+ c_read_def_4 = "uint32_t XXX;\n"
+ c_read_def_8 = "uint64_t XXX;\n"
+ c_read_1 = "read(_fd, &XXX, sizeof(uint8_t));\n"
+ c_read_2 = "read(_fd, &XXX, sizeof(uint16_t));\n"
+ c_read_4 = "read(_fd, &XXX, sizeof(uint32_t));\n"
+ c_read_8 = "read(_fd, &XXX, sizeof(uint64_t));\n"
+ c_assign_struct = "XXX.YYY = ZZZ;\n"