Changeset e89ec48 for perlglue.xs
- Timestamp:
- Sep 30, 2011, 8:06:58 AM (13 years ago)
- Branches:
- master, release-1.10, release-1.9
- Children:
- 7803326
- Parents:
- c737503
- git-author:
- Jason Gross <jgross@mit.edu> (07/10/11 17:58:20)
- git-committer:
- Jason Gross <jgross@mit.edu> (09/30/11 08:06:58)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
perlglue.xs
rc737503 re89ec48 167 167 } 168 168 169 void170 start_question(line, callback)171 const char *line172 SV *callback173 PREINIT:174 owl_editwin *e;175 CODE:176 {177 if(!SV_IS_CODEREF(callback))178 croak("Callback must be a subref");179 180 e = owl_function_start_question(line);181 182 owl_editwin_set_cbdata(e,183 newSVsv(callback),184 owl_perlconfig_dec_refcnt);185 owl_editwin_set_callback(e, owl_perlconfig_edit_callback);186 }187 188 void189 start_password(line, callback)190 const char *line191 SV *callback192 PREINIT:193 owl_editwin *e;194 CODE:195 {196 if(!SV_IS_CODEREF(callback))197 croak("Callback must be a subref");198 199 e = owl_function_start_password(line);200 201 owl_editwin_set_cbdata(e,202 newSVsv(callback),203 owl_perlconfig_dec_refcnt);204 owl_editwin_set_callback(e, owl_perlconfig_edit_callback);205 }206 207 void208 start_edit_win(line, callback)209 const char *line210 SV *callback211 PREINIT:212 owl_editwin *e;213 CODE:214 {215 if(!SV_IS_CODEREF(callback))216 croak("Callback must be a subref");217 218 e = owl_function_start_edit_win(line);219 owl_editwin_set_cbdata(e,220 newSVsv(callback),221 owl_perlconfig_dec_refcnt);222 owl_editwin_set_callback(e, &owl_perlconfig_edit_callback);223 }224 225 169 226 170 const char * … … 499 443 ival); 500 444 445 void 446 start_edit(edit_type, line, callback) 447 const char *edit_type 448 const char *line 449 SV *callback 450 PREINIT: 451 owl_editwin *e; 452 CODE: 453 { 454 if (!SV_IS_CODEREF(callback)) 455 croak("Callback must be a subref"); 456 457 if (!strcmp(edit_type, "question")) 458 e = owl_function_start_question(line); 459 else if (!strcmp(edit_type, "password")) 460 e = owl_function_start_password(line); 461 else if (!strcmp(edit_type, "edit_win")) 462 e = owl_function_start_edit_win(line); 463 else 464 croak("edit_type must be one of 'password', 'question', 'edit_win', not '%s'", edit_type); 465 466 owl_editwin_set_cbdata(e, newSVsv(callback), owl_perlconfig_dec_refcnt); 467 owl_editwin_set_callback(e, owl_perlconfig_edit_callback); 468 } 469 501 470 MODULE = BarnOwl PACKAGE = BarnOwl::Editwin 502 471
Note: See TracChangeset
for help on using the changeset viewer.