revShowMyHistory.c (673B)
1 #! /usr/bin/env sheepy 2 #include "libsheepyObject.h" 3 #define H "~//myhistory.txt" 4 #define HE "~//myhistoryExit.txt" 5 #define HP "~//myhistoryPath.txt" 6 #define HB "~//myhistory.bin" 7 8 int main(int ARGC, char** ARGV) { 9 initLibsheepy(ARGV[0]); 10 11 cleanCharP(hbp) = expandHomeG(HB); 12 13 u8 *buf = null; 14 size_t hlen = readFile(hbp, (void**)&buf); 15 16 17 u8 *e = buf + hlen; 18 cleanAllocateSmallJson(a); 19 20 do { 21 u32 len = *(u32*)(e - 4); 22 cleanAllocateSmallBytes(b); 23 o(b,set, e - len + 4, len-8); 24 deserialG(a, b); 25 // a = [path,exit code, date, command] 26 puts(getG(a, rtChar, 3)); 27 e -= len; 28 29 } while(e > buf); 30 31 ret 0; 32 } 33 // vim: set expandtab ts=2 sw=2: