Changeset 9186c75


Ignore:
Timestamp:
Mar 29, 2010, 11:11:32 PM (11 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, release-1.6, release-1.7, release-1.8, release-1.9
Children:
0fe69d2
Parents:
98d296d
git-author:
Nelson Elhage <nelhage@ksplice.com> (03/19/10 17:21:32)
git-committer:
Nelson Elhage <nelhage@mit.edu> (03/29/10 23:11:32)
Message:
Make functions that start an editwin return it, too.
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • commands.c

    rb4a95fc r9186c75  
    25592559  /* if we get two arguments, ask for the password */
    25602560  if (argc==2) {
    2561     owl_function_start_password("AIM Password: ");
    2562     owl_editwin_set_cbdata(owl_global_get_typwin(&g),
    2563                            owl_strdup(argv[1]), owl_free);
    2564     owl_editwin_set_callback(owl_global_get_typwin(&g),
    2565                              owl_callback_aimlogin);
     2561    owl_editwin *e = owl_function_start_password("AIM Password: ");
     2562    owl_editwin_set_cbdata(e, owl_strdup(argv[1]), owl_free);
     2563    owl_editwin_set_callback(e, owl_callback_aimlogin);
    25662564    return(NULL);
    25672565  } else {
  • functions.c

    r58d47ca r9186c75  
    19271927}
    19281928
    1929 void owl_function_start_question(const char *line)
     1929owl_editwin *owl_function_start_question(const char *line)
    19301930{
    19311931  owl_editwin *tw;
     
    19391939
    19401940  owl_global_push_context(&g, OWL_CTX_EDITRESPONSE, tw, "editresponse");
    1941 }
    1942 
    1943 void owl_function_start_password(const char *line)
     1941  return tw;
     1942}
     1943
     1944owl_editwin *owl_function_start_password(const char *line)
    19441945{
    19451946  owl_editwin *tw;
     
    19551956
    19561957  owl_global_push_context(&g, OWL_CTX_EDITRESPONSE, tw, "editresponse");
     1958  return tw;
    19571959}
    19581960
  • perlglue.xs

    r38cc669 r9186c75  
    172172        SV *callback
    173173        PREINIT:
     174                owl_editwin *e;
    174175        CODE:
    175176        {
     
    177178                        croak("Callback must be a subref");
    178179
    179                 owl_function_start_question(line);
    180 
    181                 owl_editwin_set_cbdata(owl_global_get_typwin(&g),
     180                e = owl_function_start_question(line);
     181
     182                owl_editwin_set_cbdata(e,
    182183                                       newSVsv(callback),
    183184                                       owl_perlconfig_dec_refcnt);
    184                 owl_editwin_set_callback(owl_global_get_typwin(&g), owl_perlconfig_edit_callback);
     185                owl_editwin_set_callback(e, owl_perlconfig_edit_callback);
    185186        }
    186187
     
    190191        SV *callback
    191192        PREINIT:
     193                owl_editwin *e;
    192194        CODE:
    193195        {
     
    195197                        croak("Callback must be a subref");
    196198
    197                 owl_function_start_password(line);
    198 
    199                 owl_editwin_set_cbdata(owl_global_get_typwin(&g),
     199                e = owl_function_start_password(line);
     200
     201                owl_editwin_set_cbdata(e,
    200202                                       newSVsv(callback),
    201203                                       owl_perlconfig_dec_refcnt);
    202                 owl_editwin_set_callback(owl_global_get_typwin(&g), owl_perlconfig_edit_callback);
     204                owl_editwin_set_callback(e, owl_perlconfig_edit_callback);
    203205        }
    204206
Note: See TracChangeset for help on using the changeset viewer.