Skip to content

Commit

Permalink
hds: More status checking tweaks to wrapper
Browse files Browse the repository at this point in the history
and now call hdsGtune_v4 last for now. Needs proper thought on
cross version tuning.
  • Loading branch information
timj committed Oct 31, 2014
1 parent 4a56e62 commit 882dfcc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions libraries/hds/hds_select.c
Expand Up @@ -2775,6 +2775,7 @@ hdsFlush(const char *group_str, int *status) {
hdsFlush_v5(group_str, status);
if (*status == DAT__GRPIN) emsAnnul(status);
hdsFlush_v4(group_str, status);
HDS_CHECK_STATUS("hdsFlush", "(both)");
return *status;
}

Expand Down Expand Up @@ -2827,12 +2828,13 @@ hdsGtune(const char *param_str, int *value, int *status) {
int instat = *status;
EnterCheck("hdsGtune",*status);
if (*status != SAI__OK) return *status;
hdsGtune_v4(param_str, value, status);
hdsGtune_v5(param_str, value, status);
hdsGtune_v4(param_str, value, status);
if (*status != SAI__OK) {
emsRepf("hdsGtune_wrap", "hdsGtune: Error obtaining value of tuning parameter '%s'",
status, param_str);
}
HDS_CHECK_STATUS("hdsGtune", "(both)");
return *status;
}

Expand Down Expand Up @@ -2917,15 +2919,15 @@ hdsNew(const char *file_str, const char *name_str, const char *type_str, int ndi

int
hdsOpen(const char *file_str, const char *mode_str, HDSLoc **locator, int *status) {
int instat = *status;
int instat = *status;
EnterCheck("hdsOpen",*status);
if (*status != SAI__OK) return *status;
hdsOpen_v5(file_str, mode_str, locator, status);
if (*status != SAI__OK) {
emsAnnul(status);
hdsOpen_v4(file_str, mode_str, locator, status);
}
HDS_CHECK_STATUS( "hdsOpen", "(v5)" );
HDS_CHECK_STATUS( "hdsOpen", file_str);
return *status;
}

Expand Down
8 changes: 5 additions & 3 deletions libraries/hds/helper/mkhdswrapper.py
Expand Up @@ -204,27 +204,28 @@ def func_datMove(func,line):
return *status;""".format(v5,v4,func))

def func_hdsOpen(line):
print(""" int instat = *status;
print(""" int instat = *status;
EnterCheck(\"hdsOpen\",*status);
if (*status != SAI__OK) return *status;
hdsOpen_v5(file_str, mode_str, locator, status);
if (*status != SAI__OK) {
emsAnnul(status);
hdsOpen_v4(file_str, mode_str, locator, status);
}
HDS_CHECK_STATUS( "hdsOpen", "(v5)" );
HDS_CHECK_STATUS( "hdsOpen", file_str);
return *status;""")

def func_hdsGtune(line):
print(""" int instat = *status;
EnterCheck(\"hdsGtune\",*status);
if (*status != SAI__OK) return *status;
hdsGtune_v4(param_str, value, status);
hdsGtune_v5(param_str, value, status);
hdsGtune_v4(param_str, value, status);
if (*status != SAI__OK) {
emsRepf("hdsGtune_wrap", "hdsGtune: Error obtaining value of tuning parameter '%s'",
status, param_str);
}
HDS_CHECK_STATUS("hdsGtune", "(both)");
return *status;""")

def func_hdsFlush(line):
Expand All @@ -241,6 +242,7 @@ def func_hdsFlush(line):
hdsFlush_v5(group_str, status);
if (*status == DAT__GRPIN) emsAnnul(status);
hdsFlush_v4(group_str, status);
HDS_CHECK_STATUS("hdsFlush", "(both)");
return *status;""")

# Dictionary indicating special cases
Expand Down

0 comments on commit 882dfcc

Please sign in to comment.