File tree 1 file changed +20
-7
lines changed
1 file changed +20
-7
lines changed Original file line number Diff line number Diff line change 26
26
* Description:
27
27
* Enquire if a locator is valid, ie currently associated with an object.
28
28
29
+ * Notes:
30
+ * This fuction attempts to execute even if an error status is set on entry.
31
+
29
32
* Authors:
30
33
* TIMJ: Tim Jenness (Cornell)
31
34
* {enter_new_authors_here}
81
84
#include "hds1.h"
82
85
#include "dat1.h"
83
86
#include "hds.h"
87
+ #include "ems.h"
84
88
85
89
int
86
90
datValid (const HDSLoc * locator , hdsbool_t * valid , int * status ) {
87
- * valid = 0 ;
88
- if (* status != SAI__OK ) return * status ;
89
91
90
- if ( !locator ) return * status ;
92
+ /* Initialise the returned value */
93
+ * valid = 0 ;
94
+
95
+ /* Check a locator was supplied. */
96
+ if ( !locator ) return * status ;
97
+
98
+ /* Begin a new error reporting context */
99
+ emsBegin ( status );
100
+
101
+ /* Check the validity of the locator */
102
+ if (locator -> group_id > 0 || locator -> dataset_id > 0 ) {
103
+ if ( HANDLE_VALID (locator -> handle ) ) * valid = 1 ;
104
+ }
91
105
92
- if (locator -> group_id > 0 || locator -> dataset_id > 0 ) {
93
- if ( HANDLE_VALID (locator -> handle ) ) * valid = 1 ;
94
- }
106
+ /* End the current error reporting context */
107
+ emsEnd ( status );
95
108
96
- return * status ;
109
+ return * status ;
97
110
}
You can’t perform that action at this time.
0 commit comments