diff --git a/projects/VC7.1/.gitignore b/projects/VC7.1/.gitignore new file mode 100644 index 00000000..facabccc --- /dev/null +++ b/projects/VC7.1/.gitignore @@ -0,0 +1,3 @@ +terragear.ncb +terragear.suo +*.user diff --git a/projects/VC7.1/Terra/.gitignore b/projects/VC7.1/Terra/.gitignore new file mode 100644 index 00000000..0f3a6b1b --- /dev/null +++ b/projects/VC7.1/Terra/.gitignore @@ -0,0 +1,2 @@ +Debug +Release diff --git a/projects/VC7.1/Terra/Terra.vcproj b/projects/VC7.1/Terra/Terra.vcproj new file mode 100644 index 00000000..7d229c7b --- /dev/null +++ b/projects/VC7.1/Terra/Terra.vcproj @@ -0,0 +1,206 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/projects/VC7.1/deminfo/.gitignore b/projects/VC7.1/deminfo/.gitignore new file mode 100644 index 00000000..0f3a6b1b --- /dev/null +++ b/projects/VC7.1/deminfo/.gitignore @@ -0,0 +1,2 @@ +Debug +Release diff --git a/projects/VC7.1/deminfo/deminfo.vcproj b/projects/VC7.1/deminfo/deminfo.vcproj new file mode 100644 index 00000000..50a29054 --- /dev/null +++ b/projects/VC7.1/deminfo/deminfo.vcproj @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/projects/VC7.1/e00lines/.gitignore b/projects/VC7.1/e00lines/.gitignore new file mode 100644 index 00000000..0f3a6b1b --- /dev/null +++ b/projects/VC7.1/e00lines/.gitignore @@ -0,0 +1,2 @@ +Debug +Release diff --git a/projects/VC7.1/e00lines/e00lines.vcproj b/projects/VC7.1/e00lines/e00lines.vcproj new file mode 100644 index 00000000..480e460d --- /dev/null +++ b/projects/VC7.1/e00lines/e00lines.vcproj @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/projects/VC7.1/fillvoids/.gitignore b/projects/VC7.1/fillvoids/.gitignore new file mode 100644 index 00000000..0f3a6b1b --- /dev/null +++ b/projects/VC7.1/fillvoids/.gitignore @@ -0,0 +1,2 @@ +Debug +Release diff --git a/projects/VC7.1/gshhs/.gitignore b/projects/VC7.1/gshhs/.gitignore new file mode 100644 index 00000000..0f3a6b1b --- /dev/null +++ b/projects/VC7.1/gshhs/.gitignore @@ -0,0 +1,2 @@ +Debug +Release diff --git a/projects/VC7.1/gshhs/gshhs.vcproj b/projects/VC7.1/gshhs/gshhs.vcproj new file mode 100644 index 00000000..5173d304 --- /dev/null +++ b/projects/VC7.1/gshhs/gshhs.vcproj @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/projects/VC7.1/noaa-decode/.gitignore b/projects/VC7.1/noaa-decode/.gitignore new file mode 100644 index 00000000..0f3a6b1b --- /dev/null +++ b/projects/VC7.1/noaa-decode/.gitignore @@ -0,0 +1,2 @@ +Debug +Release diff --git a/projects/VC7.1/noaa-decode/noaa-decode.vcproj b/projects/VC7.1/noaa-decode/noaa-decode.vcproj new file mode 100644 index 00000000..131fa478 --- /dev/null +++ b/projects/VC7.1/noaa-decode/noaa-decode.vcproj @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/projects/VC7.1/raw2ascii/.gitignore b/projects/VC7.1/raw2ascii/.gitignore new file mode 100644 index 00000000..0f3a6b1b --- /dev/null +++ b/projects/VC7.1/raw2ascii/.gitignore @@ -0,0 +1,2 @@ +Debug +Release diff --git a/projects/VC7.1/raw2ascii/raw2ascii.vcproj b/projects/VC7.1/raw2ascii/raw2ascii.vcproj new file mode 100644 index 00000000..056a7037 --- /dev/null +++ b/projects/VC7.1/raw2ascii/raw2ascii.vcproj @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/projects/VC7.1/shape-decode/.gitignore b/projects/VC7.1/shape-decode/.gitignore new file mode 100644 index 00000000..0f3a6b1b --- /dev/null +++ b/projects/VC7.1/shape-decode/.gitignore @@ -0,0 +1,2 @@ +Debug +Release diff --git a/projects/VC7.1/shape-decode/shape-decode.vcproj b/projects/VC7.1/shape-decode/shape-decode.vcproj new file mode 100644 index 00000000..88dd7a98 --- /dev/null +++ b/projects/VC7.1/shape-decode/shape-decode.vcproj @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/projects/VC7.1/tgvpf/.gitignore b/projects/VC7.1/tgvpf/.gitignore new file mode 100644 index 00000000..0f3a6b1b --- /dev/null +++ b/projects/VC7.1/tgvpf/.gitignore @@ -0,0 +1,2 @@ +Debug +Release diff --git a/projects/VC7.1/tgvpf/tgvpf.vcproj b/projects/VC7.1/tgvpf/tgvpf.vcproj new file mode 100644 index 00000000..5ec03238 --- /dev/null +++ b/projects/VC7.1/tgvpf/tgvpf.vcproj @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Prep/Terra/XGetopt.c b/src/Prep/Terra/XGetopt.c new file mode 100644 index 00000000..cf1e1fcd --- /dev/null +++ b/src/Prep/Terra/XGetopt.c @@ -0,0 +1,199 @@ +// XGetopt.cpp Version 1.1 +// +// Author: Hans Dietrich +// hdietrich2@hotmail.com +// +// Modified: David Smith +// dave.s@earthcorp.com +// Moved two char declarations from body of function so +// that it can compile as a C function. +// Thanks so much Hans +// +// This software is released into the public domain. +// You are free to use it in any way you like. +// +// This software is provided "as is" with no expressed +// or implied warranty. I accept no liability for any +// damage or loss of business that this software may cause. +// +/////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include "XGetopt.h" + +/////////////////////////////////////////////////////////////////////////////// +// +// X G e t o p t . c p p +// +// +// NAME +// getopt -- parse command line options +// +// SYNOPSIS +// int getopt(int argc, char *argv[], char *optstring) +// +// extern char *optarg; +// extern int optind; +// +// DESCRIPTION +// The getopt() function parses the command line arguments. Its +// arguments argc and argv are the argument count and array as +// passed into the application on program invocation. In the case +// of Visual C++ programs, argc and argv are available via the +// variables __argc and __argv (double underscores), respectively. +// getopt returns the next option letter in argv that matches a +// letter in optstring. +// +// optstring is a string of recognized option letters; if a letter +// is followed by a colon, the option is expected to have an argument +// that may or may not be separated from it by white space. optarg +// is set to point to the start of the option argument on return from +// getopt. +// +// Option letters may be combined, e.g., "-ab" is equivalent to +// "-a -b". Option letters are case sensitive. +// +// getopt places in the external variable optind the argv index +// of the next argument to be processed. optind is initialized +// to 0 before the first call to getopt. +// +// When all options have been processed (i.e., up to the first +// non-option argument), getopt returns EOF, optarg will point +// to the argument, and optind will be set to the argv index of +// the argument. If there are no non-option arguments, optarg +// will be set to NULL. +// +// The special option "--" may be used to delimit the end of the +// options; EOF will be returned, and "--" (and everything after it) +// will be skipped. +// +// RETURN VALUE +// For option letters contained in the string optstring, getopt +// will return the option letter. getopt returns a question mark (?) +// when it encounters an option letter not included in optstring. +// EOF is returned when processing is finished. +// +// BUGS +// 1) Long options are not supported. +// 2) The GNU double-colon extension is not supported. +// 3) The environment variable POSIXLY_CORRECT is not supported. +// 4) The + syntax is not supported. +// 5) The automatic permutation of arguments is not supported. +// 6) This implementation of getopt() returns EOF if an error is +// encountered, instead of -1 as the latest standard requires. +// +// EXAMPLE +// BOOL CMyApp::ProcessCommandLine(int argc, char *argv[]) +// { +// int c; +// +// while ((c = getopt(argc, argv, "aBn:")) != EOF) +// { +// switch (c) +// { +// case 'a': +// TRACE(_T("option a\n")); +// // +// // set some flag here +// // +// break; +// +// case 'B': +// TRACE( _T("option B\n")); +// // +// // set some other flag here +// // +// break; +// +// case 'n': +// TRACE(_T("option n: value=%d\n"), atoi(optarg)); +// // +// // do something with value here +// // +// break; +// +// case '?': +// TRACE(_T("ERROR: illegal option %s\n"), argv[optind-1]); +// return FALSE; +// break; +// +// default: +// TRACE(_T("WARNING: no handler for option %c\n"), c); +// return FALSE; +// break; +// } +// } +// // +// // check for non-option args here +// // +// return TRUE; +// } +// +/////////////////////////////////////////////////////////////////////////////// + +char *optarg; // global argument pointer +int optind = 0; // global argv index + +int getopt(int argc, char *argv[], const char *optstring) +{ + static char *next = NULL; + char c, *cp; + if (optind == 0) + next = NULL; + + optarg = NULL; + + if (next == NULL || *next == '\0') + { + if (optind == 0) + optind++; + + if (optind >= argc || argv[optind][0] != '-' || argv[optind][1] == '\0') + { + optarg = NULL; + if (optind < argc) + optarg = argv[optind]; + return EOF; + } + + if (strcmp(argv[optind], "--") == 0) + { + optind++; + optarg = NULL; + if (optind < argc) + optarg = argv[optind]; + return EOF; + } + + next = argv[optind]+1; + optind++; + } + + c = *next++; + cp = strchr(optstring, c); + + if (cp == NULL || c == ':') + return '?'; + + cp++; + if (*cp == ':') + { + if (*next != '\0') + { + optarg = next; + next = NULL; + } + else if (optind < argc) + { + optarg = argv[optind]; + optind++; + } + else + { + return '?'; + } + } + + return c; +} diff --git a/src/Prep/Terra/XGetopt.h b/src/Prep/Terra/XGetopt.h new file mode 100644 index 00000000..21f2588b --- /dev/null +++ b/src/Prep/Terra/XGetopt.h @@ -0,0 +1,31 @@ +// XGetopt.h +// +// Author: Hans Dietrich +// hdietrich2@hotmail.com +// +// This software is released into the public domain. +// You are free to use it in any way you like. +// +// This software is provided "as is" with no expressed +// or implied warranty. I accept no liability for any +// damage or loss of business that this software may cause. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef XGETOPT_H +#define XGETOPT_H + +#ifdef __cplusplus +extern "C" { +#endif + +extern int optind, opterr; +extern char *optarg; + +int getopt(int argc, char *argv[], const char *optstring); + +#ifdef __cplusplus +} +#endif + +#endif //XGETOPT_H