Skip to content

Commit

Permalink
Remove the old optparse function; options must be specified with hyph…
Browse files Browse the repository at this point in the history
…ens.
  • Loading branch information
bonsaiviking committed Feb 20, 2018
1 parent 23d95f5 commit 01e7430
Show file tree
Hide file tree
Showing 5 changed files with 150 additions and 184 deletions.
6 changes: 0 additions & 6 deletions nbase/nbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -501,12 +501,6 @@ long parse_long(const char *s, char **tail);
in the supplied buffer. Eg: 0.122MB, 10.322Kb or 128B. */
char *format_bytecount(unsigned long long bytes, char *buf, size_t buflen);

/* Compare a canonical option name (e.g. "max-scan-delay") with a
user-generated option such as "max_scan_delay" and returns 0 if the
two values are considered equivalent (for example, - and _ are
considered to be the same), nonzero otherwise. */
int optcmp(const char *a, const char *b);

/* Convert non-printable characters to replchar in the string */
void replacenonprintable(char *str, int strlength, char replchar);

Expand Down
19 changes: 0 additions & 19 deletions nbase/nbase_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -794,25 +794,6 @@ char *format_bytecount(unsigned long long bytes, char *buf, size_t buflen) {
return buf;
}

/* Compare a canonical option name (e.g. "max-scan-delay") with a
user-generated option such as "max_scan_delay" and returns 0 if the
two values are considered equivalent (for example, - and _ are
considered to be the same), nonzero otherwise. */
int optcmp(const char *a, const char *b) {
while(*a && *b) {
if (*a == '_' || *a == '-') {
if (*b != '_' && *b != '-')
return 1;
}
else if (*a != *b)
return 1;
a++; b++;
}
if (*a || *b)
return 1;
return 0;
}

/* Returns one if the file pathname given exists, is not a directory and
* is readable by the executing process. Returns two if it is readable
* and is a directory. Otherwise returns 0. */
Expand Down
Loading

0 comments on commit 01e7430

Please sign in to comment.