(WIP) help

This commit is contained in:
malc 2018-05-20 05:53:45 +03:00
parent 699b082d84
commit e388042c4d
4 changed files with 22 additions and 4 deletions

View file

@ -65,9 +65,10 @@ cflags() {
cutils.o)
f="-g -std=c99 -O2 $muinc -Wall -Werror -pedantic-errors"
f="$f -D_GNU_SOURCE" echo $f;;
version.o) echo '-DLLPP_VERSION="'$ver'"';;
link.o)
f="-g -std=c99 -O2 $muinc -Wall -Werror -pedantic-errors"
f="$f -D_GNU_SOURCE -DLLPP_VERSION=\"$ver\""
f="$f -D_GNU_SOURCE"
$darwin && echo "$f -D__COCOA__" || echo $f;;
*/keysym2ucs.o) echo "-O2 -include inttypes.h -DKeySym=uint32_t";;
*/ml_*.o) echo "-g -Wno-pointer-sign -O2";;
@ -174,6 +175,7 @@ bocaml() (
bocaml1 $n "$s" "$o"
case $wocmi in
wsi) s="$srcd/$wsi/wsi.ml";;
help) s="$srcd/help.ml";;
*/glMisc) s="$srcd/lablGL/glMisc.ml";;
*/glTex) s="$srcd/lablGL/glTex.ml";;
*) false;;
@ -254,9 +256,10 @@ done
bocaml main.cmo 0
cobjs="$outd/link.o $outd/cutils.o"
cobjs="$outd/link.o $outd/cutils.o $outd/version.o"
bocamlc link.o
bocamlc cutils.o
bocamlc version.o
libs="str.cma unix.cma"
clibs="-L$mudir/build/native -lmupdf -lmupdf-third -lpthread"

View file

@ -1,7 +1,7 @@
open Utils;;
external fz_version : unit -> string = "ml_fz_version";;
let version = "moo";;
external llpp_version : unit -> string = "ml_llpp_version";;
let gotourl launcher url =
let command = Str.global_replace percentsre url launcher in
@ -20,7 +20,7 @@ let gotouri launcher uri =
let version () =
Printf.sprintf "llpp version %s, fitz %s, ocaml %s/%d bit"
version (fz_version ()) Sys.ocaml_version Sys.word_size
(llpp_version ()) (fz_version ()) Sys.ocaml_version Sys.word_size
;;
let keys =

4
help.mli Normal file
View file

@ -0,0 +1,4 @@
val gotouri : string -> string -> unit;;
val gotourl : string -> string -> unit;;
val makehelp : string -> (string * int * Config.action) list;;
val version : unit -> string;;

11
version.c Normal file
View file

@ -0,0 +1,11 @@
#define CAML_NAME_SPACE
#include <caml/alloc.h>
#include <caml/memory.h>
#define stringify(x) #x
#define ver stringify (LLPP_VERSION)
CAMLprim value ml_llpp_version (void)
{
return caml_copy_string (ver);
}