12 void jambase_unpack (void) {
13 if (jambase
== NULL
) {
16 int linecount
= 1, linenum
= 0;
17 if (lzUncompress((void *)jambasepk
, &txt
, &len
) != 0) {
18 fprintf(stderr
, "FATAL: decompression error!\n");
21 //fprintf(stderr, "len=%u\n", len);
22 //fprintf(stderr, "%s\n", txt);
23 for (size_t f
= 0; f
< len
; ++f
) if (txt
[f
] == '\n') ++linecount
;
24 //fprintf(stderr, "lc=%d\n", linecount);
25 jambase
= (char **)calloc(linecount
, sizeof(char *));
28 char *e
= txt
+len
, ec
;
30 for (size_t f
= pos
; f
< len
; ++f
) {
31 if (txt
[f
] == '\n') { e
= txt
+f
+1; epos
= f
+1; break; }
35 //fprintf(stderr, "%d: %s", linenum, txt+pos);
36 jambase
[linenum
++] = strdup(txt
+pos
);
41 //fprintf(stderr, "lc=%d; ln=%d\n", linecount, linenum);
42 //fprintf(stderr, "::%s", jambase[0]);