[PD-cvs] externals/loaders import.c,1.2,1.3

Hans-Christoph Steiner eighthave at users.sourceforge.net
Tue Nov 21 05:04:08 CET 2006


Update of /cvsroot/pure-data/externals/loaders
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6829

Modified Files:
	import.c 
Log Message:
made it compile on both 0.39.2-extended and 0.40;  the 0.40 code isn't functional yet

Index: import.c
===================================================================
RCS file: /cvsroot/pure-data/externals/loaders/import.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** import.c	28 Apr 2006 15:50:17 -0000	1.2
--- import.c	21 Nov 2006 04:04:06 -0000	1.3
***************
*** 16,23 ****
  typedef struct _import
  {
!     t_object    x_obj;
!     t_atom*     loaded_libs;
!     t_atom*     current;
!     t_int       num_libs;
  } t_import;
  
--- 16,25 ----
  typedef struct _import
  {
!     t_object            x_obj;
!     t_atom*             loaded_libs;
!     t_atom*             current;
!     t_int               num_libs;
! 	t_outlet            *x_data_outlet;
! 	t_outlet            *x_status_outlet;
  } t_import;
  
***************
*** 25,29 ****
--- 27,43 ----
  static int import_load_lib(char *libname)
  {
+ 	post("import_load_lib");
+ /* sys_load_lib_dir is only used on Pd-extended < 0.40 */
+ #if (PD_MINOR_VERSION >= 40)
+ 	t_canvas *canvas = canvas_getcurrent();
+ 
+     if (!sys_load_lib(canvas, libname))
+ 	{
+ 		post("%s: can't load library in %s", libname, sys_libdir->s_name);
+ 		return 0;
+ 	}
+ #else
      if (!sys_load_lib(sys_libdir->s_name, libname))
+ 	{
          if (!sys_load_lib_dir(sys_libdir->s_name, libname)) 
          {
***************
*** 31,35 ****
--- 45,51 ----
              return 0;
          }
+ 	}
      return 1;
+ #endif
  }
  
***************
*** 81,84 ****
--- 97,102 ----
  {
      t_import *x = (t_import *)pd_new(import_class);
+ 	char buffer[MAXPDSTRING];
+ 
      x->loaded_libs = 0;
      x->num_libs = 0;
***************
*** 96,100 ****
      x->num_libs = 0;
    }
! 
  }
  
--- 114,122 ----
      x->num_libs = 0;
    }
!   /* TODO: look into freeing the namelist.  It probably does not need to
!    * happen, since this class is just copying the pointer of an existing
!    * namelist that is handled elsewhere. */
! 	x->x_data_outlet = outlet_new(&x->x_obj, &s_symbol);
! 	x->x_status_outlet = outlet_new(&x->x_obj, 0);
  }
  





More information about the Pd-cvs mailing list