home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 1997 March
/
VPR9703A.ISO
/
VPR_DATA
/
DOGA
/
SOURCES
/
REND.LZH
/
READER
/
MAIN.C
< prev
next >
Wrap
C/C++ Source or Header
|
1995-07-25
|
2KB
|
88 lines
#include <stdio.h>
#include "reader.h"
void main( argc, argv )
int argc ;
char *argv[] ;
{
int i, j, m, n, lockid ;
Object *obj ;
Poly *poly ;
ObjPos *objpos ;
Point *point ;
Frame *frame ;
Pointer(Atr*) patr;
Pointer(Object*) pobj;
Pointer(Poly*) p ;
Atr *atr ;
meminit( 31L * 1024L );
/*
virinit( "virtual", 4 );
*/
patr = atrread( "dman.atr", NULL );
printf( "datasize : %ld\n", datasize() );
for( atr = pointer( patr ) ; atr != NULL ; atr = pointer( atr->next ) )
{
printf( "name : %s\n", atr->name );
printf( "col : %ld %ld %ld\n", atr->col[0], atr->col[1], atr->col[2] );
printf( "dif : %ld %ld %ld\n", atr->dif[0], atr->dif[1], atr->dif[2] );
printf( "h : %ld\n", atr->h );
}
pobj = objread( "dman.suf", NULL );
/*
tempopen( "main.tmp" );
pobj = tempread( "dd.suf", NULL );
tempclose( "main.tmp" );
*/
objatr( pobj, patr );
printf( "datasize : %ld\n", datasize() );
obj = pointer( pobj );
printf( "objname : %s\n", obj->name );
printf( " atrnum: %d\n", obj->atrnum );
v_print( " max : ", obj->max );
v_print( " min : ", obj->min );
n = obj->polynum ;
p = obj->poly ;
for( i = 0 ; i < n ; ++i )
{
poly = pointer( p );
lockid = datalock();
m = poly->pointnum ;
atr = pointer( poly->atr );
printf( " atr name : %s\n", atr->name );
point = (Point*)pointer( poly->point );
for( j = 0 ; j < 1 ; ++j )
{
v_print( " ", point[j] );
}
printf( "\n" );
dataunlock( lockid );
p = poly->next ;
}
frameopen( "dman.frm" );
frameskip();
frame = frameread( pobj );
frameclose();
objpos = pointer( frame->objpos ) ;
while( objpos != NULL )
{
lockid = datalock();
obj = pointer( objpos->obj );
printf( "\nobj name : %s\n", obj->name );
v_print( " pos : ", objpos->mat[3] );
objpos = pointer( objpos->next ) ;
}
}