File: Cleanup.c

package info (click to toggle)
spooles 2.2-9
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 19,012 kB
  • sloc: ansic: 146,834; csh: 3,615; makefile: 2,040; perl: 74
file content (68 lines) | stat: -rw-r--r-- 1,481 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*  Cleanup.c  */

#include "../Bridge.h"

#define MYDEBUG 1

#if MYDEBUG > 0
static int count_Cleanup = 0 ;
static double time_Cleanup = 0.0 ;
#endif

/*--------------------------------------------------------------------*/
/*
   --------------------------------------------
   purpose -- to free the owned data structures

   return values --
      1 -- normal return
     -1 -- data is NULL

   created -- 98aug10, cca
   --------------------------------------------
*/
int
Cleanup (
   void   *data
) {
Bridge   *bridge = (Bridge *) data ;
#if MYDEBUG > 0
double   t1, t2 ;
MARKTIME(t1) ;
count_Cleanup++ ;
fprintf(stdout, "\n (%d) Cleanup()", count_Cleanup) ;
fflush(stdout) ;
#endif
/*
   ---------------
   check the input
   ---------------
*/
if ( data == NULL ) {
   fprintf(stderr, "\n error in Cleanup()"
           "\n data is NULL\n") ;
   return(-1) ;
}
bridge->pencil->inpmtxA = NULL ;
bridge->pencil->inpmtxB = NULL ;
Pencil_free(bridge->pencil) ;
IVL_free(bridge->symbfacIVL) ;
FrontMtx_free(bridge->frontmtx) ;
ETree_free(bridge->frontETree) ;
SubMtxManager_free(bridge->mtxmanager) ;
IV_free(bridge->oldToNewIV) ;
IV_free(bridge->newToOldIV) ;
DenseMtx_free(bridge->X) ;
DenseMtx_free(bridge->Y) ;

#if MYDEBUG > 0
MARKTIME(t2) ;
time_Cleanup += t2 - t1 ;
fprintf(stdout, ", %8.3f seconds, %8.3f total seconds, ", 
        t2 - t1, time_Cleanup) ;
fflush(stdout) ;
#endif

return(1) ; }

/*--------------------------------------------------------------------*/