[Gridflow-cvs] [svn] commit: r3301 - in /trunk/base: grid.h main.c

gridflow-cvs at artengine.ca gridflow-cvs at artengine.ca
Wed Mar 26 21:15:23 EDT 2008


Author: matju
Date: Wed Mar 26 21:15:23 2008
New Revision: 3301

Log:
new version of \class Format

Modified:
    trunk/base/grid.h
    trunk/base/main.c

Modified: trunk/base/grid.h
==============================================================================
--- trunk/base/grid.h (original)
+++ trunk/base/grid.h Wed Mar 26 21:15:23 2008
@@ -915,17 +915,26 @@
 };
 \end class Pointer
 
+void suffixes_are (const char *name, const char *suffixes);
+
 #define install(name,ins,outs) rb_funcall(rself,SI(install),3,rb_str_new2(name),INT2NUM(ins),INT2NUM(outs))
-#define install_format(name,ins,outs,mode,suff) rb_funcall(rself,SI(install_format),5, \
-	rb_str_new2(name),INT2NUM(ins),INT2NUM(outs), INT2NUM(mode), rb_str_new2(suff))
+#define install_format(name,ins,outs,mode,suffixes) do {install(name,ins,outs); suffixes_are(name,suffixes);} while(0)
+
 #define SUPER rb_call_super(argc,argv);
 
 \class Format : GridObject {
+	int mode;
 	int fd;
 	FILE *f;
-	Format() : fd(-1), f(0) {}
-	void open (String mode, String filename);
-	void close ();
+	NumberTypeE cast;
+	long frame;
+	Format() : mode(0), fd(-1), f(0), cast(int32_e), frame(0) {}
+	\decl void initialize (Symbol mode, ...);
+	\decl 0 open (String mode, String filename);
+	\decl 0 close ();
+	\decl 0 cast (NumberTypeE nt);
+	\decl 0 seek(int frame);
+	\decl 0 rewind ();
 };
 
 #endif // __GF_GRID_H

Modified: trunk/base/main.c
==============================================================================
--- trunk/base/main.c (original)
+++ trunk/base/main.c Wed Mar 26 21:15:23 2008
@@ -507,8 +507,6 @@
 void startup_grid();
 void startup_flow_objects();
 void startup_format();
-
-Ruby cFormat;
 
 #define SDEF(_class_,_name_,_argc_) \
 	rb_define_singleton_method(c##_class_,#_name_,(RMethod)_class_##_s_##_name_,_argc_)
@@ -580,7 +578,6 @@
 		"STDERR.puts \"can't load: #{$!}\n"
 		"backtrace: #{$!.backtrace.join\"\n\"}\n"
 		"$: = #{$:.inspect}\"\n; false end")) return;
-	cFormat = EVAL("GridFlow::Format");
 	startup_format();
 	STARTUP_LIST()
 	EVAL("h=GridFlow.fclasses; h['#io:window'] = h['#io:quartz']||h['#io:x11']||h['#io:sdl']");



More information about the Gridflow-cvs mailing list