💾 Archived View for gmi.noulin.net › gitRepositories › ervy › file › example.c.gmi captured on 2023-07-10 at 15:52:47. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2023-01-29)
-=-=-=-=-=-=-
example.c (1843B)
1 #! /usr/bin/env sheepy 2 /* or direct path to sheepy: #! /usr/local/bin/sheepy */ 3 4 /* Libsheepy documentation: http://spartatek.se/libsheepy/ */ 5 #include "libsheepyObject.h" 6 #include "ervy.h" 7 8 int argc; char **argv; 9 10 /* enable/disable logging */ 11 /* #undef pLog */ 12 /* #define pLog(...) */ 13 14 int main(int ARGC, char** ARGV) { 15 16 argc = ARGC; argv = ARGV; 17 18 initLibsheepy(ARGV[0]); 19 20 21 // Bar 22 char *barData = "[\ 23 { key: 'A', value: 5.3, style: '*' },\ 24 { key: 'B', value: 3.1, style: '+' },\ 25 { key: 'C', value: 11 },\ 26 { key: 'D', value: 1, style: '"BGRED " "RST"' },\ 27 { key: 'E', value: 5, style: '"BGGRN " "RST"' },\ 28 { key: 'F', value: 7, style: '"BGBLU " "RST"', padding: 1 }\ 29 ]"; 30 /* char *barData = "[\ */ 31 /* { key: 'Aqweqwe ', value: 5, style: '*' },\ */ 32 /* { key: 'Bxcvxcvcvv ', value: 3, style: '+' },\ */ 33 /* { key: 'C', value: 11 },\ */ 34 /* { key: 'D', value: 1, style: '"BGRED " "RST"' },\ */ 35 /* { key: 'E', value: 5, style: '"BGGRN " "RST"' },\ */ 36 /* { key: 'F', value: 7, style: '"BGBLU " "RST"', padding: 1 }\ */ 37 /* ]"; */ 38 39 40 puts(bar(barData, NULL)); 41 put 42 43 44 /* char *opts = "{barWidth: 12, left: 0, height: 30, padding: 5, style: '~'}"; */ 45 /* */ 46 /* puts(bar(barData, opts)); */ 47 48 // Bullet 49 char *bulletData = "[\ 50 { key: 'Month', value: 5, barWidth: 2 },\ 51 { key: 'Week', value: 3, style: '"RED"+"RST"', barWidth: 2 },\ 52 { key: 'Day', value: 20, style: '"BGBLU " "RST"'},\ 53 { key: 'Now', value: 15, style: '"BGCYN " "RST"'}\ 54 ]"; 55 56 puts(bullet(bulletData, NULL)); 57 58 // Ribbon 59 char *ribbonData = "[\ 60 { key: 'A', value: 5, style: '"BGWHT " "RST"' },\ 61 { key: 'B', value: 10, style: '"BGYLW " "RST"' },\ 62 { key: 'C', value: 10, style: '"BGMGT " "RST"' },\ 63 { key: 'D', value: 10, style: '"BGRED " "RST"' }\ 64 ]"; 65 66 puts(ribbon(ribbonData, NULL)); 67 } 68 // vim: set expandtab ts=2 sw=2: