summaryrefslogtreecommitdiff
path: root/ylib/yopt.h
diff options
context:
space:
mode:
Diffstat (limited to 'ylib/yopt.h')
-rw-r--r--ylib/yopt.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/ylib/yopt.h b/ylib/yopt.h
index e8a9949..98d969b 100644
--- a/ylib/yopt.h
+++ b/ylib/yopt.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012 Yoran Heling
+/* Copyright (c) 2012-2013 Yoran Heling
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -74,13 +74,13 @@ typedef struct {
int argsep; /* '--' found */
char **argv;
char *sh;
- yopt_opt_t *opts;
+ const yopt_opt_t *opts;
char errbuf[128];
} yopt_t;
/* opts must be an array of options, terminated with an option with val=0 */
-static inline void yopt_init(yopt_t *o, int argc, char **argv, yopt_opt_t *opts) {
+static inline void yopt_init(yopt_t *o, int argc, char **argv, const yopt_opt_t *opts) {
o->argc = argc;
o->argv = argv;
o->opts = opts;
@@ -90,7 +90,7 @@ static inline void yopt_init(yopt_t *o, int argc, char **argv, yopt_opt_t *opts)
}
-static inline yopt_opt_t *_yopt_find(yopt_opt_t *o, const char *v) {
+static inline const yopt_opt_t *_yopt_find(const yopt_opt_t *o, const char *v) {
const char *tn, *tv;
for(; o->val; o++) {
@@ -132,7 +132,7 @@ static inline int _yopt_err(yopt_t *o, char **val, const char *fmt, ...) {
* value will be in val.
*/
static inline int yopt_next(yopt_t *o, char **val) {
- yopt_opt_t *opt;
+ const yopt_opt_t *opt;
char sh[3];
*val = NULL;