1 /* IO.c */
2
3 #include "../SubMtxManager.h"
4
5 /*--------------------------------------------------------------------*/
6 /*
7 ----------------------------------------
8 purpose -- to write the object to a file
9 in human readable form
10
11 created -- 98may02, cca
12 ----------------------------------------
13 */
14 void
SubMtxManager_writeForHumanEye(SubMtxManager * manager,FILE * fp)15 SubMtxManager_writeForHumanEye (
16 SubMtxManager *manager,
17 FILE *fp
18 ) {
19 SubMtx *mtx ;
20 /*
21 ---------------
22 check the input
23 ---------------
24 */
25 if ( manager == NULL || fp == NULL ) {
26 fprintf(stderr,
27 "\n fatal error in SubMtxManager_writeForHumanEye(%p,%p)"
28 "\n bad input\n", manager, fp) ;
29 exit(-1) ;
30 }
31 fprintf(fp, "\n\n SubMtxManager object at address %p"
32 "\n %d active objects, %d bytes active"
33 "\n %d total bytes requested, %d total bytes allocated "
34 "\n %d requests, %d releases, %d locks, %d unlocks",
35 manager, manager->nactive, manager->nbytesactive,
36 manager->nbytesrequested, manager->nbytesalloc,
37 manager->nrequests, manager->nreleases,
38 manager->nlocks, manager->nunlocks) ;
39 /*
40 for ( mtx = manager->head ; mtx != NULL ; mtx = mtx->next ) {
41 fprintf(fp, "\n mtx (%d,%d), nbytes %d",
42 mtx->rowid, mtx->colid, SubMtx_nbytesInWorkspace(mtx)) ;
43 }
44 */
45 return ; }
46
47 /*--------------------------------------------------------------------*/
48