Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/cortex/blob/main/tests/fts/tdump.om # cortex aien-dev/cortex Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `cortex / tests / fts / tdump.om` 62 lines ยท 1264 bytes Raw Blame History 1 note ===== tests/fts/tdump.om : reader for the oracle's FTSDUMP1 file (test only) ===== 2 note string field = u32 length (0xFFFFFFFF = SQL NULL, read as empty) + bytes 3 global tsb uchar `1048576` 4 global tsbn ulong 1 5 note read one string field into qnm (len qnml) 6 fn t_rdnm fd int to void 7 n = t_slen fd 8 put qnml 0 n 9 p = get tibp 0 10 for i ulong n 11 put qnm i get tib add p i 12 end 13 put tibp 0 add p n 14 end 15 note read one string field into qct (len qctl), in pieces so it may exceed the read buffer 16 fn t_rdct fd int to void 17 n = t_slen fd 18 put qctl 0 n 19 o = ulong 0 20 while lt o n bound 999999 21 z = t_need fd 1 22 p = get tibp 0 23 k = sub get tibn 0 p 24 if gt k sub n o 25 k = sub n o 26 end 27 for i ulong k 28 put qct add o i get tib add p i 29 end 30 put tibp 0 add p k 31 o = add o k 32 end 33 end 34 note read one string field into tsb (len tsbn); returns false for NULL 35 fn t_rdsb fd int to bool 36 z = t_need fd 4 37 if eq t_u32 `4294967295` 38 put tsbn 0 0 39 ret false 40 end 41 put tibp 0 sub get tibp 0 4 42 n = t_slen fd 43 put tsbn 0 n 44 p = get tibp 0 45 for i ulong n 46 put tsb i get tib add p i 47 end 48 put tibp 0 add p n 49 ret true 50 end 51 note length of the next string field, with its bytes buffered when they fit in tib 52 fn t_slen fd int to ulong 53 z = t_need fd 4 54 n = t_u32 55 if eq n `4294967295` 56 ret 0 57 end 58 if le n `8388608` 59 z = t_need fd n 60 end 61 ret n 62 end