[Gridflow-cvs] [svn] commit: r3566 - /trunk/base/main.c

gridflow-cvs at artengine.ca gridflow-cvs at artengine.ca
Wed Apr 16 16:36:03 EDT 2008


Author: matju
Date: Wed Apr 16 16:36:03 2008
New Revision: 3566

Log:
print unknown atoms; added NumberTypeE_find for t_atom

Modified:
    trunk/base/main.c

Modified: trunk/base/main.c
==============================================================================
--- trunk/base/main.c (original)
+++ trunk/base/main.c Wed Apr 16 16:36:03 2008
@@ -66,14 +66,16 @@
 	for (int i=0; i<argc; i++) {
 		t_atomtype t = argv[i].a_type;
 		if (t==A_FLOAT) o << argv[i].a_w.w_float;
-		if (t==A_SYMBOL) o << argv[i].a_w.w_symbol->s_name;
-		if (t==A_POINTER) o << "(pointer)";
-		if (t==A_LIST) {
+		else if (t==A_SYMBOL) o << argv[i].a_w.w_symbol->s_name;
+		else if (t==A_POINTER) o << "(pointer)";
+ 		else if (t==A_COMMA) o << ",";
+ 		else if (t==A_SEMI) o << ";";
+		else if (t==A_LIST) {
 			t_binbuf *b = (t_binbuf *)argv[i].a_w.w_gpointer;
 			o << "[";
 			pd_oprint(o,binbuf_getnatom(b),binbuf_getvec(b));
 			o << "]";
-		}
+		} else o << "(atom of type " << t << ")";
 		if (i!=argc-1) o << " ";
 	}
 }
@@ -146,6 +148,12 @@
 	if (TYPE(sym)!=T_STRING) sym=rb_funcall(sym,SI(to_s),0);
 	return NumberTypeE_find(string(rb_str_ptr(sym)));
 }
+
+NumberTypeE NumberTypeE_find (t_atom &x) {
+	if (x.a_type!=A_SYMBOL) RAISE("expected number-type (as symbol)");
+	return NumberTypeE_find(string(x.a_w.w_symbol->s_name));
+}
+
 
 /* ---------------------------------------------------------------- */
 



More information about the Gridflow-cvs mailing list