|
Layers
Diffusion in heterogeneous environments
|
Extra functions that are useful for fit-layer. More...

Go to the source code of this file.
Functions | |
| void | error (char *errorstring,...) |
| Print an error message to stderr and exit with status EXIT_FAILURE. More... | |
| void | print_usage_fit_layer (char *program) |
| Print usage message and exit with status EXIT_FAILURE. More... | |
| void | check_filename (char *in, char *out) |
| Make sure that the filename is not too long. More... | |
| double * | create_array (int N, char *string) |
| Create an array of doubles of the specified size. More... | |
| int | assemble_command (int argc, char *argv[], char *command) |
| Create a string containing the command used to run the program. More... | |
Extra functions that are useful for fit-layer.
Definition in file extras.c.
| int assemble_command | ( | int | argc, |
| char * | argv[], | ||
| char * | command | ||
| ) |
Create a string containing the command used to run the program.
It can be very useful for the program's output file to have a comment line that contains the command used to run the program. This function assembles that command into a string from the argc and argv parameters so it can be added to the output file.
| [in] | argc | Argument count (parameter passed to main) |
| [in] | argv | Argument vector (parameter passed to main) |
| [out] | command | String containing the command line |
Definition at line 154 of file extras.c.

| void check_filename | ( | char * | in, |
| char * | out | ||
| ) |
Make sure that the filename is not too long.
If the input string is not to big, copy it to the output string. Otherwise, exit with an error message. This function is used to check that the user input filename is not too long.
| [in] | in | Input string = the user input filename (or base filename) |
| [out] | out | Output string = the input string, if not too long |
Definition at line 103 of file extras.c.


| double* create_array | ( | int | N, |
| char * | string | ||
| ) |
Create an array of doubles of the specified size.
Also initialize the array to all 0.
| [in] | N | Number of elements in array |
| [in] | string | String containing a description of the array (for debugging purposes) |
Definition at line 124 of file extras.c.

| void error | ( | char * | errorstring, |
| ... | |||
| ) |
1.8.11