45static char *option[N_OPTIONS] = {
50 "sddscheck <filename> [-printErrors]\n\n"
51 "This program allows you to determine whether an SDDS file has been\n"
52 "corrupted. It reads the entire file and prints a message to stdout.\n"
54 "If the file is ok, \"ok\" is printed.\n"
55 "If the file has a problem, one of the following will be printed:\n"
56 " - \"nonexistent\": The file does not exist.\n"
57 " - \"badHeader\": The file header is invalid.\n"
58 " - \"corrupted\": The file contains errors.\n"
61 " -printErrors: Deliver error messages to stderr.\n"
63 "Program by Michael Borland. (" __DATE__
" " __TIME__
", SVN revision: " SVN_VERSION
")\n";
65int main(
int argc,
char **argv) {
68 long i_arg, retval, print_errors;
76 if (!s_arg || argc < 2) {
84 for (i_arg = 1; i_arg < argc; i_arg++) {
85 if (s_arg[i_arg].arg_type == OPTION) {
87 switch (
match_string(s_arg[i_arg].list[0], option, N_OPTIONS, 0)) {
98 input = s_arg[i_arg].list[0];
SDDS (Self Describing Data Set) Data Types Definitions and Function Prototypes.
void SDDS_PrintErrors(FILE *fp, int32_t mode)
Prints recorded error messages to a specified file stream.
void SDDS_RegisterProgramName(const char *name)
Registers the executable program name for use in error messages.
void SDDS_Bomb(char *message)
Terminates the program after printing an error message and recorded errors.
void bomb(char *error, char *usage)
Reports error messages to the terminal and aborts the program.
long fexists(const char *filename)
Checks if a file exists.
long match_string(char *string, char **option, long n_options, long mode)
Matches a given string against an array of option strings based on specified modes.
int scanargs(SCANNED_ARG **scanned, int argc, char **argv)