Enlightenment CVS committal

Author  : codewarrior
Project : e17
Module  : proto

Dir     : e17/proto/etk-perl


Modified Files:
        Etk.xs const-c.inc 


Log Message:
- dont use (shift || foo) (fixes chady's packing problem)
- fix timers now that they have their own structs
- formatting

===================================================================
RCS file: /cvs/e/e17/proto/etk-perl/Etk.xs,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- Etk.xs      10 Jun 2006 17:59:29 -0000      1.10
+++ Etk.xs      11 Jun 2006 00:26:31 -0000      1.11
@@ -200,7 +200,8 @@
    
    cbd = data;   
    PUSHMARK(SP) ;
-   XPUSHs(sv_2mortal(newSVsv(cbd->perl_data)));      
+   if(cbd->perl_data)
+     XPUSHs(sv_2mortal(newSVsv(cbd->perl_data)));      
    PUTBACK ;  
    
    count = call_sv(cbd->perl_callback, G_SCALAR);
@@ -288,9 +289,8 @@
    
    SPAGAIN;
 
-   /* if the return value is incorrect, return 0 to end timer */
    if(count != 1)
-       croak("Improper return value from timer callback!\n");
+       croak("Improper return value from compare callback!\n");
 
    ret = POPi;
 
@@ -3931,11 +3931,20 @@
        etk_window_wmclass_set(ETK_WINDOW(window), window_name, window_class);
         
 Ecore_Timer *
-etkpl_timer_add(interval, callback)
+etkpl_timer_add(interval, callback, data)
         double interval
        SV *    callback
+        SV *    data
       CODE:        
-        RETVAL = ecore_timer_add(interval, callback_timer, newSVsv(callback));
+        Callback_Timer_Data *cbd;
+        
+        cbd = calloc(1, sizeof(Callback_Timer_Data));
+        if(SvOK(data))
+           cbd->perl_data = newSVsv(data);
+        else
+           cbd->perl_data = NULL;
+        cbd->perl_callback = newSVsv(callback);
+        RETVAL = ecore_timer_add(interval, callback_timer, cbd);
       OUTPUT:
         RETVAL
        
===================================================================
RCS file: /cvs/e/e17/proto/etk-perl/const-c.inc,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- const-c.inc 10 Jun 2006 11:04:55 -0000      1.6
+++ const-c.inc 11 Jun 2006 00:26:31 -0000      1.7
@@ -33,7 +33,7 @@
      Regenerate these constant functions by feeding this entire source file to
      perl -x
 
-#!/usr/bin/perl -w
+#!perl -w
 use ExtUtils::Constant qw (constant_types C_constant XS_constant);
 
 my $types = {map {($_, 1)} qw()};




_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to