Blame view

tools/sctk-2.4.10/src/sclite/knode2.c 1.31 KB
8dcb6dfcb   Yannick Estève   first commit
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
  /* file knode2.c */
  
  #include "sctk.h"
  
  void kill_node2(NODE *node1)             
  
  /*******************************************************************/
  /* Deletes NODE *node1 and all its arc-lists.                      */
  /*******************************************************************/
  
   {char *proc = "kill_node2";
    ARC_LIST_ATOM *p1, *p1_next; 
  /* code */
  db_enter_msg(proc,0); /* debug only */
  if (db_level > 0) printf("%s killing node @%p, w/name '%s'
  ",
    pdb,node1,node1->name);
  if (db_level > 1) printf("%s killing in-arc list:
  ",pdb);
    for (p1 = node1->in_arcs;  p1 != NULL; p1 = p1_next)
      {p1_next = p1->next;
       /* if (memory_trace) printf("%s FREEing %x
  ",pdb,(int)p1); */
       free((void*)p1);
      }   
  if (db_level > 1) printf("%s killing out-arc list:
  ",pdb);
    for (p1 = node1->out_arcs;  p1 != NULL; p1 = p1_next)
      {p1_next = p1->next;
       /* if (memory_trace) printf("%s FREEing %x
  ",pdb,(int)p1); */
       free((void*)p1);
      }
  if (db_level > 1) printf("%s killing node name:
  ",pdb);
    /* if (memory_trace) printf("%s FREEing %x
  ",pdb,(int)node1->name); */
    free((void*)node1->name);
  if (db_level > 1) printf("%s killing node:
  ",pdb);
    /* if (memory_trace) printf("%s FREEing %x
  ",pdb,(int)node1); */
    free((void*)node1);
  db_leave_msg(proc,0); /* debug only */
    return;
   } /* end kill_node2() */