home *** CD-ROM | disk | FTP | other *** search
- /* t4mul.c
-
- (c)Copyright Sequiter Software Inc., 1987-1990. All rights reserved.
-
- Tests Code Base multi-user.
- */
-
- #include "p4misc.h"
- #include "d4all.h"
- #include "w4.h"
- #include "u4error.h"
-
- #include <string.h>
- #include <stdlib.h>
- #include <stdio.h>
-
- static FIELD co_fields[] =
- {
- { "COMMAND", 'C', 20,0,0 },
- { "PARM", 'C', 8, 0,0},
- } ;
-
- #define WORK_WIDTH 11
-
- static FIELD wo_fields[] =
- {
- { "WORK", 'C', WORK_WIDTH,0,0 },
- } ;
-
- static FIELD result_flds[] =
- {
- { "RESULT", 'C', 8,0,0 },
- } ;
-
- #ifdef LOG
- static FIELD log_flds[] =
- {
- { "ID", 'C', 12,0,0 },
- { "LOG1", 'C', 20,0,0 },
- { "LOG2", 'C', 20,0,0 },
- } ;
- #endif
-
- char *log_id_ptr = (char *) 0 ;
- int lo = -1 ;
- int co, wo, re, i_w1, i_w2 ;
- long co_ref, parm_ref, wo_ref, id_ref, log1_ref, log2_ref, result_ref ;
-
- static void send(char *, char *) ;
- static void int_ret(long,int) ;
- static void ch_base_locked(long,int);
- static void command_sender(void) ;
- static void work_doer(void) ;
- static void d_lock(void) ;
- static void d_seek(void) ;
- static void d_skip(void) ;
- static void d_write(void) ;
- static void d_append(void) ;
- static void d_unlock(void) ;
- static void i_lock(void) ;
- static void sleep(long) ;
- static void d_append_one(void) ;
- static int seek_recs(long) ;
- static int write_recs(long) ;
- static int append_recs(long) ;
- static int skip_recs(long) ;
- static int result_int( int) ;
-
- /* Number of Records per Buffer for T4MUL_WO.DBF */
- #define REC_PER_BUF 2L
-
- extern void logger( char *, char *) ;
-
- int first = 1 ;
-
- void logger( char *p1, char *p2 )
- {
- int p_ref ;
-
- if ( d4select(-1) == lo || lo < 0 ) return ;
-
- p_ref = d4select(lo) ;
- d4lock(-1L,1) ;
-
- if ( first )
- {
- first = 0 ;
- d4zap( 1L, d4reccount() ) ;
- }
-
- if ( log_id_ptr == (char *) 0 )
- f4r_str( id_ref, "UNKNOWN" ) ;
- else
- f4r_str( id_ref, log_id_ptr ) ;
- f4r_str( log1_ref, p1 ) ;
- f4r_str( log2_ref, p2 ) ;
- d4append() ;
-
- d4unlock(-1L) ;
- d4select(p_ref) ;
- }
-
- #ifdef OS2
- extern unsigned far pascal DOSSLEEP (
- unsigned long );
-
- static void sleep( n_ms )
- long n_ms ;
- {
- DOSSLEEP( (unsigned long) n_ms ) ;
- }
- #else
-
- static void sleep( long n_ms )
- {
- while( n_ms-- > 0 ) ;
- }
- #endif
-
- main()
- {
- int rc ;
-
- #ifdef NO_HUGE
- #ifdef IS_386
- d4init() ;
- #else
- d4initialize( 4, 4, 20, 1000, 20000L ) ;
- #endif
- #else
- d4init() ;
- #endif
- w4clear(-1) ;
-
- if ( (co = d4use("T4MUL_CO")) < 0 )
- {
- w4( w4row()+1,0, "Creating T4MUL_CO" ) ;
- if ( (co = d4create( "T4MUL_CO", 2, co_fields, 0)) < 0 )
- w4exit(1) ;
- }
- d4buf_total( 1L, 1, 0 ) ;
- d4buf_unit( 1L ) ;
- co_ref = f4ref( "COMMAND" ) ;
- parm_ref = f4ref( "PARM" ) ;
-
- if ( (wo = d4use("T4MUL_WO")) < 0 )
- {
- w4( w4row()+1,0, "Creating T4MUL_WO" ) ;
- if ( (wo = d4create( "T4MUL_WO", 3, wo_fields, 0)) < 0 )
- w4exit(1) ;
- }
- d4buf_total( 8L, 3, 0 ) ;
- d4buf_unit( REC_PER_BUF ) ;
- wo_ref = f4ref( "WORK" ) ;
-
- if ( (re = d4use("T4MUL_RE")) < 0 )
- {
- w4( w4row()+1,0, "Creating T4MUL_RE" ) ;
- if ( (re = d4create( "T4MUL_RE", 1, result_flds, 0)) < 0 )
- w4exit(1) ;
- }
- d4buf_total( 1L, 1, 0 ) ;
- d4buf_unit( 1L ) ;
- result_ref = f4ref( "RESULT" ) ;
-
- #ifdef LOG
- if ( (lo = d4use("T4MUL_LO")) < 0 )
- {
- w4( w4row()+1,0, "Creating T4MUL_LO" ) ;
- if ( (lo = d4create( "T4MUL_LO", 3, log_flds, 0)) < 0 )
- w4exit(1) ;
- }
- id_ref = f4ref( "ID" ) ;
- log1_ref = f4ref( "LOG1" ) ;
- log2_ref = f4ref( "LOG2" ) ;
- logger( "First Log", "" ) ;
- #endif
-
- w4( w4row()+1,0, "Databases Open" ) ;
-
- d4select(co) ;
- if ( (rc = d4lock( -1L, 0)) == -1 ) w4exit(1) ;
- if ( rc == 0 )
- {
- log_id_ptr = "Commander" ;
- w4( w4row()+1,0, "Commander Session" ) ;
-
- d4select(re) ;
- d4zap( 1L, d4reccount() ) ;
- d4unlock(-1L) ;
-
- d4select(wo) ;
-
- /* Wait Until the 'work' Database has been Locked. */
- for ( ;;)
- {
- if ( (rc = d4lock(-1L, 0)) == -1 ) w4exit(1) ;
- if ( rc != 0 )
- {
- w4( w4row()+1,0, "Lock Detected!" ) ;
- break ;
- }
-
- d4unlock(-1L) ;
-
- w4position( w4row()+1,0) ;
- w4clear(w4row()) ;
- w4( w4row(),0, "Commander - 'T4MUL_WO.DBF' not yet locked by worker." ) ;
- sleep( 50L ) ;
- }
-
- command_sender() ;
- w4clear(-1) ;
- w4( 0,0, "Commander Success" ) ;
- }
- else
- {
- log_id_ptr = "Worker " ;
- w4( w4row()+1,0, "Worker Session" ) ;
-
- d4select(wo) ;
- d4zap( 1L, d4reccount()) ;
-
- if ( d4lock(-1L,1) < 0 ) w4exit(1) ;
- w4( w4row()+1,0, "T4MUL_WO.DBF locked." ) ;
-
- i_w1 = i4index( "T4MUL_W1", "WORK", 0,0) ;
- i_w2 = i4index( "T4MUL_W2", "WORK", 0,0) ;
-
- work_doer() ;
- w4clear(-1) ;
- w4( 0,0, "Worker Success" ) ;
- }
-
- d4close_all() ;
-
- w4cursor(w4row()+1,0) ;
- d4init_undo() ;
-
- #ifdef H4TEST
- rc = h4free_check(32000) ;
- if ( rc != 0 )
- printf( "t4mul: Error - %d memory items are not freed !", rc ) ;
- #endif
-
- exit(0) ;
- }
-
-
- static void send( char *com, char *parm )
- {
- int p_ref ;
-
- w4position( w4row()+2,0) ;
- w4clear( w4row() ) ;
- /* w4( w4row(),0, "Press a Char to Send Next Command ... " ) ;
- g4char() ;
- */
- w4( w4row(),w4col(), "Sent: " ) ;
- w4out( com ) ;
- w4out( " Parameter: " ) ;
- w4out( parm ) ;
-
- p_ref = d4select( co ) ;
- d4lock( -1L, 1 ) ;
-
- d4append_blank() ;
- f4r_str( co_ref, com ) ;
- f4r_str( parm_ref, parm ) ;
-
- d4unlock( -1L ) ;
-
- d4select( p_ref ) ;
- }
-
- static void int_ret( long rec, int val )
- {
- int p_ref ;
-
- w4( w4row()+1,0, "Getting Return Record" ) ;
- w4long( w4row(),w4col(), rec, 6) ;
- w4( w4row(),w4col(), " ... " ) ;
-
- p_ref = d4select( re ) ;
- d4unlock( -1L ) ;
-
- while ( d4reccount() < rec )
- sleep(50L) ; /* 1/20 Second */
-
- d4go( rec ) ;
- if ( f4int(result_ref) != val )
- {
- u4error( 0, "t4mul: result is unexpected.", (char *) 0 ) ;
- w4exit(1) ;
- }
-
- d4unlock(-1L) ;
- d4select( p_ref ) ;
-
- w4( w4row(),w4col(), "Received" ) ;
- }
-
- /* Check the locks
- rec_cd - That Record Should be Locked
- - If zero, no specific record is locked
-
- file_cd - Neg one and the whole file should be locked.
- - Zero and the reccount byte should be locked.
- - One and nothing is locked except perhaps a record.
- */
- static void ch_base_locked( long rec_cd, int file_cd )
- {
- int rc ;
-
- w4( w4row()+1,0, "Checking Database Locks" ) ;
-
- if ( (rc = d4lock( -1L, 0 )) == -1 ) w4exit(1) ;
- d4unlock( -1L) ;
-
- if ( rc == 0 )
- {
- /* If the file could be locked, 'worker' can have nothing locked. */
- if (rec_cd != 0L || file_cd != 1 )
- {
- u4error( 0, "t4mul: Lock Error 1", (char *) 0 ) ;
- w4exit(1) ;
- }
- }
-
- if ( (rc = d4lock( 0L, 0 )) == -1 ) w4exit(1) ;
- d4unlock( -1L ) ;
- /* If record count bytes can be locked, 'worker' cannot have
- the whole file locked. In addition, if the record count
- bytes cannot be locked, they better not be unlocked. */
- if ( rc == 0 && file_cd <= 0 || rc == -2 && file_cd == 1 )
- {
- u4error( 0, "t4mul: Lock Error 2", (char *) 0 ) ;
- w4exit(1) ;
- }
-
- if ( d4reccount() > 0L )
- {
- if ( (rc = d4lock( 1L, 0 )) == -1 ) w4exit(1) ;
- d4unlock( -1L ) ;
- /* If record zero can be locked, 'worker' cannot have the whole
- file locked. If they cannot be locked, they better not be locked. */
- if ( rc == 0 && (file_cd == -1 || rec_cd == 1L) ||
- rc == -2 && file_cd != -1 && rec_cd != 1L)
- {
- u4error( 0, "t4mul: Lock Error 3", (char *) 0 ) ;
- w4exit(1) ;
- }
- }
-
- if ( rec_cd > 0L )
- {
- /* If 'worker' has locked the record, we better not be able to lock it. */
- if ( (rc = d4lock( rec_cd, 0 )) == -1 ) w4exit(1) ;
- d4unlock( -1L ) ;
- if ( rc == 0 )
- {
- u4error( 0, "t4mul: Lock Error 4", (char *) 0 ) ;
- w4exit(1) ;
- }
- }
- }
-
- static void command_sender()
- {
- long r ;
- int rc, i ;
-
- r = 1L ;
-
- /* Wait until the other database is locked. This
- signals the other session knows it is the 'work' session. */
- d4select( co) ;
- d4zap( 1L, d4reccount() ) ;
- d4select(wo) ;
-
- send( "D4UNLOCK", "-1" ) ;
- int_ret( r++, 0 ) ;
- ch_base_locked( 0L, 1) ;
-
- /* Lock the work database, it will not be unlocked until
- the index files have been created. */
- d4select(wo) ;
- d4lock(-1L, 1) ;
- if ( (i_w1 = i4open("T4MUL_W1")) < 0 ) w4exit(1) ;
- if ( (i_w2 = i4open("T4MUL_W2")) < 0 ) w4exit(1) ;
- d4unlock(-1L) ;
-
- send( "D4LOCK", "0" ) ;
- int_ret( r++, 0 ) ;
- ch_base_locked( 0L, 0) ;
-
- send( "D4UNLOCK", "0" ) ;
- int_ret( r++, 0 ) ;
- ch_base_locked( 0L, 1) ;
-
- send( "D4LOCK", "-1" ) ;
- int_ret( r++, 0 ) ;
- ch_base_locked( 0L, -1) ;
-
- send( "D4UNLOCK", "-1" ) ;
- int_ret( r++, 0 ) ;
- ch_base_locked( 0L, 1) ;
-
-
- send( "I4LOCK", "" ) ;
- int_ret( r++, 0 ) ;
-
- /* Check to make sure the index file is locked. */
- if ( (rc = i4lock( i_w1, 0)) == -1 ) w4exit(1) ;
- if ( rc == 0 )
- {
- u4error( 0, "t4mul: Index Locking", (char *) 0 ) ;
- w4exit(1) ;
- }
-
- send( "D4UNLOCK", "-1" ) ;
- int_ret( r++, 0 ) ;
- ch_base_locked( 0L, 1) ;
-
- /* Check to make sure the index file is unlocked. */
- if ( (rc = i4lock( i_w1, 0)) == -1 ) w4exit(1) ;
- if ( rc != 0 )
- {
- u4error( 0, "t4mul: Index Locking", (char *) 0 ) ;
- w4exit(1) ;
- }
- d4unlock(-1L) ;
-
- for ( i=1; i<= 40; i++ )
- {
- long count ;
-
- send( "APPEND ONE", "1" ) ;
- int_ret( r++, i ) ;
-
- count = d4reccount() ;
- if ( count != (long) i )
- {
- u4error( 0, "t4mul: Count", (char *) 0 ) ;
- w4exit(1) ;
- }
- }
-
- send( "D4UNLOCK", "-1" ) ;
- int_ret( r++, 0 ) ;
- ch_base_locked( 0L, 1) ;
-
- for ( i=1; i<= 40; i++ )
- {
- d4go( (long) i ) ;
- if ( f4long( wo_ref) != (long) i )
- {
- u4error( 0, "t4mul: Append Check", (char *) 0 ) ;
- w4exit(1) ;
- }
- }
- d4zap(1L, d4reccount() ) ;
- d4unlock(-1L) ;
-
- send( "D4APPEND", "20" ) ;
- append_recs(20L) ;
- int_ret( r++, 0 ) ;
-
- if ( d4reccount() != 40 )
- {
- u4error( 0, "t4mul: Wrong Count", (char *) 0 ) ;
- w4exit(1) ;
- }
-
- send( "D4LOCK", "0" ) ;
- int_ret( r++, 0 ) ;
- ch_base_locked( 0L, 0) ;
-
- send( "D4LOCK", "5" ) ;
- int_ret( r++, 0 ) ;
- ch_base_locked( 5L, 0) ;
-
- send( "D4LOCK", "2" ) ;
- int_ret( r++, 0 ) ;
- ch_base_locked( 2L, 0) ;
-
- send( "D4UNLOCK", "1" ) ;
- int_ret( r++, 0 ) ;
- ch_base_locked( 0L, 0) ;
-
- send( "D4LOCK", "5" ) ;
- int_ret( r++, 0 ) ;
- ch_base_locked( 5L, 0) ;
-
- send( "D4UNLOCK", "-1" ) ;
- int_ret( r++, 0 ) ;
- ch_base_locked( 0L, 1) ;
-
-
- /* Test Dirty Read. */
- send( "D4LOCK", "-1" ) ;
- int_ret( r++, 0 ) ;
- ch_base_locked( 0L, -1) ;
-
- d4lock_code( 2) ;
- if ( d4go(5L) != 0 )
- {
- u4error( 0, "t4mul: Dirty Read", (char *) 0 ) ;
- w4exit(1) ;
- }
- if ( f4long( wo_ref) != 5L )
- {
- u4error( 0, "t4mul: Dirty Read 2", (char *) 0 ) ;
- w4exit(1) ;
- }
-
- d4lock_code( 1) ;
-
- /* Test Lock Wait. */
- d4lock_wait( 0) ;
- if ( d4go(5L) != -2 )
- {
- u4error( 0, "t4mul: Lock Wait", (char *) 0 ) ;
- w4exit(1) ;
- }
- d4lock_wait( 1) ;
-
- send( "D4SKIP", "1" ) ;
- skip_recs(-1L) ;
- int_ret( r++, 0 ) ;
-
- send( "D4WRITE", "20" ) ; /* Write Records 1 through 4 many times. */
- write_recs(-20L) ; /* Write Records Backwards. */
- int_ret( r++, 0 ) ;
-
- send( "D4WRITE", "20" ) ; /* Write Records 1 through 4 many times. */
- skip_recs(-1L) ;
- int_ret( r++, 0 ) ;
-
- send( "D4SEEK", "20" ) ;
- skip_recs(-1L) ;
- int_ret( r++, 0 ) ;
-
- send( "D4SEEK", "-20" ) ;
- write_recs(20L) ;
- int_ret( r++, 0 ) ;
-
- if ( i4check( i_w1) != 0 )
- {
- u4error( 0, "t4mul: Check 1", (char *) 0 ) ;
- w4exit(1) ;
- }
-
- if ( i4check( i_w2) != 0 )
- {
- u4error( 0, "t4mul: Check 2", (char *) 0 ) ;
- w4exit(1) ;
- }
-
- send( "DONE", "" ) ;
- }
-
-
- static int seek_recs( long n )
- {
- long i ;
- long on_rec, direc ;
- int r_col ;
-
- direc = 1L ;
- if ( n < 0 )
- {
- direc = -1L ;
- n = -n ;
- }
-
- w4( w4row()+1, 0, "Seek Number Recs:" ) ;
- w4long( w4row(),w4col(), n, 6) ;
-
- w4( w4row(),w4col()+4, "Seeking Record:" ) ;
- r_col = w4col() ;
-
- for ( i = on_rec = 1L; i<= n; i++)
- {
- char buf[100] ;
-
- c4ltoa( on_rec, buf, f4width(wo_ref) ) ;
- if ( d4seek_str(buf) != 0 )
- w4exit(1) ;
- if ( d4recno() != on_rec )
- {
- u4error( 0, "t4mul: d4seek_double", (char *) 0 ) ;
- w4exit(1) ;
- }
-
- w4long( w4row(),r_col, on_rec, 6 ) ;
-
- on_rec += direc ;
- if ( on_rec < 1L )
- on_rec = d4reccount() ;
- if ( on_rec > d4reccount())
- on_rec = 1L ;
-
- d4unlock(-1L) ;
- }
-
- return 0 ;
- }
-
-
- static int write_recs( long n )
- {
- long i ;
- long on_rec, direc ;
- int i_col, r_col ;
-
- w4( w4row()+1, 0, "Writing Records Itteration:" ) ;
- i_col = w4col() ;
-
- w4( w4row(),w4col()+10, "Record:" ) ;
- r_col = w4col() ;
-
- direc = 1L ;
- if ( n < 0 )
- {
- direc = -1L ;
- n = -n ;
- }
-
- for ( on_rec = i=1L; i<= n; on_rec += direc, i++)
- {
- if ( on_rec < 0L ) on_rec = 20L ;
- if ( on_rec > 20L ) on_rec = 1L ;
-
- w4long( w4row(),i_col, i, 6 ) ;
- w4long( w4row(),r_col, on_rec, 6 ) ;
-
- d4go( on_rec ) ;
- f4r_long( wo_ref, on_rec ) ;
- d4unlock(-1L) ;
- }
- return 0 ;
- }
-
-
- static void d_append_one()
- {
- w4( w4row()+2,0, "Append One Next" ) ;
-
- f4r_long( wo_ref, d4reccount()+1L ) ;
- if ( d4append() < 0 )
- w4exit(1) ;
-
- d4unlock(-1L ) ;
-
- w4( w4row()+1,w4col(), "New Count:" ) ;
- w4long( w4row(),w4col(), d4reccount(), 6 ) ;
-
- result_int( (int) d4reccount() ) ;
- }
-
-
- static int append_recs( long n )
- {
- int c ;
- long i ;
-
- w4( w4row()+1,0, "Appending" ) ; w4long( w4row(),w4col(), n, 6 ) ;
- c = w4col() ;
-
- for ( i=1L; i<= n; i++ )
- {
- w4long( w4row(),c, i, 6 ) ;
-
- if ( d4append_blank() < 0 )
- w4exit(1) ;
-
- f4r_long( wo_ref, d4recno() ) ;
- d4unlock(-1L) ;
-
- sleep(50L) ;
- }
-
- if ( i4check(i_w1) != 0 )
- w4exit(1) ;
- if ( i4check(i_w2) != 0 )
- w4exit(1) ;
-
- d4unlock(-1L) ;
-
- return 0 ;
- }
-
-
- static int skip_recs( long direc )
- {
- int c ;
-
- w4( w4row()+1,0, "Skipping Direction: " ) ;
- w4long( w4row(),w4col(), direc, 6 ) ;
- w4( w4row(),w4col(), " Record On:" ) ;
- c = w4col() ;
-
- d4select( wo ) ;
-
- if ( direc < 0 )
- {
- direc = -1L ;
- if ( d4bottom() != 0 )
- {
- u4error( 0, "t4mul", (char *) 0 ) ;
- w4exit(1) ;
- }
- }
- else
- {
- direc = 1L ;
- if ( d4top() != 0 )
- {
- u4error( 0, "t4mul", (char *) 0 ) ;
- w4exit(1) ;
- }
- }
-
- for(;;)
- {
- w4long( w4row(),c, d4recno(), 6) ;
-
- if ( d4skip(direc) < 0 )
- if ( !d4bof() && !d4eof() )
- {
- u4error( 0, "t4mul", (char *) 0 ) ;
- w4exit(1) ;
- }
-
- if ( f4long( wo_ref) != d4recno() )
- if ( ! d4eof() )
- {
- u4error( 0, "t4mul", (char *) 0 ) ;
- w4exit(1) ;
- }
-
- d4unlock(-1L) ;
-
- if ( d4bof() || d4eof() )
- {
- if ( d4recno() != 1L && d4recno() != d4reccount()+1L )
- {
- u4error( 0, "t4mul", (char *) 0 ) ;
- w4exit(1) ;
- }
- return 0 ;
- }
- }
- }
-
-
- static int result_int( int i )
- {
- d4select( re ) ;
- if ( d4lock( -1L, 1) < 0 ) w4exit(1) ;
- d4append_blank() ;
- f4r_int( result_ref, i ) ;
- d4unlock(-1L) ;
-
- return i ;
- }
-
- static void d_lock()
- {
- result_int( d4lock(f4long(parm_ref),1)) ;
- }
-
- static void d_unlock()
- {
- result_int( d4unlock(f4long(parm_ref))) ;
- }
-
- static void d_seek()
- {
- result_int( seek_recs(f4long(parm_ref))) ;
- }
-
- static void d_skip()
- {
- result_int( skip_recs(f4long(parm_ref))) ;
- }
-
- static void d_write()
- {
- result_int( write_recs(f4long(parm_ref))) ;
- }
-
- static void d_append()
- {
- result_int( append_recs(f4long(parm_ref))) ;
- }
-
- static void i_lock()
- {
- result_int( i4lock( i_w1,1)) ;
- }
-
- typedef struct list_st
- {
- char work[WORK_WIDTH] ;
- void (*f)(void) ;
- } LIST ;
-
-
- LIST list[] =
- {
- { "D4LOCK ", d_lock },
- { "D4UNLOCK ", d_unlock },
- { "D4SEEK ", d_seek },
- { "D4SKIP ", d_skip },
- { "D4WRITE ", d_write},
- { "D4APPEND ", d_append},
- { "I4LOCK ", i_lock},
- { "APPEND ONE", d_append_one},
- { "", 0 },
- } ;
-
- static void work_doer()
- {
- long co_rec ;
- int i ;
-
- d4select( co ) ;
- d4lock(-1L,1 ) ;
- d4unlock( -1L ) ;
-
- d4select( wo ) ;
-
- for ( co_rec = 1L;;)
- {
- /* Get a Command */
- d4select(co) ;
- if ( d4reccount() < co_rec )
- {
- sleep(50L) ; /* 1/20 Sec */
- continue ;
- }
-
- d4go( co_rec++ ) ;
- d4unlock(-1L) ;
-
- w4( w4row()+2,0, "Received Command: " ) ;
- w4out( f4str(co_ref) ) ;
- w4out( " Parameter:" ) ;
- w4out( f4str(parm_ref) ) ;
-
- for ( i=0;; i++ )
- if ( list[i].work[0] == '\0' )
- {
- if ( memcmp("DONE", f4ptr(co_ref), 4) == 0 )
- return ;
- u4error( 0, "Unrecognized Command", f4str(co_ref), (char *) 0 ) ;
- w4exit(1) ;
- }
- else
- {
- if ( memcmp( list[i].work, f4ptr(co_ref), sizeof(list->work)-1) == 0)
- {
- d4select(wo) ;
- (*list[i].f)() ;
- break ;
- }
- }
- }
- }
-