diff options
| author | Florian Fischer <florian.fl.fischer@fau.de> | 2020-05-06 16:56:32 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fl.fischer@fau.de> | 2020-06-02 11:18:47 +0200 |
| commit | 8174a918ea3b7cb216bf7ea98cfdc10661b5c37d (patch) | |
| tree | 0747ec3ccb9f8d7eeccfac35977fc17855ca3bbb /src/benchmarks/espresso/getopt.c | |
| parent | 8f52e8fc02dd235582f5961941bcd564e9a681cd (diff) | |
| download | allocbench-8174a918ea3b7cb216bf7ea98cfdc10661b5c37d.tar.gz allocbench-8174a918ea3b7cb216bf7ea98cfdc10661b5c37d.zip | |
make the whole project more python idiomatic
* rename src directory to allocbench
* make global variable names UPPERCASE
* format a lot of code using yapf
* use lowercase ld_preload and ld_library_path as Allocator members
* name expected Errors 'err' and don't raise a new Exception
* disable some pylint messages
Diffstat (limited to 'src/benchmarks/espresso/getopt.c')
| -rw-r--r-- | src/benchmarks/espresso/getopt.c | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/src/benchmarks/espresso/getopt.c b/src/benchmarks/espresso/getopt.c deleted file mode 100644 index 017c907..0000000 --- a/src/benchmarks/espresso/getopt.c +++ /dev/null @@ -1,45 +0,0 @@ -#include "espresso.h" -#include "port.h" -/* File : getopt.c - Author : Henry Spencer, University of Toronto - Updated: 28 April 1984 - Purpose: get option letter from argv. -*/ -#define NullS ((char *) 0) - -char *optarg; /* Global argument pointer. */ -int optind = 0; /* Global argv index. */ - -int getopt(int argc, char * const * argv, const char * optstring) - { - register int c; - register char *place; - static char *scan = NullS; /* Private scan pointer. */ - - optarg = NullS; - - if (scan == NullS || *scan == '\0') { - if (optind == 0) optind++; - if (optind >= argc) return EOF; - place = argv[optind]; - if (place[0] != '-' || place[1] == '\0') return EOF; - optind++; - if (place[1] == '-' && place[2] == '\0') return EOF; - scan = place+1; - } - - c = *scan++; - place = strchr(optstring, c); - if (place == NullS || c == ':') { - fprintf(stderr, "%s: unknown option %c\n", argv[0], c); - return '?'; - } - if (*++place == ':') { - if (*scan != '\0') { - optarg = scan, scan = NullS; - } else { - optarg = argv[optind], optind++; - } - } - return c; - } |
