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/interplane-forge/blob/main/salvage/tests/store.om # interplane-forge INTERPLANE Forge 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 `interplane-forge / salvage / tests / store.om` 86 lines ยท 1846 bytes Raw Blame History 1 note Standalone: om2 + sha2.om + 00core.om + this test. Fresh absolute store passed as argv[1]. 2 global gtcnt ulong 1 3 text ttactor "did:key:test-builder" 4 text tttitle "A broken idea worth keeping" 5 text ttcode "om2\nfn main to int\nret 0\nend\n" 6 text ttabc "abc" 7 text ttsha "`ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad`" 8 text ttpass "SALVAGE_STORE PASS\n" 9 fn styes yes bool to void 10 put gtcnt 0 add get gtcnt 0 1 11 if not yes 12 exit int get gtcnt 0 13 end 14 end 15 fn main to int 16 p = new uchar 512 0 17 id = new uchar 64 0 18 h = new uchar 64 0 19 buf = new uchar 32768 0 20 n = argread 1 p 0 512 21 styes gt n 0 22 styes slroot view part p 0 ulong n 23 styes slinit 24 styes eq get glidxn 0 0 25 slhash ttabc h 26 styes sleq h ttsha 27 styes slhex h 28 put h 0 71 29 styes not slhex h 30 slbegin 1 31 styes slput 0 ttactor 32 styes slput 1 tttitle 33 styes slput 2 tlempty 34 styes slput 3 tlempty 35 styes slput 4 tlempty 36 styes slput 5 ttcode 37 for i ulong 6 38 styes slput add i 6 tlempty 39 end 40 styes slparse get glrl 0 41 styes slsave 42 styes eq get glidxn 0 1 43 for i ulong 64 44 put id i get glrid i 45 end 46 styes slsave 47 styes eq get glidxn 0 1 48 styes slload id 49 styes slfeq 5 ttcode 50 styes eq slgetstate id 0 51 styes slsetstate id 1 52 styes eq slgetstate id 1 53 styes slsetstate id 2 54 styes eq slgetstate id 2 55 styes slinit 56 styes eq get glidxn 0 1 57 styes slload id 58 put glrec 9 1 59 styes not slparse get glrl 0 60 put glrec 9 0 61 styes not slparse sub get glrl 0 1 62 styes slparse get glrl 0 63 slpath tlobjs id 64 pn = slpget p 65 fd = fopen p 0 pn 557057 0 66 styes ge fd 0 67 put buf 0 88 68 r = write int fd buf 0 1 69 x = fclose int fd 70 styes eq r 1 71 styes not slload id 72 slpath tlstate id 73 pn = slpget p 74 fd = fopen p 0 pn 557057 0 75 styes ge fd 0 76 r = write int fd buf 0 1 77 x = fclose int fd 78 styes eq r 1 79 styes eq slgetstate id 9 80 slpath tlempty tlkey 81 r = unlink glpath 0 get glpathn 0 82 styes eq r 0 83 styes not slinit 84 r = write 1 ttpass 0 len ttpass 85 ret 0 86 end