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
    Copyright (c) 1993 Open Software Foundation, Inc.
3
 
4
 
5
    All Rights Reserved
6
 
7
 
8
    Permission to use, copy, modify, and distribute this software
9
    and its documentation for any purpose and without fee is hereby
10
    granted, provided that the above copyright notice appears in all
11
    copies and that both the copyright notice and this permission
12
    notice appear in supporting documentation.
13
 
14
 
15
    OSF DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING
16
    ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
17
    PARTICULAR PURPOSE.
18
 
19
 
20
    IN NO EVENT SHALL OSF BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
21
    CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
22
    LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
23
    NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
24
    WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
25
*/
26
 
27
/*
28
    		 Crown Copyright (c) 1997
29
 
30
    This TenDRA(r) Computer Program is subject to Copyright
31
    owned by the United Kingdom Secretary of State for Defence
32
    acting through the Defence Evaluation and Research Agency
33
    (DERA).  It is made available to Recipients with a
34
    royalty-free licence for its use, reproduction, transfer
35
    to other parties and amendment for any purpose not excluding
36
    product development provided that any such use et cetera
37
    shall be deemed to be acceptance of the following conditions:-
38
 
39
        (1) Its Recipients shall ensure that this Notice is
40
        reproduced upon any copies or amended versions of it;
41
 
42
        (2) Any amended version of it shall be clearly marked to
43
        show both the nature of and the organisation responsible
44
        for the relevant amendment or amendments;
45
 
46
        (3) Its onward transfer from a recipient to another
47
        party shall be deemed to be that party's acceptance of
48
        these conditions;
49
 
50
        (4) DERA gives no warranty or assurance as to its
51
        quality or suitability for any purpose and DERA accepts
52
        no liability whatsoever in relation to any use to which
53
        it may be put.
54
*/
55
 
56
 
57
 
58
/**********************************************************************
59
$Author: release $
60
$Date: 1998/02/04 15:48:41 $
61
$Revision: 1.2 $
62
$Log: comment.c,v $
63
 * Revision 1.2  1998/02/04  15:48:41  release
64
 * Added OSF copyright message.
65
 *
66
 * Revision 1.1.1.1  1998/01/17  15:55:56  release
67
 * First version to be checked into rolling release.
68
 *
69
 * Revision 1.2  1996/10/04  15:59:53  pwe
70
 * add banners and mod for PWE ownership
71
 *
72
**********************************************************************/
73
 
74
 
75
#include "config.h"
76
#include "translat.h"	/* for as_file */
77
#include "comment.h"
78
bool do_comment;			/* set in powertrans.c */
79
 
80
#ifdef DO_COMMENT
81
 
82
void COMMENT PROTO_N ((mess)) PROTO_T (char *mess)
83
{
84
  if (do_comment)
85
  {
86
    fprintf(as_file, "## %s\n", mess);
87
  }
88
}
89
 
90
void COMMENT1 PROTO_N ((mess,p1)) PROTO_T (char *mess X long p1)
91
{
92
  if (do_comment)
93
  {
94
    fprintf(as_file, "## ");
95
    fprintf(as_file, mess, p1);
96
    fprintf(as_file, "\n");
97
  }
98
}
99
 
100
void COMMENT2 PROTO_N ((mess,p1,p2)) PROTO_T (char *mess X long p1 X long p2)
101
{
102
  if (do_comment)
103
  {
104
    fprintf(as_file, "## ");
105
    fprintf(as_file, mess, p1, p2);
106
    fprintf(as_file, "\n");
107
  }
108
}
109
 
110
void COMMENT3 PROTO_N ((mess,p1,p2,p3)) PROTO_T (char *mess X long p1 X long p2 X long p3)
111
{
112
  if (do_comment)
113
  {
114
    fprintf(as_file, "## ");
115
    fprintf(as_file, mess, p1, p2, p3);
116
    fprintf(as_file, "\n");
117
  }
118
}
119
 
120
void COMMENT4 PROTO_N ((mess,p1,p2,p3,p4)) PROTO_T (char *mess X long p1 X long p2 X long p3 X long p4)
121
{
122
  if (do_comment)
123
  {
124
    fprintf(as_file, "## ");
125
    fprintf(as_file, mess, p1, p2, p3, p4);
126
    fprintf(as_file, "\n");
127
  }
128
}
129
 
130
#else				/* DO_COMMENT */
131
 
132
/* defined as null macros in comment.h */
133
 
134
#endif				/* DO_COMMENT */
135
 
136
 
137
void fail PROTO_N ((mess)) PROTO_T (char *mess)
138
{
139
  COMMENT1("TRANSLATION FAILED: %s", (long) mess);
140
  fflush(as_file);
141
  fprintf(stderr, "powertrans: internal error '%s'\n", mess);
142
  if (!do_comment)
143
  {
144
    exit(3);
145
  }
146
  /* else go on to generate more code to give the error context */
147
}