Subversion Repositories tendra.SVN

Rev

Rev 5 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5 Rev 6
Line -... Line 1...
-
 
1
/*
-
 
2
 * Copyright (c) 2002-2005 The TenDRA Project <http://www.tendra.org/>.
-
 
3
 * All rights reserved.
-
 
4
 *
-
 
5
 * Redistribution and use in source and binary forms, with or without
-
 
6
 * modification, are permitted provided that the following conditions are met:
-
 
7
 *
-
 
8
 * 1. Redistributions of source code must retain the above copyright notice,
-
 
9
 *    this list of conditions and the following disclaimer.
-
 
10
 * 2. Redistributions in binary form must reproduce the above copyright notice,
-
 
11
 *    this list of conditions and the following disclaimer in the documentation
-
 
12
 *    and/or other materials provided with the distribution.
-
 
13
 * 3. Neither the name of The TenDRA Project nor the names of its contributors
-
 
14
 *    may be used to endorse or promote products derived from this software
-
 
15
 *    without specific, prior written permission.
-
 
16
 *
-
 
17
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
-
 
18
 * IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-
 
19
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-
 
20
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
-
 
21
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-
 
22
 * EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-
 
23
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-
 
24
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-
 
25
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-
 
26
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-
 
27
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
 
28
 *
-
 
29
 * $Id$
-
 
30
 */
1
/*
31
/*
2
    		 Crown Copyright (c) 1997
32
    		 Crown Copyright (c) 1997
3
 
33
 
4
    This TenDRA(r) Computer Program is subject to Copyright
34
    This TenDRA(r) Computer Program is subject to Copyright
5
    owned by the United Kingdom Secretary of State for Defence
35
    owned by the United Kingdom Secretary of State for Defence
Line 38... Line 68...
38
 *
68
 *
39
 * Revision 1.1.1.1  1995/08/14  14:30:24  pwe
69
 * Revision 1.1.1.1  1995/08/14  14:30:24  pwe
40
 * transferred from DJCH
70
 * transferred from DJCH
41
 *
71
 *
42
**********************************************************************/
72
**********************************************************************/
43
 
73
 
44
#include "config.h"
74
#include "config.h"
45
#include "common_types.h"
75
#include "common_types.h"
46
#include "xalloc.h"
76
#include "xalloc.h"
47
#include "basicread.h"
77
#include "basicread.h"
48
#include "dwarf_out.h"
78
#include "dwarf_out.h"
49
#include "dwarf_type.h"
79
#include "dwarf_type.h"
50
#include "dwarf_queue.h"
80
#include "dwarf_queue.h"
51
 
81
 
52
#ifndef NULL
82
#ifndef NULL
53
#define NULL ((t_q_elem *) 0)
83
#define NULL((t_q_elem *)0)
54
#endif
84
#endif
55
 
85
 
56
typedef struct t_q_t
86
typedef struct t_q_t {
57
{
-
 
58
  diag_type val;
87
	diag_type val;
59
  struct t_q_t *next;
88
	struct t_q_t *next;
60
} t_q_elem;
89
} t_q_elem;
61
 
90
 
62
typedef t_q_elem * t_q_ptr;
91
typedef t_q_elem *t_q_ptr;
63
 
92
 
64
static t_q_ptr t_q_head = NULL;
93
static t_q_ptr t_q_head = NULL;
65
static t_q_ptr t_q_tail = NULL;
94
static t_q_ptr t_q_tail = NULL;
66
 
95
 
67
void add_type_q
96
void
68
    PROTO_N ( (t) )
-
 
69
    PROTO_T ( diag_type t )
97
add_type_q(diag_type t)
70
{
98
{
71
  t_q_ptr new = (t_q_ptr) xcalloc(1,sizeof(t_q_elem));
99
	t_q_ptr new = (t_q_ptr)xcalloc(1, sizeof(t_q_elem));
72
 
100
 
73
  if (t->key == DIAG_TYPE_UNINIT)
101
	if (t->key == DIAG_TYPE_UNINIT) {
74
    failer("bad queue add");
102
		failer("bad queue add");
-
 
103
	}
75
 
104
 
76
  new->val = t;
105
	new->val = t;
77
  new->next = NULL;
106
	new->next = NULL;
78
  if (t_q_head == NULL)		/* first one */
107
	if (t_q_head == NULL) {
-
 
108
		/* first one */
79
    t_q_head = new;
109
		t_q_head = new;
80
  else
110
	} else {
81
    t_q_tail->next = new;
111
		t_q_tail->next = new;
-
 
112
	}
82
 
113
 
83
  t_q_tail = new;
114
	t_q_tail = new;
84
}
115
}
85
 
116
 
-
 
117
 
86
void dump_type_q
118
void
87
    PROTO_Z ()
119
dump_type_q(void)
88
{
120
{
89
  while (t_q_head != NULL)
121
	while (t_q_head != NULL) {
90
  {
122
		/* may call add_type_q */
91
    out_dwarf_user_type(t_q_head->val);	/* may call add_type_q */
123
		out_dwarf_user_type(t_q_head->val);
-
 
124
 
92
    t_q_head = t_q_head->next;
125
		t_q_head = t_q_head->next;
93
  }
126
	}
94
}
127
}