diff options
author | Jed Barber <jjbarber@y7mail.com> | 2016-11-13 18:59:54 +1100 |
---|---|---|
committer | Jed Barber <jjbarber@y7mail.com> | 2016-11-13 18:59:54 +1100 |
commit | 00a92fa838520364cb02e71f6d9372f617aed57a (patch) | |
tree | aaf370f48f95013328398ec0b6f1113925b78bea | |
parent | 6fa5de9c6015c2d93aac1f3e379844fc36ff865f (diff) |
Fixed bug in word count
-rw-r--r-- | c_fl_text_buffer.cpp | 9 | ||||
-rw-r--r-- | c_fl_text_buffer.h | 1 | ||||
-rw-r--r-- | fltk-text_buffers.adb | 19 | ||||
-rw-r--r-- | fltk-text_buffers.ads | 6 |
4 files changed, 33 insertions, 2 deletions
diff --git a/c_fl_text_buffer.cpp b/c_fl_text_buffer.cpp index a28286f..20699e8 100644 --- a/c_fl_text_buffer.cpp +++ b/c_fl_text_buffer.cpp @@ -71,11 +71,16 @@ void fl_text_buffer_select(TEXTBUFFER tb, int s, int e) { int fl_text_buffer_skip_lines(TEXTBUFFER tb, int s, int l) { - reinterpret_cast<Fl_Text_Buffer*>(tb)->skip_lines(s, l); + return reinterpret_cast<Fl_Text_Buffer*>(tb)->skip_lines(s, l); } int fl_text_buffer_rewind_lines(TEXTBUFFER tb, int s, int l) { - reinterpret_cast<Fl_Text_Buffer*>(tb)->rewind_lines(s, l); + return reinterpret_cast<Fl_Text_Buffer*>(tb)->rewind_lines(s, l); +} + + +unsigned int fl_text_buffer_char_at(TEXTBUFFER tb, int p) { + return reinterpret_cast<Fl_Text_Buffer*>(tb)->char_at(p); } diff --git a/c_fl_text_buffer.h b/c_fl_text_buffer.h index ed95a6d..0ee2e5a 100644 --- a/c_fl_text_buffer.h +++ b/c_fl_text_buffer.h @@ -24,6 +24,7 @@ extern "C" int fl_text_buffer_search_forward(TEXTBUFFER tb, int start, const cha extern "C" void fl_text_buffer_select(TEXTBUFFER tb, int s, int e); extern "C" int fl_text_buffer_skip_lines(TEXTBUFFER tb, int s, int l); extern "C" int fl_text_buffer_rewind_lines(TEXTBUFFER tb, int s, int l); +extern "C" unsigned int fl_text_buffer_char_at(TEXTBUFFER tb, int p); #endif diff --git a/fltk-text_buffers.adb b/fltk-text_buffers.adb index ab752ff..5db105d 100644 --- a/fltk-text_buffers.adb +++ b/fltk-text_buffers.adb @@ -96,6 +96,12 @@ package body FLTK.Text_Buffers is return Interfaces.C.int; pragma Import (C, fl_text_buffer_rewind_lines, "fl_text_buffer_rewind_lines"); + function fl_text_buffer_char_at + (TB : in System.Address; + P : in Interfaces.C.int) + return Interfaces.C.unsigned; + pragma Import (C, fl_text_buffer_char_at, "fl_text_buffer_char_at"); + @@ -376,5 +382,18 @@ package body FLTK.Text_Buffers is end Rewind_Lines; + + + function Character_At + (This : in Text_Buffer; + Pos : in Natural) + return Character is + begin + return Character'Val (fl_text_buffer_char_at + (This.Void_Ptr, + Interfaces.C.int (Pos))); + end Character_At; + + end FLTK.Text_Buffers; diff --git a/fltk-text_buffers.ads b/fltk-text_buffers.ads index 5b260d6..171fd84 100644 --- a/fltk-text_buffers.ads +++ b/fltk-text_buffers.ads @@ -105,6 +105,12 @@ package FLTK.Text_Buffers is return Natural; + function Character_At + (This : in Text_Buffer; + Pos : in Natural) + return Character; + + private |