Cosmetics
This commit is contained in:
parent
e388042c4d
commit
85d15ff3a0
50
help.ml
50
help.ml
|
@ -1,28 +1,3 @@
|
||||||
open Utils;;
|
|
||||||
|
|
||||||
external fz_version : unit -> string = "ml_fz_version";;
|
|
||||||
external llpp_version : unit -> string = "ml_llpp_version";;
|
|
||||||
|
|
||||||
let gotourl launcher url =
|
|
||||||
let command = Str.global_replace percentsre url launcher in
|
|
||||||
try ignore @@ spawn command []
|
|
||||||
with exn -> dolog "failed to execute `%s': %s" command @@ exntos exn
|
|
||||||
;;
|
|
||||||
|
|
||||||
let gotouri launcher uri =
|
|
||||||
if emptystr launcher
|
|
||||||
then dolog "%s" uri
|
|
||||||
else
|
|
||||||
if nonemptystr @@ geturl uri
|
|
||||||
then gotourl launcher uri
|
|
||||||
else dolog "obtained empty url from uri %S" uri
|
|
||||||
;;
|
|
||||||
|
|
||||||
let version () =
|
|
||||||
Printf.sprintf "llpp version %s, fitz %s, ocaml %s/%d bit"
|
|
||||||
(llpp_version ()) (fz_version ()) Sys.ocaml_version Sys.word_size
|
|
||||||
;;
|
|
||||||
|
|
||||||
let keys =
|
let keys =
|
||||||
{|-----Quitting-----
|
{|-----Quitting-----
|
||||||
escape/q - quit
|
escape/q - quit
|
||||||
|
@ -200,6 +175,31 @@ selection command otherwise
|
||||||
o Text selection is limited to a single page
|
o Text selection is limited to a single page
|
||||||
o Text searching is very naive|};;
|
o Text searching is very naive|};;
|
||||||
|
|
||||||
|
open Utils;;
|
||||||
|
|
||||||
|
external fz_version : unit -> string = "ml_fz_version";;
|
||||||
|
external llpp_version : unit -> string = "ml_llpp_version";;
|
||||||
|
|
||||||
|
let gotourl launcher url =
|
||||||
|
let command = Str.global_replace percentsre url launcher in
|
||||||
|
try ignore @@ spawn command []
|
||||||
|
with exn -> dolog "failed to execute `%s': %s" command @@ exntos exn
|
||||||
|
;;
|
||||||
|
|
||||||
|
let gotouri launcher uri =
|
||||||
|
if emptystr launcher
|
||||||
|
then dolog "%s" uri
|
||||||
|
else
|
||||||
|
if nonemptystr @@ geturl uri
|
||||||
|
then gotourl launcher uri
|
||||||
|
else dolog "obtained empty url from uri %S" uri
|
||||||
|
;;
|
||||||
|
|
||||||
|
let version () =
|
||||||
|
Printf.sprintf "llpp version %s, fitz %s, ocaml %s/%d bit"
|
||||||
|
(llpp_version ()) (fz_version ()) Sys.ocaml_version Sys.word_size
|
||||||
|
;;
|
||||||
|
|
||||||
let makehelp launcher =
|
let makehelp launcher =
|
||||||
let strings =
|
let strings =
|
||||||
fz_version ()
|
fz_version ()
|
||||||
|
|
6
link.c
6
link.c
|
@ -4113,6 +4113,12 @@ CAMLprim value ml_fz_version (void)
|
||||||
return caml_copy_string (FZ_VERSION);
|
return caml_copy_string (FZ_VERSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CAMLprim value ml_llpp_version (void)
|
||||||
|
{
|
||||||
|
extern char llpp_version[];
|
||||||
|
return caml_copy_string (llpp_version);
|
||||||
|
}
|
||||||
|
|
||||||
CAMLprim void ml_init (value csock_v, value params_v)
|
CAMLprim void ml_init (value csock_v, value params_v)
|
||||||
{
|
{
|
||||||
CAMLparam2 (csock_v, params_v);
|
CAMLparam2 (csock_v, params_v);
|
||||||
|
|
11
version.c
11
version.c
|
@ -1,11 +1,2 @@
|
||||||
#define CAML_NAME_SPACE
|
|
||||||
#include <caml/alloc.h>
|
|
||||||
#include <caml/memory.h>
|
|
||||||
|
|
||||||
#define stringify(x) #x
|
#define stringify(x) #x
|
||||||
#define ver stringify (LLPP_VERSION)
|
const char llpp_version[] = stringify (LLPP_VERSION);
|
||||||
|
|
||||||
CAMLprim value ml_llpp_version (void)
|
|
||||||
{
|
|
||||||
return caml_copy_string (ver);
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue