Former-commit-id:7fa9dbd5fb
[formerly4bfbdad17d
] [formerly9f8cb727a5
] [formerly7fa9dbd5fb
[formerly4bfbdad17d
] [formerly9f8cb727a5
] [formerly8485b90ff8
[formerly9f8cb727a5
[formerly bf53d06834caa780226121334ac1bcf0534c3f16]]]] Former-commit-id:8485b90ff8
Former-commit-id:40aa780b3d
[formerly33a67cdd82
] [formerly 73930fb29d0c1e91204e76e6ebfdbe757414f319 [formerlya28d70b5c5
]] Former-commit-id: a16a1b4dd44fc344ee709abbe262aeed58a8339b [formerlye5543a0e86
] Former-commit-id:0c25458510
66 lines
1.5 KiB
C
66 lines
1.5 KiB
C
#include "geminc.h"
|
|
#include "gemprm.h"
|
|
#include "ctbcmn.h"
|
|
|
|
extern Data_t DtTable;
|
|
extern int DtReadin;
|
|
|
|
void ctb_dtpath ( char *alias_i, char *path, int *iret )
|
|
/************************************************************************
|
|
* ctb_dtpath *
|
|
* *
|
|
* This function returns the path associated with a data alias. *
|
|
* *
|
|
* ctb_dtpath ( alias_i, path, iret ) *
|
|
* *
|
|
* Input parameters: *
|
|
* *alias_i char Alias name *
|
|
* *
|
|
* Output parameters: *
|
|
* *path char Alias path *
|
|
* *iret int Return code *
|
|
* -1 - alias not found *
|
|
** *
|
|
* Log: *
|
|
* D.W.Plummer/NCEP 3/98 Created *
|
|
* I. Durham/GSC 5/98 Changed underscore decl. to an include *
|
|
* S. Jacobs/NCEP 3/01 Added parsing of storm name from alias *
|
|
***********************************************************************/
|
|
{
|
|
int i, ipos, ier;
|
|
char alias[49];
|
|
|
|
/*---------------------------------------------------------------------*/
|
|
*iret = G_NORMAL;
|
|
|
|
if ( DtReadin == G_FALSE ) {
|
|
ctb_dtrd ( iret );
|
|
}
|
|
|
|
cst_lcuc( alias_i, alias, &ier );
|
|
|
|
/*
|
|
* Remove the name of the storm/volcano from the alias.
|
|
*/
|
|
cst_nocc ( alias, ':', 1, 0, &ipos, &ier );
|
|
if ( ier == 0 ) alias[ipos] = CHNULL;
|
|
|
|
/*
|
|
* Find a match for the alias.
|
|
*/
|
|
for ( i = 0; i < DtTable.numtmpl; i++ ) {
|
|
|
|
if ( strcmp( DtTable.info[i].alias, alias ) == 0 ) {
|
|
|
|
strcpy( path, DtTable.info[i].path );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
*iret = -1;
|
|
return;
|
|
|
|
}
|