1 /* reset.f -- translated by f2c (version 19980913).
2 You must link the resulting object file with the libraries:
3 -lf2c -lm (in that order)
4 */
5
6 #include "f2c.h"
7
8 /* Table of constant values */
9
10 static logical c_false = FALSE_;
11 static logical c_true = TRUE_;
12
13 /* $Procedure RESET ( Reset Error Status ) */
reset_(void)14 /* Subroutine */ int reset_(void)
15 {
16 logical stat;
17 extern logical accept_(logical *), seterr_(logical *);
18 extern /* Subroutine */ int putlms_(char *, ftnlen), putsms_(char *,
19 ftnlen);
20
21 /* $ Abstract */
22
23 /* Reset the SPICELIB error status to a value of "no error." */
24 /* As a result, the status routine, FAILED, will return a value */
25 /* of .FALSE. */
26
27 /* $ Disclaimer */
28
29 /* THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE */
30 /* CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S. */
31 /* GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE */
32 /* ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE */
33 /* PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS" */
34 /* TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY */
35 /* WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A */
36 /* PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC */
37 /* SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE */
38 /* SOFTWARE AND RELATED MATERIALS, HOWEVER USED. */
39
40 /* IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA */
41 /* BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT */
42 /* LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND, */
43 /* INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS, */
44 /* REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE */
45 /* REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY. */
46
47 /* RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF */
48 /* THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY */
49 /* CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE */
50 /* ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE. */
51
52 /* $ Required_Reading */
53
54 /* ERROR */
55
56 /* $ Keywords */
57
58 /* ERROR */
59
60 /* $ Declarations */
61
62 /* None. */
63
64 /* $ Brief_I/O */
65
66 /* VARIABLE I/O DESCRIPTION */
67 /* -------- --- -------------------------------------------------- */
68 /* None. */
69
70 /* $ Detailed_Input */
71
72 /* None. */
73
74 /* $ Detailed_Output */
75
76 /* None. */
77
78 /* $ Parameters */
79
80 /* None. */
81
82 /* $ Exceptions */
83
84 /* This routine does not detect any errors. */
85
86 /* However, this routine is part of the SPICELIB error */
87 /* handling mechanism. */
88
89 /* $ Files */
90
91 /* None. */
92
93 /* $ Particulars */
94
95 /* Please read the "required reading" first! */
96
97 /* The effects of this routine are: */
98
99 /* 1. The SPICELIB status is set to a value of "no error." */
100
101 /* 2. The long and short error messages are set to blank. */
102
103 /* 3. Setting of the long error message is re-enabled. */
104
105
106 /* Subsequent to a call to RESET, references to the status */
107 /* indicator function, FAILED, will return a value of .FALSE., */
108 /* until an error is detected. */
109
110 /* This routine should be called in cases where one wishes */
111 /* to attempt to continue processing after detection of an */
112 /* error, and the 'RETURN' error action is being used. When */
113 /* the error response action is set to 'RETURN', routines */
114 /* that have external references, or that can */
115 /* detect errors, return immediately upon entry when an */
116 /* error condition exists. This prevents a program from */
117 /* crashing, but does not allow for a recovery attempt. */
118
119 /* If one does wish to attempt to recover, */
120 /* in general the procedure is to test for an error */
121 /* condition, and if one exists, respond to the error */
122 /* (by outputting diagnostic messages, for example). Next, */
123 /* a call to RESET can be made. After resetting the */
124 /* error status, the normal execution thread can be resumed. */
125
126 /* It is also appropriate to call this routine when the error */
127 /* response action is 'REPORT', if one wishes to recover */
128 /* from errors. */
129
130 /* $ Examples */
131
132 /* 1. In this example, we try to read a line from the file, */
133 /* SPUD.DAT, using the toolkit routine, RDTEXT. */
134 /* When FAILED indicates an error, we grab the short */
135 /* error message and its explanation, using GETMSG (see), */
136 /* log the messages using our user-defined routine, */
137 /* USER_LOG (NOT a SPICELIB routine), reset the */
138 /* status, and keep going. */
139
140 /* C */
141 /* C We read a line from SPUD.DAT: */
142 /* C */
143
144 /* CALL RDTEXT ( 'SPUD.DAT', LINE, EOF ) */
145
146 /* IF ( FAILED() ) THEN */
147 /* C */
148 /* C Oops! an error occurred during the read. */
149 /* C Recover the short error message and its */
150 /* C explanation, reset the error status, */
151 /* C log the messages, and continue... */
152 /* C */
153
154 /* CALL GETMSG ( 'SHORT' , SMSG ) */
155 /* CALL GETMSG ( 'EXPLAIN' , EXPL ) */
156
157 /* CALL USER_LOG ( SMSG ) */
158 /* CALL USER_LOG ( EXPL ) */
159
160 /* CALL RESET */
161
162 /* END IF */
163
164 /* $ Restrictions */
165
166 /* It can be dangerous to call this routine without */
167 /* RESPONDING to the error condition first; by calling */
168 /* RESET, you are wiping out the SPICELIB's knowledge of */
169 /* the error. */
170
171 /* $ Literature_References */
172
173 /* None. */
174
175 /* $ Author_and_Institution */
176
177 /* N.J. Bachman (JPL) */
178 /* K.R. Gehringer (JPL) */
179
180 /* $ Version */
181
182 /* - SPICELIB Version 1.1.0, 14-MAR-1996 (KRG) */
183
184 /* Removed the call to FREEZE at the end of this subroutine. */
185 /* The call had no effect other than to copy the current */
186 /* stack in the trace package from the active stack into the */
187 /* frozen stack. The frozen stack could NEVER be accessed */
188 /* after this copying action; the only time the frozen stack */
189 /* could be accessed is when a program is executing in 'RETURN' */
190 /* mode and FAILED is .TRUE., i.e. after an error has been */
191 /* signalled, causing the active stack at the time of the */
192 /* error to be copied to the frozen stack. So this copying */
193 /* of the active stack on a RESET of the error handling */
194 /* accomplishes nothing. */
195
196 /* References to the setting of the frozen traceback were */
197 /* removed from the header as well. */
198
199 /* A missing Fortran RETURN statement was also added before the */
200 /* END statement */
201
202 /* - SPICELIB Version 1.0.1, 10-MAR-1992 (WLT) */
203
204 /* Comment section for permuted index source lines was added */
205 /* following the header. */
206
207 /* - SPICELIB Version 1.0.0, 31-JAN-1990 (NJB) */
208
209 /* -& */
210 /* $ Index_Entries */
211
212 /* reset error status */
213
214 /* -& */
215
216 /* SPICELIB functions */
217
218
219 /* Local Variables: */
220
221
222 /* Executable Code: */
223
224 /* This odd-looking function reference resets the error */
225 /* status to indicate "no error": */
226
227 stat = seterr_(&c_false);
228
229 /* Wipe out the short and long error messages: */
230
231 putsms_(" ", (ftnlen)1);
232 putlms_(" ", (ftnlen)1);
233
234 /* Allow long error message to be updated: */
235
236 stat = accept_(&c_true);
237 return 0;
238 } /* reset_ */
239
240