diff options
author | allen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2000-09-19 23:39:36 +0000 |
---|---|---|
committer | allen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2000-09-19 23:39:36 +0000 |
commit | bd552587325969ba6032eb8260314ea1854ad9a0 (patch) | |
tree | 669d42a14f9baf5653981b6d97e5cc143697122e /src/main/ProcessCommandLine.c | |
parent | fc3a1d5ff1931ece60c5d070917078d1fb6a3ed2 (diff) |
Added CCTK_ParameterFilename
At the moment this will return the <dir>/<filename> , the arguments
of this call will change in the next couple of days to return the
directory and filename as separate arguments
git-svn-id: http://svn.cactuscode.org/flesh/trunk@1827 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/main/ProcessCommandLine.c')
-rw-r--r-- | src/main/ProcessCommandLine.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/main/ProcessCommandLine.c b/src/main/ProcessCommandLine.c index 7ed8a131..8521e725 100644 --- a/src/main/ProcessCommandLine.c +++ b/src/main/ProcessCommandLine.c @@ -17,6 +17,8 @@ static char *rcsid = "$Header$"; CCTK_FILEVERSION(main_ProcessCommandLine_c) +static char *parameter_file_name=NULL; + static int argc; static char **argv; @@ -94,6 +96,7 @@ int CCTKi_ProcessCommandLine(int *inargc, char ***inargv, tFleshConfig *ConfigDa if(argc > optind) { ConfigData->parameter_file_name = argv[optind]; + parameter_file_name = ConfigData->parameter_file_name; } else { @@ -131,3 +134,27 @@ int CCTK_CommandLine(char ***outargv) return argc; } + + + /*@@ + @routine CCTK_CommandLine + @date Wed Feb 17 00:19:30 1999 + @author Tom Goodale + @desc + Gets the command line arguments. + @enddesc + @calls + @calledby + @history + + @endhistory + +@@*/ +int CCTK_ParameterFilename(int len, char *filename) +{ + int retval; + strncpy(filename,parameter_file_name,len-1); + retval = strlen(filename); + retval=retval > len ? 0 : retval; + return retval; +} |