diff options
author | Ralph Amissah <ralph.amissah@gmail.com> | 2024-06-29 14:17:35 -0400 |
---|---|---|
committer | Ralph Amissah <ralph.amissah@gmail.com> | 2024-06-29 15:39:08 -0400 |
commit | 03b6742825eefcdf4ac58b2563f9d17333982392 (patch) | |
tree | 4db704a75ba340023fd0f4b12ae4f0e52e1ece9a /org/in_source_files.org | |
parent | reduction in use of tuples (diff) |
digest tuple rearrange
Diffstat (limited to 'org/in_source_files.org')
-rw-r--r-- | org/in_source_files.org | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/org/in_source_files.org b/org/in_source_files.org index baffefb..8df3ded 100644 --- a/org/in_source_files.org +++ b/org/in_source_files.org @@ -330,18 +330,20 @@ template spineRawMarkupContent() { char[][] src_txt; string[] insert_files; string[] images; - ubyte[32] header_digest; - ubyte[32] src_txt_digest; + } + struct ST_doc_digest { + ubyte[32] markup_doc; + ubyte[32] header; + ubyte[32] text; } struct ST_doc_parts { - char[] header_raw; - char[][] sourcefile_body_content; - string[] insert_file_list; - string[] images_list; - ubyte[32] header_raw_digest; - ubyte[32] src_txt_digest; + char[] header_raw; + char[][] sourcefile_body_content; + string[] insert_file_list; + string[] images_list; + ST_doc_digest doc_digest; } - auto spineRawMarkupContent(O,Fn)(O _opt_action, Fn fn_src) { + ST_doc_parts spineRawMarkupContent(O,Fn)(O _opt_action, Fn fn_src) { ST_doc_parts _0_header_1_body_content_2_insert_filelist_struct = rawsrc.sourceContentSplitIntoHeaderAndBody(_opt_action, rawsrc.sourceContent(fn_src), fn_src); return _0_header_1_body_content_2_insert_filelist_struct; @@ -364,7 +366,6 @@ template spineRawMarkupContent() { ST_header_content_inserts_images st = raw.markupSourceHeaderContentRawLineStructArray(source_txt_str); char[] header_raw = st.header; - ubyte[32] header_raw_digest = st.header.sha256Of; char[][] sourcefile_body_content = st.src_txt; if (fn_src.match(rgx_files.src_fn_master)) { // filename with path needed if master file (.ssm) not otherwise auto ins = Inserts(); @@ -379,16 +380,20 @@ template spineRawMarkupContent() { = ins.scan_master_src_for_insert_files_and_import_content(_opt_action, sourcefile_body_content, fn_src); images_list_get = _cii.images.dup; } // image_list, if path could take sha256 digests already here? - ubyte[32] src_txt_digest = sourcefile_body_content.sha256Of; string header_type = ""; + ST_doc_digest dig; + { + dig.markup_doc = source_txt_str.sha256Of; + dig.header = st.header.sha256Of; + dig.text = sourcefile_body_content.sha256Of; + } ST_doc_parts ret; { ret.header_raw = st.header; ret.sourcefile_body_content = sourcefile_body_content; ret.insert_file_list = insert_file_list_get; ret.images_list = images_list_get; - ret.header_raw_digest = st.header.sha256Of; - ret.src_txt_digest = sourcefile_body_content.sha256Of; + ret.doc_digest = dig; } return ret; } @@ -535,16 +540,12 @@ ST_header_content_inserts_images markupSourceHeaderContentRawLineStructArray(in char[] header = hc[0]; char[] source_txt = hc[1]; char[][] source_line_arr = markupSourceLineArray(source_txt); - ubyte[32] header_digest; - ubyte[32] src_txt_digest; ST_header_content_inserts_images ret; { ret.header = header; ret.src_txt = source_line_arr; ret.insert_files = file_insert_list; ret.images = images_list; - ret.header_digest = header_digest; - ret.src_txt_digest = src_txt_digest; } return ret; } |