/[weechat]/weechat/src/plugins/scripts/perl/weechat-perl.c
ViewVC logotype

Diff of /weechat/src/plugins/scripts/perl/weechat-perl.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.15 by kolter, Mon Nov 28 19:32:48 2005 UTC revision 1.16 by kolter, Mon Nov 28 20:08:50 2005 UTC
# Line 36  t_weechat_plugin *perl_plugin; Line 36  t_weechat_plugin *perl_plugin;
36    
37  t_plugin_script *perl_scripts = NULL;  t_plugin_script *perl_scripts = NULL;
38  t_plugin_script *perl_current_script = NULL;  t_plugin_script *perl_current_script = NULL;
39    char *perl_current_script_filename = NULL;
40    
41  extern void boot_DynaLoader (pTHX_ CV* cv);  extern void boot_DynaLoader (pTHX_ CV* cv);
42    
# Line 225  static XS (XS_weechat_register) Line 226  static XS (XS_weechat_register)
226      /* register script */      /* register script */
227      perl_current_script = weechat_script_add (perl_plugin,      perl_current_script = weechat_script_add (perl_plugin,
228                                                &perl_scripts,                                                &perl_scripts,
229                                                "",                                                (perl_current_script_filename) ?
230                                                  perl_current_script_filename : "",
231                                                name, version, shutdown_func,                                                name, version, shutdown_func,
232                                                description);                                                description);
233      if (perl_current_script)      if (perl_current_script)
# Line 859  weechat_perl_load (t_weechat_plugin *plu Line 861  weechat_perl_load (t_weechat_plugin *plu
861          return 0;          return 0;
862      }      }
863    
864        perl_current_script_filename = strdup (filename);
865    
866      PERL_SET_CONTEXT (perl_current_interpreter);      PERL_SET_CONTEXT (perl_current_interpreter);
867      perl_construct (perl_current_interpreter);      perl_construct (perl_current_interpreter);
868      tempscript.interpreter = (PerlInterpreter *) perl_current_interpreter;      tempscript.interpreter = (PerlInterpreter *) perl_current_interpreter;
# Line 866  weechat_perl_load (t_weechat_plugin *plu Line 870  weechat_perl_load (t_weechat_plugin *plu
870            
871      eval_pv (weechat_perl_code, TRUE);      eval_pv (weechat_perl_code, TRUE);
872      eval = weechat_perl_exec (plugin, &tempscript, "weechat_perl_load_eval_file", filename, "");      eval = weechat_perl_exec (plugin, &tempscript, "weechat_perl_load_eval_file", filename, "");
873    
874        free (perl_current_script_filename);
875    
876  #endif  #endif
877            
878      if ( eval != 0)      if ( eval != 0)
# Line 900  weechat_perl_load (t_weechat_plugin *plu Line 907  weechat_perl_load (t_weechat_plugin *plu
907  #endif  #endif
908          if (perl_current_script != NULL)          if (perl_current_script != NULL)
909              weechat_script_remove (plugin, &perl_scripts, perl_current_script);              weechat_script_remove (plugin, &perl_scripts, perl_current_script);
910    
911          return 0;          return 0;
912      }      }
913        
914      if (perl_current_script == NULL) {      if (perl_current_script == NULL) {
915          plugin->printf_server (plugin,          plugin->printf_server (plugin,
916                                 "Perl error: function \"register\" not found "                                 "Perl error: function \"register\" not found "

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26