md

cat markdown files with syntax highlighting
git clone https://noulin.net/git/md.git
Log | Files | Refs | README | LICENSE

genEntities.c (619B)


      1 #! /usr/bin/env sheepy
      2 #include "libsheepyObject.h"
      3 
      4 int main(int ARGC, char** ARGV) {
      5 
      6   initLibsheepy(ARGV[0]);
      7   setLogMode(LOG_DATE);
      8 
      9   cleanAllocateSmallJson(e);
     10   readFileG(e, "entities.json");
     11 
     12   cleanAllocateSmallJson(r);
     13 
     14   iter(e, C) {
     15     cast(smallDictt*,c,C);
     16     cleanFinishSmallArrayP(p) = getG(c, rtSmallArrayt, "codepoints");
     17     rune uni          = getG(p, rtU32, 0);
     18     char utf8Code[10] = init0Var;
     19     pError0(bRune2CodeUTF8(utf8Code, uni));
     20     logD("%s: %s %d", iterKeyG(e), utf8Code, uni);
     21     setG(r, iterKeyG(e), utf8Code);
     22   }
     23 
     24   writeFileG(r, "e.json");
     25 }
     26 // vim: set expandtab ts=2 sw=2: