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/omega-mv/blob/main/om/gpu/dsv41/decoder/io.om # omega-mv Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance. Brought by drakestapleton Sign in to star 1 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-mv / om / gpu / dsv41 / decoder / io.om` 29 lines ยท 663 bytes Raw Blame History 1 note SPDX-License-Identifier: AGPL-3.0-only 2 fn diRead fd int buf edit uchar * pos ulong count ulong to bool 3 used = ulong 0 4 while lt used count 5 n = pread fd buf used sub count used long add pos used 6 if eq n -4 7 continue 8 end 9 if le n 0 10 ret false 11 end 12 used = add used ulong n 13 end 14 ret true 15 end 16 17 fn diPut record edit uchar * off ulong width ulong v ulong to void 18 for i ulong width 19 put record add off i uchar and shr v mul i 8 255 20 end 21 end 22 23 fn diGet record view uchar * off ulong width ulong to ulong 24 value = ulong 0 25 for i ulong width 26 value = or value shl ulong get record add off i mul i 8 27 end 28 ret value 29 end