Subversion Repositories tendra.SVN

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 7u83 1
/*
2
    		 Crown Copyright (c) 1997
3
 
4
    This TenDRA(r) Computer Program is subject to Copyright
5
    owned by the United Kingdom Secretary of State for Defence
6
    acting through the Defence Evaluation and Research Agency
7
    (DERA).  It is made available to Recipients with a
8
    royalty-free licence for its use, reproduction, transfer
9
    to other parties and amendment for any purpose not excluding
10
    product development provided that any such use et cetera
11
    shall be deemed to be acceptance of the following conditions:-
12
 
13
        (1) Its Recipients shall ensure that this Notice is
14
        reproduced upon any copies or amended versions of it;
15
 
16
        (2) Any amended version of it shall be clearly marked to
17
        show both the nature of and the organisation responsible
18
        for the relevant amendment or amendments;
19
 
20
        (3) Its onward transfer from a recipient to another
21
        party shall be deemed to be that party's acceptance of
22
        these conditions;
23
 
24
        (4) DERA gives no warranty or assurance as to its
25
        quality or suitability for any purpose and DERA accepts
26
        no liability whatsoever in relation to any use to which
27
        it may be put.
28
*/
29
 
30
 
31
/**********************************************************************
32
$Author: release $
33
$Date: 1998/01/17 15:55:48 $
34
$Revision: 1.1.1.1 $
35
$Log: dwarf_queue.c,v $
36
 * Revision 1.1.1.1  1998/01/17  15:55:48  release
37
 * First version to be checked into rolling release.
38
 *
39
 * Revision 1.1.1.1  1995/08/14  14:30:24  pwe
40
 * transferred from DJCH
41
 *
42
**********************************************************************/
43
 
44
#include "config.h"
45
#include "common_types.h"
46
#include "xalloc.h"
47
#include "basicread.h"
48
#include "dwarf_out.h"
49
#include "dwarf_type.h"
50
#include "dwarf_queue.h"
51
 
52
#ifndef NULL
53
#define NULL ((t_q_elem *) 0)
54
#endif
55
 
56
typedef struct t_q_t
57
{
58
  diag_type val;
59
  struct t_q_t *next;
60
} t_q_elem;
61
 
62
typedef t_q_elem * t_q_ptr;
63
 
64
static t_q_ptr t_q_head = NULL;
65
static t_q_ptr t_q_tail = NULL;
66
 
67
void add_type_q
68
    PROTO_N ( (t) )
69
    PROTO_T ( diag_type t )
70
{
71
  t_q_ptr new = (t_q_ptr) xcalloc(1,sizeof(t_q_elem));
72
 
73
  if (t->key == DIAG_TYPE_UNINIT)
74
    failer("bad queue add");
75
 
76
  new->val = t;
77
  new->next = NULL;
78
  if (t_q_head == NULL)		/* first one */
79
    t_q_head = new;
80
  else
81
    t_q_tail->next = new;
82
 
83
  t_q_tail = new;
84
}
85
 
86
void dump_type_q
87
    PROTO_Z ()
88
{
89
  while (t_q_head != NULL)
90
  {
91
    out_dwarf_user_type(t_q_head->val);	/* may call add_type_q */
92
    t_q_head = t_q_head->next;
93
  }
94
}