Browse CVS Repository
Contents of /shiki/shiki/xyzzylisp.stub
Parent Directory
| Revision Log
| Revision Graph
Revision 1.2 -
( show annotations)
( download)
Fri Nov 24 19:31:04 2006 UTC
(17 years, 4 months ago)
by aloha
Branch: MAIN
Changes since 1.1: +2 -4 lines
separate file
| 1 |
"#include \"shiki.h\"" |
| 2 |
|
| 3 |
(define-cproc buffer-substring (start::<int> end::<int>) |
| 4 |
" ScmObj start, end, result; |
| 5 |
GtkTextIter s, e; |
| 6 |
gchar *substring; |
| 7 |
if(Scm_NumCmp(start, end) >= 0) |
| 8 |
return SCM_FALSE; |
| 9 |
gtk_text_buffer_get_iter_at_offset(Shiki_CURRENT_TEXT_BUFFER, &s, SCM_INT_VALUE(start)); |
| 10 |
gtk_text_buffer_get_iter_at_offset(Shiki_CURRENT_TEXT_BUFFER, &e, SCM_INT_VALUE(end)); |
| 11 |
|
| 12 |
substring = gtk_text_buffer_get_text(Shiki_CURRENT_TEXT_BUFFER, &s, &e, FALSE); |
| 13 |
result = SCM_MAKE_STR_COPYING(substring); |
| 14 |
g_free(substring); |
| 15 |
SCM_RETURN(result);") |
| |