Develop and Download Open Source Software

Browse CVS Repository

Annotation of /shiki/shiki/xyzzylisp.c

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.5 - (hide annotations) (download) (as text)
Sun Nov 26 00:41:57 2006 UTC (17 years, 4 months ago) by aloha
Branch: MAIN
Changes since 1.4: +17 -0 lines
File MIME type: text/x-csrc
add (selected-buffer) xyzzy lisp API

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 aloha 1.2 #include "shiki.h"
9 aloha 1.5 static ScmObj xyzzylisp_selected_buffer(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
10     {
11     SCM_ENTER_SUBR("selected-buffer");
12     {
13     {
14     GtkTextBuffer* SCM_RESULT;
15     g_object_ref(Shiki_CURRENT_TEXT_BUFFER);
16     SCM_RESULT = Shiki_CURRENT_TEXT_BUFFER;
17     SCM_RETURN(SHIKI_BUFFER_BOX(SCM_RESULT));
18     }
19     }
20     }
21    
22     static SCM_DEFINE_STRING_CONST(xyzzylisp_selected_buffer__NAME, "selected-buffer", 15, 15);
23     static SCM_DEFINE_SUBR(xyzzylisp_selected_buffer__STUB, 0, 0, SCM_OBJ(&xyzzylisp_selected_buffer__NAME), xyzzylisp_selected_buffer, NULL, NULL);
24    
25 aloha 1.1 static ScmObj xyzzylisp_buffer_substring(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
26     {
27     ScmObj start_scm;
28     int start;
29     ScmObj end_scm;
30     int end;
31     SCM_ENTER_SUBR("buffer-substring");
32     start_scm = SCM_ARGREF(0);
33     if (!SCM_EXACTP(start_scm)) Scm_Error("C integer required, but got %S", start_scm);
34     start = Scm_GetInteger(start_scm);
35     end_scm = SCM_ARGREF(1);
36     if (!SCM_EXACTP(end_scm)) Scm_Error("C integer required, but got %S", end_scm);
37     end = Scm_GetInteger(end_scm);
38     {
39 aloha 1.3 {
40     ScmString* SCM_RESULT;
41     gchar *substr = Shiki_buffer_substring(start, end);
42     if(substr)
43     SCM_RESULT = SCM_STRING(SCM_MAKE_STR_COPYING(substr));
44     else
45     SCM_RESULT = SCM_STRING(SCM_FALSE);
46     g_free(substr);
47     SCM_RETURN(SCM_MAKE_MAYBE(SCM_OBJ_SAFE, SCM_RESULT));
48     }
49 aloha 1.1 }
50     }
51    
52     static SCM_DEFINE_STRING_CONST(xyzzylisp_buffer_substring__NAME, "buffer-substring", 16, 16);
53     static SCM_DEFINE_SUBR(xyzzylisp_buffer_substring__STUB, 2, 0, SCM_OBJ(&xyzzylisp_buffer_substring__NAME), xyzzylisp_buffer_substring, NULL, NULL);
54    
55 aloha 1.4 static ScmObj xyzzylisp_delete_region(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
56     {
57     ScmObj start_scm;
58     int start;
59     ScmObj end_scm;
60     int end;
61     SCM_ENTER_SUBR("delete-region");
62     start_scm = SCM_ARGREF(0);
63     if (!SCM_EXACTP(start_scm)) Scm_Error("C integer required, but got %S", start_scm);
64     start = Scm_GetInteger(start_scm);
65     end_scm = SCM_ARGREF(1);
66     if (!SCM_EXACTP(end_scm)) Scm_Error("C integer required, but got %S", end_scm);
67     end = Scm_GetInteger(end_scm);
68     {
69     Shiki_delete_region(start, end);
70     SCM_RETURN(SCM_UNDEFINED);
71     }
72     }
73    
74     static SCM_DEFINE_STRING_CONST(xyzzylisp_delete_region__NAME, "delete-region", 13, 13);
75     static SCM_DEFINE_SUBR(xyzzylisp_delete_region__STUB, 2, 0, SCM_OBJ(&xyzzylisp_delete_region__NAME), xyzzylisp_delete_region, NULL, NULL);
76    
77     static ScmObj xyzzylisp_insert(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
78     {
79     ScmObj char_or_string_scm;
80     ScmObj char_or_string;
81     SCM_ENTER_SUBR("insert");
82     char_or_string_scm = SCM_ARGREF(0);
83     char_or_string = (char_or_string_scm);
84     {
85     if(SCM_CHARP(char_or_string)) {
86     gunichar u = SCM_CHAR_VALUE(char_or_string);
87     gchar *str = g_ucs4_to_utf8(&u, 1, NULL, NULL, NULL);
88     gtk_text_buffer_insert_at_cursor(Shiki_CURRENT_TEXT_BUFFER, str, -1);
89     g_free(str);
90     } else if(SCM_STRINGP(char_or_string))
91     gtk_text_buffer_insert_at_cursor(Shiki_CURRENT_TEXT_BUFFER, SCM_STRING_CONST_CSTRING(char_or_string), -1);
92     SCM_RETURN(SCM_UNDEFINED);
93     }
94     }
95    
96     static SCM_DEFINE_STRING_CONST(xyzzylisp_insert__NAME, "insert", 6, 6);
97     static SCM_DEFINE_SUBR(xyzzylisp_insert__STUB, 1, 0, SCM_OBJ(&xyzzylisp_insert__NAME), xyzzylisp_insert, NULL, NULL);
98    
99     static ScmObj xyzzylisp_point(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
100     {
101     SCM_ENTER_SUBR("point");
102     {
103     {
104     int SCM_RESULT;
105     SCM_RESULT = Shiki_point();
106     SCM_RETURN(Scm_MakeInteger(SCM_RESULT));
107     }
108     }
109     }
110    
111     static SCM_DEFINE_STRING_CONST(xyzzylisp_point__NAME, "point", 5, 5);
112     static SCM_DEFINE_SUBR(xyzzylisp_point__STUB, 0, 0, SCM_OBJ(&xyzzylisp_point__NAME), xyzzylisp_point, NULL, NULL);
113    
114     static ScmObj xyzzylisp_point_max(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
115     {
116     SCM_ENTER_SUBR("point-max");
117     {
118     {
119     int SCM_RESULT;
120     SCM_RESULT = Shiki_point_max();
121     SCM_RETURN(Scm_MakeInteger(SCM_RESULT));
122     }
123     }
124     }
125    
126     static SCM_DEFINE_STRING_CONST(xyzzylisp_point_max__NAME, "point-max", 9, 9);
127     static SCM_DEFINE_SUBR(xyzzylisp_point_max__STUB, 0, 0, SCM_OBJ(&xyzzylisp_point_max__NAME), xyzzylisp_point_max, NULL, NULL);
128    
129     static ScmObj xyzzylisp_point_min(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
130     {
131     SCM_ENTER_SUBR("point-min");
132     {
133     {
134     int SCM_RESULT;
135     SCM_RESULT = Shiki_point_min();
136     SCM_RETURN(Scm_MakeInteger(SCM_RESULT));
137     }
138     }
139     }
140    
141     static SCM_DEFINE_STRING_CONST(xyzzylisp_point_min__NAME, "point-min", 9, 9);
142     static SCM_DEFINE_SUBR(xyzzylisp_point_min__STUB, 0, 0, SCM_OBJ(&xyzzylisp_point_min__NAME), xyzzylisp_point_min, NULL, NULL);
143    
144     static ScmObj xyzzylisp_goto_char(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
145     {
146     ScmObj offset_scm;
147     int offset;
148     SCM_ENTER_SUBR("goto-char");
149     offset_scm = SCM_ARGREF(0);
150     if (!SCM_EXACTP(offset_scm)) Scm_Error("C integer required, but got %S", offset_scm);
151     offset = Scm_GetInteger(offset_scm);
152     {
153     Shiki_goto_char(offset);
154     SCM_RETURN(SCM_UNDEFINED);
155     }
156     }
157    
158     static SCM_DEFINE_STRING_CONST(xyzzylisp_goto_char__NAME, "goto-char", 9, 9);
159     static SCM_DEFINE_SUBR(xyzzylisp_goto_char__STUB, 1, 0, SCM_OBJ(&xyzzylisp_goto_char__NAME), xyzzylisp_goto_char, NULL, NULL);
160    
161     static ScmObj xyzzylisp_forward_char(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
162     {
163     SCM_ENTER_SUBR("forward-char");
164     {
165     Shiki_forward_char();
166     SCM_RETURN(SCM_UNDEFINED);
167     }
168     }
169    
170     static SCM_DEFINE_STRING_CONST(xyzzylisp_forward_char__NAME, "forward-char", 12, 12);
171     static SCM_DEFINE_SUBR(xyzzylisp_forward_char__STUB, 0, 0, SCM_OBJ(&xyzzylisp_forward_char__NAME), xyzzylisp_forward_char, NULL, NULL);
172    
173     static ScmObj xyzzylisp_backward_char(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
174     {
175     SCM_ENTER_SUBR("backward-char");
176     {
177     Shiki_backward_char();
178     SCM_RETURN(SCM_UNDEFINED);
179     }
180     }
181    
182     static SCM_DEFINE_STRING_CONST(xyzzylisp_backward_char__NAME, "backward-char", 13, 13);
183     static SCM_DEFINE_SUBR(xyzzylisp_backward_char__STUB, 0, 0, SCM_OBJ(&xyzzylisp_backward_char__NAME), xyzzylisp_backward_char, NULL, NULL);
184    
185     static ScmObj xyzzylisp_goto_line(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
186     {
187     ScmObj line_scm;
188     int line;
189     SCM_ENTER_SUBR("goto-line");
190     line_scm = SCM_ARGREF(0);
191     if (!SCM_EXACTP(line_scm)) Scm_Error("C integer required, but got %S", line_scm);
192     line = Scm_GetInteger(line_scm);
193     {
194     Shiki_goto_line(line);
195     SCM_RETURN(SCM_UNDEFINED);
196     }
197     }
198    
199     static SCM_DEFINE_STRING_CONST(xyzzylisp_goto_line__NAME, "goto-line", 9, 9);
200     static SCM_DEFINE_SUBR(xyzzylisp_goto_line__STUB, 1, 0, SCM_OBJ(&xyzzylisp_goto_line__NAME), xyzzylisp_goto_line, NULL, NULL);
201    
202     static ScmObj xyzzylisp_goto_bol(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
203     {
204     SCM_ENTER_SUBR("goto-bol");
205     {
206     Shiki_goto_bol();
207     SCM_RETURN(SCM_UNDEFINED);
208     }
209     }
210    
211     static SCM_DEFINE_STRING_CONST(xyzzylisp_goto_bol__NAME, "goto-bol", 8, 8);
212     static SCM_DEFINE_SUBR(xyzzylisp_goto_bol__STUB, 0, 0, SCM_OBJ(&xyzzylisp_goto_bol__NAME), xyzzylisp_goto_bol, NULL, NULL);
213    
214     static ScmObj xyzzylisp_goto_eol(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
215     {
216     SCM_ENTER_SUBR("goto-eol");
217     {
218     Shiki_goto_eol();
219     SCM_RETURN(SCM_UNDEFINED);
220     }
221     }
222    
223     static SCM_DEFINE_STRING_CONST(xyzzylisp_goto_eol__NAME, "goto-eol", 8, 8);
224     static SCM_DEFINE_SUBR(xyzzylisp_goto_eol__STUB, 0, 0, SCM_OBJ(&xyzzylisp_goto_eol__NAME), xyzzylisp_goto_eol, NULL, NULL);
225    
226 aloha 1.1 void Scm_Init_xyzzylisp(ScmModule *module)
227     {
228    
229 aloha 1.5 SCM_DEFINE(module, "selected-buffer", SCM_OBJ(&xyzzylisp_selected_buffer__STUB));
230 aloha 1.1 SCM_DEFINE(module, "buffer-substring", SCM_OBJ(&xyzzylisp_buffer_substring__STUB));
231 aloha 1.4 SCM_DEFINE(module, "delete-region", SCM_OBJ(&xyzzylisp_delete_region__STUB));
232     SCM_DEFINE(module, "insert", SCM_OBJ(&xyzzylisp_insert__STUB));
233     SCM_DEFINE(module, "point", SCM_OBJ(&xyzzylisp_point__STUB));
234     SCM_DEFINE(module, "point-max", SCM_OBJ(&xyzzylisp_point_max__STUB));
235     SCM_DEFINE(module, "point-min", SCM_OBJ(&xyzzylisp_point_min__STUB));
236     SCM_DEFINE(module, "goto-char", SCM_OBJ(&xyzzylisp_goto_char__STUB));
237     SCM_DEFINE(module, "forward-char", SCM_OBJ(&xyzzylisp_forward_char__STUB));
238     SCM_DEFINE(module, "backward-char", SCM_OBJ(&xyzzylisp_backward_char__STUB));
239     SCM_DEFINE(module, "goto-line", SCM_OBJ(&xyzzylisp_goto_line__STUB));
240     SCM_DEFINE(module, "goto-bol", SCM_OBJ(&xyzzylisp_goto_bol__STUB));
241     SCM_DEFINE(module, "goto-eol", SCM_OBJ(&xyzzylisp_goto_eol__STUB));
242 aloha 1.1 }

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26