[PD-cvs] SF.net SVN: pure-data: [10040] branches/pd-extended/v0-40/pd/src/import.c
eighthave at users.sourceforge.net
eighthave at users.sourceforge.net
Thu Jun 19 01:01:51 CEST 2008
Revision: 10040
http://pure-data.svn.sourceforge.net/pure-data/?rev=10040&view=rev
Author: eighthave
Date: 2008-06-18 16:01:51 -0700 (Wed, 18 Jun 2008)
Log Message:
-----------
reindented code and converted tabs to spaces
Modified Paths:
--------------
branches/pd-extended/v0-40/pd/src/import.c
Modified: branches/pd-extended/v0-40/pd/src/import.c
===================================================================
--- branches/pd-extended/v0-40/pd/src/import.c 2008-06-18 23:01:04 UTC (rev 10039)
+++ branches/pd-extended/v0-40/pd/src/import.c 2008-06-18 23:01:51 UTC (rev 10040)
@@ -45,18 +45,18 @@
typedef struct _import
{
- t_object x_obj;
- t_canvas *x_canvas;
- t_namelist *x_current;
- char x_classpath_root[FILENAME_MAX];
- t_outlet *x_data_outlet;
- t_outlet *x_status_outlet;
+ t_object x_obj;
+ t_canvas *x_canvas;
+ t_namelist *x_current;
+ char x_classpath_root[FILENAME_MAX];
+ t_outlet *x_data_outlet;
+ t_outlet *x_status_outlet;
} t_import;
static int load_library(t_import *x, char *library_name)
{
- DEBUG(post("load_library"););
+ DEBUG(post("load_library"););
if (!sys_load_lib(x->x_canvas, library_name))
return 0;
else
@@ -72,14 +72,14 @@
switch (argv->a_type) {
case A_FLOAT:
pd_error(x, "[import] ERROR: floats not supported: '%f'",
- atom_getfloat(argv));
+ atom_getfloat(argv));
break;
case A_SYMBOL:
library_name = atom_getsymbol(argv);
if (!load_library(x,library_name->s_name))
- pd_error(x, "[import]: ERROR: can't load library in '%s'",
- library_name->s_name);
- else
+ pd_error(x, "[import]: ERROR: can't load library in '%s'",
+ library_name->s_name);
+ else
{
loaded_libs = namelist_append(loaded_libs, library_name->s_name, 0);
post("[import] loaded library: '%s'", library_name->s_name);
@@ -95,57 +95,57 @@
static void import_output(t_import* x)
{
- DEBUG(post("import_output"););
- char buffer[MAXPDSTRING];
+ DEBUG(post("import_output"););
+ char buffer[MAXPDSTRING];
/* TODO: think about using x->x_current->nl_next so that if [import] is at
* the end of its list, and another element gets added to the local
* namespace, [import] will output the new element on the next bang. */
- if(x->x_current)
- {
- strncpy(buffer, x->x_current->nl_string, MAXPDSTRING);
+ if(x->x_current)
+ {
+ strncpy(buffer, x->x_current->nl_string, MAXPDSTRING);
outlet_symbol( x->x_data_outlet, gensym(buffer));
- x->x_current = x->x_current->nl_next;
- }
- else
- outlet_bang(x->x_status_outlet);
+ x->x_current = x->x_current->nl_next;
+ }
+ else
+ outlet_bang(x->x_status_outlet);
}
static void import_reset(t_import* x)
{
- x->x_current = loaded_libs;
+ x->x_current = loaded_libs;
}
static void *import_new(t_symbol *s, int argc, t_atom *argv)
{
t_import *x = (t_import *)pd_new(import_class);
- t_symbol *currentdir;
+ t_symbol *currentdir;
- x->x_data_outlet = outlet_new(&x->x_obj, &s_symbol);
- x->x_status_outlet = outlet_new(&x->x_obj, 0);
+ x->x_data_outlet = outlet_new(&x->x_obj, &s_symbol);
+ x->x_status_outlet = outlet_new(&x->x_obj, 0);
- x->x_canvas = canvas_getcurrent();
- load_arguments(x,argc,argv);
- import_reset(x);
+ x->x_canvas = canvas_getcurrent();
+ load_arguments(x,argc,argv);
+ import_reset(x);
- if(import_instance_count == 0)
- {
- post("[import] %s",version);
- post("\tWARNING! this is alpha, the interface could change!");
- post("\tcompiled against Pd version %d.%d.%d", PD_MAJOR_VERSION,
- PD_MINOR_VERSION, PD_BUGFIX_VERSION);
- }
- import_instance_count++;
-
- return (x);
+ if(import_instance_count == 0)
+ {
+ post("[import] %s",version);
+ post("\tWARNING! this is alpha, the interface could change!");
+ post("\tcompiled against Pd version %d.%d.%d", PD_MAJOR_VERSION,
+ PD_MINOR_VERSION, PD_BUGFIX_VERSION);
+ }
+ import_instance_count++;
+
+ return (x);
}
static void import_free(t_import *x)
{
- import_instance_count--;
+ import_instance_count--;
/* TODO perhaps loaded_libs should be an instance variable */
if(import_instance_count == 0)
{
@@ -168,10 +168,10 @@
CLASS_DEFAULT,
A_GIMME,
0);
- /* add inlet atom methods */
- class_addbang(import_class,(t_method) import_output);
-
- /* add inlet selector methods */
- class_addmethod(import_class,(t_method) import_reset,
- gensym("reset"), 0);
+ /* add inlet atom methods */
+ class_addbang(import_class,(t_method) import_output);
+
+ /* add inlet selector methods */
+ class_addmethod(import_class,(t_method) import_reset,
+ gensym("reset"), 0);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Pd-cvs
mailing list