| 1 |
aloha |
1.1 |
/* Generated by genstub. Do not edit. */ |
| 2 |
|
|
#include <gauche.h> |
| 3 |
|
|
#if defined(__CYGWIN__) || defined(__MINGW32__) |
| 4 |
|
|
#define SCM_CGEN_CONST /*empty*/ |
| 5 |
|
|
#else |
| 6 |
|
|
#define SCM_CGEN_CONST const |
| 7 |
|
|
#endif |
| 8 |
|
|
static ScmObj xyzzylisp_buffer_substring(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_) |
| 9 |
|
|
{ |
| 10 |
|
|
ScmObj start_scm; |
| 11 |
|
|
int start; |
| 12 |
|
|
ScmObj end_scm; |
| 13 |
|
|
int end; |
| 14 |
|
|
SCM_ENTER_SUBR("buffer-substring"); |
| 15 |
|
|
start_scm = SCM_ARGREF(0); |
| 16 |
|
|
if (!SCM_EXACTP(start_scm)) Scm_Error("C integer required, but got %S", start_scm); |
| 17 |
|
|
start = Scm_GetInteger(start_scm); |
| 18 |
|
|
end_scm = SCM_ARGREF(1); |
| 19 |
|
|
if (!SCM_EXACTP(end_scm)) Scm_Error("C integer required, but got %S", end_scm); |
| 20 |
|
|
end = Scm_GetInteger(end_scm); |
| 21 |
|
|
{ |
| 22 |
|
|
ScmObj start, end, result; |
| 23 |
|
|
GtkTextIter s, e; |
| 24 |
|
|
gchar *substring; |
| 25 |
|
|
if(Scm_NumCmp(start, end) >= 0) |
| 26 |
|
|
return SCM_FALSE; |
| 27 |
|
|
gtk_text_buffer_get_iter_at_offset(Shiki_CURRENT_TEXT_BUFFER, &s, SCM_INT_VALUE(start)); |
| 28 |
|
|
gtk_text_buffer_get_iter_at_offset(Shiki_CURRENT_TEXT_BUFFER, &e, SCM_INT_VALUE(end)); |
| 29 |
|
|
|
| 30 |
|
|
substring = gtk_text_buffer_get_text(Shiki_CURRENT_TEXT_BUFFER, &s, &e, FALSE); |
| 31 |
|
|
result = SCM_MAKE_STR_COPYING(substring); |
| 32 |
|
|
g_free(substring); |
| 33 |
|
|
SCM_RETURN(result); |
| 34 |
|
|
} |
| 35 |
|
|
} |
| 36 |
|
|
|
| 37 |
|
|
static SCM_DEFINE_STRING_CONST(xyzzylisp_buffer_substring__NAME, "buffer-substring", 16, 16); |
| 38 |
|
|
static SCM_DEFINE_SUBR(xyzzylisp_buffer_substring__STUB, 2, 0, SCM_OBJ(&xyzzylisp_buffer_substring__NAME), xyzzylisp_buffer_substring, NULL, NULL); |
| 39 |
|
|
|
| 40 |
|
|
static ScmObj xyzzylisp_clear_current_buffer(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_) |
| 41 |
|
|
{ |
| 42 |
|
|
SCM_ENTER_SUBR("clear-current-buffer"); |
| 43 |
|
|
{ |
| 44 |
|
|
clear_current_buffer(); |
| 45 |
|
|
return SCM_NIL; |
| 46 |
|
|
} |
| 47 |
|
|
} |
| 48 |
|
|
|
| 49 |
|
|
static SCM_DEFINE_STRING_CONST(xyzzylisp_clear_current_buffer__NAME, "clear-current-buffer", 20, 20); |
| 50 |
|
|
static SCM_DEFINE_SUBR(xyzzylisp_clear_current_buffer__STUB, 0, 0, SCM_OBJ(&xyzzylisp_clear_current_buffer__NAME), xyzzylisp_clear_current_buffer, NULL, NULL); |
| 51 |
|
|
|
| 52 |
|
|
void Scm_Init_xyzzylisp(ScmModule *module) |
| 53 |
|
|
{ |
| 54 |
|
|
|
| 55 |
|
|
SCM_DEFINE(module, "buffer-substring", SCM_OBJ(&xyzzylisp_buffer_substring__STUB)); |
| 56 |
|
|
SCM_DEFINE(module, "clear-current-buffer", SCM_OBJ(&xyzzylisp_clear_current_buffer__STUB)); |
| 57 |
|
|
} |