29 if (strlen(in) < (FILENAME_MAX - 4))
32 error(
"Filename length is too long");
60 void get_io_filenames(
char *argstring,
const char *inf_extension,
const char *outf_extension,
char *infilename,
char *outfilename)
65 strcpy(outfilename, infilename);
67 strng = index(outfilename,
'.');
69 strcat(infilename, inf_extension);
70 strcat(outfilename, outf_extension);
72 strcpy(strng, outf_extension);
95 strcpy(command,argv[0]);
97 length=strlen(argv[0]) + 1;
98 for (i=1; i<argc; i++) {
99 length += strlen(argv[i]) + 1;
101 printf(
"Warning: length of command too long to put in struct \n");
102 strcat(command,
"...");
105 strcat(command, argv[i]);
106 strcat(command,
" ");
158 token = strtok(NULL,
" ,");
160 error(
"Cannot read %s token; nsource = %d\n",
string, nsource);
double read_source_parameter(char *string, int nsource)
Read a parameter from the string argument to the additional_sources option.
void get_io_filenames(char *argstring, const char *inf_extension, const char *outf_extension, char *infilename, char *outfilename)
Determine the input filename and the default output file name.
void get_filename(char *in, char *out)
Make sure that the filename is not too long.
int assemble_command(int argc, char *argv[], char *command)
Create a string containing the command used to run the program.