Lely core libraries 2.3.4
|
This file is part of the C11 and POSIX compatibility library. More...
#include "libc.h"
#include <lely/libc/unistd.h>
#include <assert.h>
#include <stddef.h>
#include <stdio.h>
Go to the source code of this file.
Functions | |
int | getopt (int argc, char *const argv[], const char *optstring) |
Parses options passed as arguments to main() . | |
Variables | |
static int | optoff |
The offset (in characters) of the next option with respect to the beginning of the current option argument. | |
This file is part of the C11 and POSIX compatibility library.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Definition in file getopt.c.
int getopt | ( | int | argc, |
char *const | argv[], | ||
const char * | optstring | ||
) |
Parses options passed as arguments to main()
.
argc | the argument count as passed to main() . |
argv | the argument array as passed to main() . |
optstring | a pointer to a string of recognized option characters; if a character is followed by a colon, the option takes an argument. If the first character is a colon, this function returns ':' instead of '?' when a missing argument is detected and does not print a diagnostic message (regardless of the value of opterr). |