Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions treeshr/TreeGetSetShotId.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,17 @@ int WriteShotId(char * filename, int shot, int mode)
return status;
}

// On error returns 0 (a non-MDSplus error viewed as failure by the status macros)
int TreeGetCurrentShotId(char const *experiment)
{
int shot = 0;
int status = TreeFAILURE;
char experiment_lower[16] = {0};
size_t slen;
char * pathlist = TreePath(experiment, experiment_lower);
if (pathlist == NULL) {
return 0;
}
char * filename;
char * saveptr = NULL;
char * path = strtok_r(pathlist, TREE_PATH_LIST_DELIM, &saveptr);
Expand Down