3 #ifndef __CPROVER_STRING_H_INCLUDED
5 #define __CPROVER_STRING_H_INCLUDED
14 int _getopt(
int argc,
char *
const argv[],
const char *optstring)
24 char *
const arg = argv[
optind];
25 if(arg[0] !=
'-' || arg[1] ==
'\0' || (arg[1] ==
'-' && arg[2] ==
'\0'))
29 size_t optstring_len =
strlen(optstring);
32 __CPROVER_bool not_found = __CPROVER_forall
35 i<optstring_len ==> optstring[i] != arg[1]
44 result_index < optstring_len && optstring[result_index] == arg[1]);
45 #ifdef __CPROVER_STRING_ABSTRACTION
48 "getopt zero-termination of 3rd argument");
52 if(result_index + 1 == optstring_len || optstring[result_index + 1] !=
':')
73 return optstring[0] ==
':' ?
':' :
'?';
79 int _getopt(
int argc,
char *
const argv[],
const char *optstring);
81 int getopt(
int argc,
char *
const argv[],
const char *optstring)
84 return _getopt(argc, argv, optstring);
92 #ifndef __CPROVER_GETOPT_H_INCLUDED
94 #define __CPROVER_GETOPT_H_INCLUDED
100 const char *optstring,
101 const struct option *longopts,
111 return getopt(argc, argv, optstring);
int getopt_long(int argc, char *const argv[], const char *optstring, const struct option *longopts, int *longindex)
int getopt(int argc, char *const argv[], const char *optstring)
__CPROVER_bool __VERIFIER_nondet___CPROVER_bool(void)
size_t __VERIFIER_nondet_size_t(void)
int _getopt(int argc, char *const argv[], const char *optstring)
size_t strlen(const char *s)