💾 Archived View for gmi.noulin.net › gitRepositories › zrle › file › test.c.gmi captured on 2024-08-18 at 18:56:47. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2023-01-29)
-=-=-=-=-=-=-
test.c (716B)
1 #! /usr/bin/env sheepy 2 /* or direct path to sheepy: #! /usr/local/bin/sheepy */ 3 4 #include "libsheepyObject.h" 5 #include "zrle.h" 6 7 int argc; char **argv; 8 9 uint8_t data[] = {0x00, 0x00, 0x00, 0x1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1, 0x00, 0x00, 0x00, 0x00, 0x1, 0xfe, 0xfd, 0xfc, 0}; 10 11 int main(int ARGC, char** ARGV) { 12 13 argc = ARGC; argv = ARGV; 14 15 initLibsheepy(argv[0]); 16 17 puts("C template"); 18 19 logVarG(COUNT_ELEMENTS(data)); 20 loghex(data, COUNT_ELEMENTS(data)); 21 put 22 23 zrlebuft b = zrle(data, COUNT_ELEMENTS(data)); 24 25 if (b.buf) { 26 put 27 logVarG(b.count); 28 loghex(b.buf, b.count); 29 30 put 31 zrlebuft buf = dezrle(b.buf, b.count); 32 loghex(buf.buf, buf.count); 33 34 free(b.buf); 35 } 36 }