#define MAXOMATS 1000 matrix omats[ 1000 ]; int s_omats; int n_omats; #define MAXVARS 100 float cur[ MAXVARS ]; int s_cur; int n_cur; file wfp; int rval, err; int i, j; int tss_read() c; int tss_next(); int tss_write() c; int MAT_fprint() c; if( argc != 2 ){ fprintf( stderr, "usage: %s status-file\n", argv[ 2 ] ); exit( 1 ); } if( ( wfp = fopen( argv[ 2 ], "r" ) ) == NULL ){ fprintf( stderr, "%s: can't read status-file '%s'\n", argv[ 1 ], argv[ 2 ] ); exit( 1 ); } tss_read( wfp ); fclose( wfp ); s_omats = MAXOMATS; s_cur = MAXVARS; if( tss_next( err, s_omats, n_omats, omats, s_cur, n_cur, cur ) ){ MAT_fprint( stdout, n_omats, omats ); fprintf( stderr, "tss_next:" ); for( i = 1; i <= n_cur; i++ ) fprintf( stderr, " %5.1lf", cur[i] ); fprintf( stderr, "\n" ); if( ( wfp = fopen( argv[ 2 ], "w" ) ) == NULL ){ fprintf( stderr, "%s: can't write status-file '%s'\n", argv[ 1 ], argv[ 2 ] ); exit( 1 ); } tss_write( wfp ); fclose( wfp ); rval = 0; }else rval = 1; exit( rval );