Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ocaml-curses for openSUSE:Factory checked in at 2023-03-14 18:16:19 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ocaml-curses (Old) and /work/SRC/openSUSE:Factory/.ocaml-curses.new.31432 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ocaml-curses" Tue Mar 14 18:16:19 2023 rev:9 rq:1071156 version:1.0.11 Changes: -------- --- /work/SRC/openSUSE:Factory/ocaml-curses/ocaml-curses.changes 2022-04-06 21:51:26.679599177 +0200 +++ /work/SRC/openSUSE:Factory/.ocaml-curses.new.31432/ocaml-curses.changes 2023-03-14 18:16:23.623651317 +0100 @@ -1,0 +2,6 @@ +Fri Mar 3 03:03:03 UTC 2023 - [email protected] + +- Update to version 1.0.11 + see included CHANGES.md for details + +------------------------------------------------------------------- Old: ---- ocaml-curses-1.0.10.tar.xz New: ---- ocaml-curses-1.0.11.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ocaml-curses.spec ++++++ --- /var/tmp/diff_new_pack.EpzfuC/_old 2023-03-14 18:16:24.091653819 +0100 +++ /var/tmp/diff_new_pack.EpzfuC/_new 2023-03-14 18:16:24.095653840 +0100 @@ -1,7 +1,7 @@ # # spec file for package ocaml-curses # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: ocaml-curses -Version: 1.0.10 +Version: 1.0.11 Release: 0 %{?ocaml_preserve_bytecode} Summary: OCaml bindings for ncurses @@ -28,8 +28,9 @@ BuildRequires: ncurses-devel BuildRequires: ocaml BuildRequires: ocaml-dune >= 2.7 -BuildRequires: ocaml-rpm-macros >= 20220222 +BuildRequires: ocaml-rpm-macros >= 20230101 BuildRequires: ocamlfind(dune.configurator) +BuildRequires: ocamlfind(unix) BuildRequires: pkg-config %description ++++++ _service ++++++ --- /var/tmp/diff_new_pack.EpzfuC/_old 2023-03-14 18:16:24.139654075 +0100 +++ /var/tmp/diff_new_pack.EpzfuC/_new 2023-03-14 18:16:24.143654097 +0100 @@ -1,7 +1,7 @@ <services> <service name="tar_scm" mode="disabled"> <param name="filename">ocaml-curses</param> - <param name="revision">a23a03d06206d85f53938c196b2a258ed1e4ef2e</param> + <param name="revision">184b60f30e6fb20d443d8912ed916cb9a576ed6c</param> <param name="scm">git</param> <param name="submodules">disable</param> <param name="url">https://github.com/mbacarella/curses.git</param> ++++++ ocaml-curses-1.0.10.tar.xz -> ocaml-curses-1.0.11.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-curses-1.0.10/.github/workflows/workflow.yml new/ocaml-curses-1.0.11/.github/workflows/workflow.yml --- old/ocaml-curses-1.0.10/.github/workflows/workflow.yml 2021-11-20 21:21:03.000000000 +0100 +++ new/ocaml-curses-1.0.11/.github/workflows/workflow.yml 2023-01-19 17:52:06.000000000 +0100 @@ -1,4 +1,4 @@ -name: Main workflow +name: build on Mac/Linux on: pull_request: @@ -15,7 +15,7 @@ os: - macos-latest - ubuntu-latest - - windows-latest + # - windows-latest ocaml-compiler: - 4.12.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-curses-1.0.10/CHANGES new/ocaml-curses-1.0.11/CHANGES --- old/ocaml-curses-1.0.10/CHANGES 2021-11-20 21:21:03.000000000 +0100 +++ new/ocaml-curses-1.0.11/CHANGES 1970-01-01 01:00:00.000000000 +0100 @@ -1,50 +0,0 @@ -<pending release> -===== -* Updated to dune-lang 2.7, so that we don't have that generated .opam file - bug anymore. - -1.0.9 (2021-10-12) -===== -* Convert to dune. Thanks to Olaf Hering <olafhering> for doing most of this! -* Dead code in tmk/ and other junk files removed. - -1.0.8 (2021-09-21) -===== -* Makefile still had VERSION = 1.0.4 the whole time. Fix it with a new release. - -1.0.7 -===== -* <credit bug reporter> - -1.0.6 (2020-02-22) -===== -* Fix segfault bug in delscreen (thanks to Shang Tsung for the report!) - -1.0.5 (2020-01-24) -===== -* Move project to github.com/mbacarella/curses -* Install *.cmx files to LIBDIR so that dune doesn't warn about - projects that build against curses. - -1.0.4 (2018-11-20) -===== -* Update configure script for ncurses 6.1 (Paul Pelzl). -* Use CFLAGS from ./configure. -* Enable debugging for all builds. -* Allow compilation against PDCurses on Windows. - -1.0.3 (2008-11-17) -===== -* get*yx now return coordinates in the right order (thanks Brian Campbell). -* Fix possible segfault with get_ripoff (thanks Brian Campbell). -* Indicate that we should link with the curses library (thanks Jeff Meister). - -1.0.2 (2007-10-09) -===== -* Started to add documentation in curses.mli. -* Using OCamlMakefile for the makefile, now handles bytecode-only compilation. -* Libraries are now named curses.cm(x)a. - -1.0.1 (2007-08-25) -===== -* Initial release. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-curses-1.0.10/CHANGES.md new/ocaml-curses-1.0.11/CHANGES.md --- old/ocaml-curses-1.0.10/CHANGES.md 1970-01-01 01:00:00.000000000 +0100 +++ new/ocaml-curses-1.0.11/CHANGES.md 2023-01-19 17:52:06.000000000 +0100 @@ -0,0 +1,65 @@ +unreleased +===== +* Don't hard-code gcc, use cc instead. Thanks @atupone for PR #7 +* Remove Windows builds from Github workflow, too difficult to diagnose + right now; Mac and Linux remain +* Add missing dependency on Unix #8 (Thanks @dra27) +* Add a test bin +* Fix up for OCaml 5.0.0. Thanks @rrbq for #9 +* Make it possible to vendor this package. Thanks @gridbugs for #10 + +1.0.10 (2021-11-21) +===== +* Updated to dune-lang 2.7, so that we don't have that generated .opam file + bug anymore. +* Fixed build on Arch Linux, issue #4 +* Fixed discover.ml to more durably locate curses.h headers +* Fixed build for Windows +* Added Github Workflow for CI build on Mac/Windows/Linux (uses ocaml-setup) +* Ran ocamlformat + +1.0.9 (2021-10-12) +===== +* Convert to dune. Thanks to Olaf Hering <olafhering> for doing most of this! +* Dead code in tmk/ and other junk files removed. + +1.0.8 (2021-09-21) +===== +* Makefile still had VERSION = 1.0.4 the whole time. Fix it with a new release. + +1.0.7 +===== +* <credit bug reporter> + +1.0.6 (2020-02-22) +===== +* Fix segfault bug in delscreen (thanks to Shang Tsung for the report!) + +1.0.5 (2020-01-24) +===== +* Move project to github.com/mbacarella/curses +* Install *.cmx files to LIBDIR so that dune doesn't warn about + projects that build against curses. + +1.0.4 (2018-11-20) +===== +* Update configure script for ncurses 6.1 (Paul Pelzl). +* Use CFLAGS from ./configure. +* Enable debugging for all builds. +* Allow compilation against PDCurses on Windows. + +1.0.3 (2008-11-17) +===== +* get*yx now return coordinates in the right order (thanks Brian Campbell). +* Fix possible segfault with get_ripoff (thanks Brian Campbell). +* Indicate that we should link with the curses library (thanks Jeff Meister). + +1.0.2 (2007-10-09) +===== +* Started to add documentation in curses.mli. +* Using OCamlMakefile for the makefile, now handles bytecode-only compilation. +* Libraries are now named curses.cm(x)a. + +1.0.1 (2007-08-25) +===== +* Initial release. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-curses-1.0.10/README.md new/ocaml-curses-1.0.11/README.md --- old/ocaml-curses-1.0.10/README.md 2021-11-20 21:21:03.000000000 +0100 +++ new/ocaml-curses-1.0.11/README.md 2023-01-19 17:52:06.000000000 +0100 @@ -1,3 +1,5 @@ + + Bindings to curses/ncurses ==== @@ -44,3 +46,5 @@ This is a fork of the now unmaintained ocaml-twk package at https://www.nongnu.org/ocaml-tmk/ + +See [CHANGES.md](CHANGES.md) for change history. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-curses-1.0.10/curses.opam new/ocaml-curses-1.0.11/curses.opam --- old/ocaml-curses-1.0.10/curses.opam 2021-11-20 21:21:03.000000000 +0100 +++ new/ocaml-curses-1.0.11/curses.opam 2023-01-19 17:52:06.000000000 +0100 @@ -4,12 +4,13 @@ description: "Tools for building terminal-based user interfaces" maintainer: ["Michael Bacarella <[email protected]>"] authors: ["Nicolas George"] -license: "LGPL-2.1-or-later WITH OCaml-linking-exception" +license: "LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception" homepage: "https://github.com/mbacarella/curses" bug-reports: "https://github.com/mbacarella/curses/issues" depends: [ "dune" {>= "2.7"} "conf-ncurses" + "conf-pkg-config" "dune-configurator" "ocaml" {>= "4.02.0"} "odoc" {with-doc} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-curses-1.0.10/dune new/ocaml-curses-1.0.11/dune --- old/ocaml-curses-1.0.10/dune 2021-11-20 21:21:03.000000000 +0100 +++ new/ocaml-curses-1.0.11/dune 2023-01-19 17:52:06.000000000 +0100 @@ -9,6 +9,7 @@ (names ml_curses) (flags (:include c_flags.sexp))) + (libraries unix) (c_library_flags (:include c_library_flags.sexp))) @@ -42,10 +43,10 @@ (deps _curses.ml _config.ml _functions.c _keys.ml config.h) (action (chdir - %{workspace_root} + %{project_root} (with-stdout-to %{target} - (system "%{bin:gcc} -x c -E _curses.ml"))))) + (system "%{cc} -x c -E _curses.ml"))))) (rule (targets c_flags.sexp c_library_flags.sexp config.ml _config.h) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-curses-1.0.10/dune-project new/ocaml-curses-1.0.11/dune-project --- old/ocaml-curses-1.0.10/dune-project 2021-11-20 21:21:03.000000000 +0100 +++ new/ocaml-curses-1.0.11/dune-project 2023-01-19 17:52:06.000000000 +0100 @@ -4,7 +4,7 @@ (generate_opam_files true) -(license "LGPL-2.1-or-later WITH OCaml-linking-exception") +(license "LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception") (authors "Nicolas George") @@ -21,6 +21,7 @@ (description "Tools for building terminal-based user interfaces") (depends conf-ncurses + conf-pkg-config dune-configurator (ocaml (>= 4.02.0)))) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-curses-1.0.10/functions.c new/ocaml-curses-1.0.11/functions.c --- old/ocaml-curses-1.0.10/functions.c 2021-11-20 21:21:03.000000000 +0100 +++ new/ocaml-curses-1.0.11/functions.c 2023-01-19 17:52:06.000000000 +0100 @@ -11,7 +11,7 @@ #define copie(l,id,ar) int i,c=l,r; \ chtype *t=malloc((c+1)*sizeof(chtype)); \ - if(t==NULL) failwith("Out of memory"); \ + if(t==NULL) caml_failwith("Out of memory"); \ for(i=0;i<c;i++) t[i]=Int_val(Field(ar,i+id)); \ t[i]=0; #define call(f) r=f; free(t); r_err(r); @@ -192,14 +192,14 @@ /* getstr */ ML1d(getstr,err,string) -BEG1 r_err(getnstr(a_string(aa),string_length(aa))); END +BEG1 r_err(getnstr(a_string(aa),caml_string_length(aa))); END ML2d(wgetstr,err,window,string) -BEG2 r_err(wgetnstr(a_window(aa),a_string(ab),string_length(ab))); END +BEG2 r_err(wgetnstr(a_window(aa),a_string(ab),caml_string_length(ab))); END ML3d(mvgetstr,err,int,int,string) -BEG3 r_err(mvgetnstr(a_int(aa),a_int(ab),a_string(ac),string_length(ac))); END +BEG3 r_err(mvgetnstr(a_int(aa),a_int(ab),a_string(ac),caml_string_length(ac))); END ML4d(mvwgetstr,err,window,int,int,string) BEG4 r_err(mvwgetnstr(a_window(aa),a_int(ab),a_int(ac),a_string(ad), - string_length(ad))); END + caml_string_length(ad))); END ML3d(getnstr,err,string,int,int) BEG3 r_err(getnstr(a_string(aa)+a_int(ab),a_int(ac))); END ML4d(wgetnstr,err,window,string,int,int) @@ -293,18 +293,18 @@ FILE *fa=fdopen(fda,"w"),*fb=fdopen(fdb,"r"); SCREEN *s; AWB(r); - r=alloc_tuple(3); - Store_field(r,0,Val_long(fa)); - Store_field(r,1,Val_long(fb)); + r=caml_alloc_tuple(3); + Store_field(r,0,caml_copy_nativeint((intnat) fa)); + Store_field(r,1,caml_copy_nativeint((intnat) fb)); s=newterm(a_string(aa),fa,fb); - if(s==NULL){ fclose(fa); fclose(fb); failwith("newterm"); } - Store_field(r,2,(value)s); + if(s==NULL){ fclose(fa); fclose(fb); caml_failwith("newterm"); } + Store_field(r,2,Val_screen(s)); CAMLreturn(r); END ML1(set_term,unit,screen) ML1d(delscreen,unit,screen) BEG1 delscreen(a_screen(aa)); - fclose((FILE * )Long_val(Field(aa,0))); - fclose((FILE * )Long_val(Field(aa,1))); + fclose((FILE * )Nativeint_val(Field(aa,0))); + fclose((FILE * )Nativeint_val(Field(aa,1))); CAMLreturn(Val_unit); END ML0d(stdscr,window) BEG0 r_window(stdscr); END @@ -313,14 +313,14 @@ /* insstr */ ML1d(insstr,err,string) -BEG1 r_err(insnstr(a_string(aa),string_length(aa))); END +BEG1 r_err(insnstr(a_string(aa),caml_string_length(aa))); END ML2d(winsstr,err,window,string) -BEG2 r_err(winsnstr(a_window(aa),a_string(ab),string_length(ab))); END +BEG2 r_err(winsnstr(a_window(aa),a_string(ab),caml_string_length(ab))); END ML3d(mvinsstr,err,int,int,string) -BEG3 r_err(mvinsnstr(a_int(aa),a_int(ab),a_string(ac),string_length(ac))); END +BEG3 r_err(mvinsnstr(a_int(aa),a_int(ab),a_string(ac),caml_string_length(ac))); END ML4d(mvwinsstr,err,window,int,int,string) BEG4 r_err(mvwinsnstr(a_window(aa),a_int(ab),a_int(ac), - a_string(ad),string_length(ad))); END + a_string(ad),caml_string_length(ad))); END ML3d(insnstr,err,string,int,int) BEG3 r_err(insnstr(a_string(aa)+a_int(ab),a_int(ac))); END ML4d(winsnstr,err,window,string,int,int) @@ -334,14 +334,14 @@ /* instr */ ML1d(instr,err,string) -BEG1 r_err(innstr(a_string(aa),string_length(aa))); END +BEG1 r_err(innstr(a_string(aa),caml_string_length(aa))); END ML2d(winstr,err,window,string) -BEG2 r_err(winnstr(a_window(aa),a_string(ab),string_length(ab))); END +BEG2 r_err(winnstr(a_window(aa),a_string(ab),caml_string_length(ab))); END ML3d(mvinstr,err,int,int,string) -BEG3 r_err(mvinnstr(a_int(aa),a_int(ab),a_string(ac),string_length(ac))); END +BEG3 r_err(mvinnstr(a_int(aa),a_int(ab),a_string(ac),caml_string_length(ac))); END ML4d(mvwinstr,err,window,int,int,string) BEG4 r_err(mvwinnstr(a_window(aa),a_int(ab),a_int(ac), - a_string(ad),string_length(ad))); END + a_string(ad),caml_string_length(ad))); END ML3d(innstr,err,string,int,int) BEG3 r_err(innstr(a_string(aa)+a_int(ab),a_int(ac))); END ML4d(winnstr,err,window,string,int,int) @@ -392,7 +392,7 @@ ML1d(ripoffline,unit,bool) BEG1 ripoffline(Bool_val(aa)?1:-1,ripoff_callback); CAMLreturn(Val_unit); END ML0d(get_ripoff,window*int) -BEG0 if(ripoff_niv==0) failwith("get_ripoff"); ripoff_niv--; +BEG0 if(ripoff_niv==0) caml_failwith("get_ripoff"); ripoff_niv--; r_window_int(ripoff_w[ripoff_niv],ripoff_l[ripoff_niv]); END /* mouse */ @@ -528,8 +528,8 @@ ML1(tigetnum,int,string) ML1d(tigetstr,string,string) BEG1 char *s=tigetstr(a_string(aa)); - if((s==NULL)||(s==(char * )-1)) failwith("tigetstr"); - CAMLreturn(copy_string(s)); END + if((s==NULL)||(s==(char * )-1)) caml_failwith("tigetstr"); + CAMLreturn(caml_copy_string(s)); END ML3d(tputs,err,string,int,(char->unit)) BEG3 putc_function=ac; r_err(tputs(a_string(aa),a_int(ab),putc_callback)); END @@ -556,20 +556,20 @@ #define arrayret(nt) \ CAMLlocal1(s); \ int n=a_int(aa); AWB(s) \ - s=alloc_tuple(3); \ + s=caml_alloc_tuple(3); \ Store_field(s,0,Val_unit); \ Store_field(s,1,Val_unit); \ Store_field(s,2,Val_unit); \ if((nt##names[n]==NULL)||(nt##codes[n]==NULL)||(nt##fnames[n]==NULL)){ \ CAMLlocal1(ns); AWB(ns) \ - ns=copy_string(""); \ + ns=caml_copy_string(""); \ Store_field(s,0,ns); \ Store_field(s,1,ns); \ Store_field(s,2,ns); \ }else{ \ - Store_field(s,0,copy_string(nt##names[n])); \ - Store_field(s,1,copy_string(nt##codes[n])); \ - Store_field(s,2,copy_string(nt##fnames[n])); \ + Store_field(s,0,caml_copy_string(nt##names[n])); \ + Store_field(s,1,caml_copy_string(nt##codes[n])); \ + Store_field(s,2,caml_copy_string(nt##fnames[n])); \ } \ CAMLreturn(s); #ifndef PDCURSES @@ -625,7 +625,7 @@ #define ca(i,n) Store_field(tr,i,Val_int(ACS_##n)); ML0d(get_acs_codes,Acs.acs) BEG0 CAMLlocal1(tr); AWB(tr) - tr=alloc_tuple(32); + tr=caml_alloc_tuple(32); ca( 0,ULCORNER) ca( 1,LLCORNER) ca( 2,URCORNER) ca( 3,LRCORNER) ca( 4,LTEE) ca( 5,RTEE) ca( 6,BTEE) ca( 7,TTEE) ca( 8,HLINE) ca( 9,VLINE) ca(10,PLUS) ca(11,S1) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-curses-1.0.10/ml_curses.c new/ocaml-curses-1.0.11/ml_curses.c --- old/ocaml-curses-1.0.10/ml_curses.c 2021-11-20 21:21:03.000000000 +0100 +++ new/ocaml-curses-1.0.11/ml_curses.c 2023-01-19 17:52:06.000000000 +0100 @@ -45,9 +45,30 @@ #define AWB(x) caml__dummy_##x=caml__dummy_##x; /* anti-warning bugware */ +static value Val_window(WINDOW *w) +{ + return caml_copy_nativeint((intnat) w); +} + +static value Val_terminal(TERMINAL *t) +{ + return caml_copy_nativeint((intnat) t); +} + +static value Val_screen(SCREEN *s) +{ + return caml_copy_nativeint((intnat) s); +} + +#define Window_val(v) ((WINDOW *) Nativeint_val(v)) + +#define Terminal_val(v) ((TERMINAL *) Nativeint_val(v)) + +#define Screen_val(v) ((SCREEN *) Nativeint_val(v)) + #define r_unit(f) f; CAMLreturn(Val_unit); -#define r_window(f) CAMLreturn((value)f) -#define r_terminal(f) CAMLreturn((value)f) +#define r_window(f) CAMLreturn(Val_window(f)) +#define r_terminal(f) CAMLreturn(Val_terminal(f)) #define r_err(f) CAMLreturn(Val_bool((f)!=ERR)) #define r_int(f) CAMLreturn(Val_int(f)) #define r_char(f) CAMLreturn(Val_int((f)&255)) @@ -56,36 +77,36 @@ #define r_bool(f) CAMLreturn(Val_bool(f)) #define r_int_int(x,y) \ { CAMLlocal1(ret); AWB(ret); \ - ret=alloc_tuple(2); \ + ret=caml_alloc_tuple(2); \ Store_field(ret,0,Val_int(x)); \ Store_field(ret,1,Val_int(y)); \ CAMLreturn(ret); } #define r_window_int(x,y) \ { CAMLlocal1(ret); AWB(ret); \ - ret=alloc_tuple(2); \ - Store_field(ret,0,(value)(x)); \ + ret=caml_alloc_tuple(2); \ + Store_field(ret,0,Val_window(x)); \ Store_field(ret,1,Val_int(y)); \ CAMLreturn(ret); } #define r_int_int_int(x,y,z) \ { CAMLlocal1(ret); AWB(ret); \ - ret=alloc_tuple(3); \ + ret=caml_alloc_tuple(3); \ Store_field(ret,0,Val_int(x)); \ Store_field(ret,1,Val_int(y)); \ Store_field(ret,2,Val_int(z)); \ CAMLreturn(ret); } #define r_string(f) \ { const char *ret=f; \ - if(ret==NULL) failwith("Null pointer"); \ - CAMLreturn(copy_string(ret)); } + if(ret==NULL) caml_failwith("Null pointer"); \ + CAMLreturn(caml_copy_string(ret)); } -#define a_window(a) ((WINDOW * )a) -#define a_terminal(a) ((TERMINAL * )a) -#define a_screen(a) ((SCREEN * )Field(a,2)) +#define a_window(a) Window_val(a) +#define a_terminal(a) Terminal_val(a) +#define a_screen(a) Screen_val(Field(a,2)) #define a_int(a) Int_val(a) #define a_bool(a) Bool_val(a) #define a_chtype(a) Int_val(a) #define a_attr_t(a) Int_val(a) -#define a_string(a) String_val(a) +#define a_string(a) Bytes_val(a) #define RA0 CAMLparam0(); #define RA1 CAMLparam1(aa); AWB(aa); @@ -200,7 +221,7 @@ CAMLlocal1(ret); AWB(ret); - ret=callback_exn(putc_function,Val_int(c&255)); + ret=caml_callback_exn(putc_function,Val_int(c&255)); CAMLreturn(Is_exception_result(ret)?-1:0); } @@ -223,9 +244,9 @@ CAMLparam0(); int ch; - enter_blocking_section(); + caml_enter_blocking_section(); ch = getch(); - leave_blocking_section(); + caml_leave_blocking_section(); CAMLreturn(Val_int(ch)); } @@ -238,11 +259,11 @@ WINDOW* w; caml__dummy_win = caml__dummy_win; - w = (WINDOW *) win; + w = Window_val(win); - enter_blocking_section(); + caml_enter_blocking_section(); ch = wgetch(w); - leave_blocking_section(); + caml_leave_blocking_section(); CAMLreturn(Val_int(ch)); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-curses-1.0.10/test/dune new/ocaml-curses-1.0.11/test/dune --- old/ocaml-curses-1.0.10/test/dune 1970-01-01 01:00:00.000000000 +0100 +++ new/ocaml-curses-1.0.11/test/dune 2023-01-19 17:52:06.000000000 +0100 @@ -0,0 +1,3 @@ +(executable + (name test) + (libraries curses)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-curses-1.0.10/test/test.ml new/ocaml-curses-1.0.11/test/test.ml --- old/ocaml-curses-1.0.10/test/test.ml 1970-01-01 01:00:00.000000000 +0100 +++ new/ocaml-curses-1.0.11/test/test.ml 2023-01-19 17:52:06.000000000 +0100 @@ -0,0 +1,43 @@ +type t = + { wfoo : Curses.window; + wbar : Curses.window; + wbazzes : Curses.window; + wsnoos : Curses.window + } + +let init title = + (* init *) + let _window = Curses.initscr () in + assert (Curses.start_color ()); + (* set title *) + Curses.attron Curses.A.bold; + assert (Curses.addstr title); + Curses.attroff Curses.A.bold; + assert (Curses.refresh ()); + (* create windows *) + let wfoo = Curses.newwin 1 80 1 0 in + let wbar = Curses.newwin 3 80 2 0 in + let wbazzes = Curses.newwin 3 80 5 0 in + let wsnoos = Curses.newwin 10 80 8 0 in + let demo_window win str = + Curses.box win 0 0; + assert (Curses.waddstr win str); + assert (Curses.wrefresh win) + in + demo_window wfoo "foos"; + demo_window wbar "bars"; + demo_window wbazzes "bazzes"; + demo_window wsnoos "snoos"; + let wsnoos_left = Curses.derwin wsnoos 6 38 2 2 in + let wsnoos_right = Curses.derwin wsnoos 6 30 2 44 in + demo_window wsnoos_left "left side\nfoobar\n"; + assert (Curses.waddstr wsnoos_left "third\n"); + assert (Curses.wrefresh wsnoos_left); + demo_window wsnoos_right "right side"; + { wfoo; wbar; wbazzes; wsnoos } + +let () = + let _t = init "the title" in + ignore (Curses.getch () : int); + Curses.endwin (); + ()
