summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-01-09 14:59:49 -0500
committermidipix <writeonce@midipix.org>2016-01-09 14:59:49 -0500
commit10a51863a2213ea2909f685ca9d7da728e9fabec (patch)
treee971f6ca0f1677bdc2716695c52ebbe3550ab7de
parentd46ef90eaf604ebafb5bc6958f7d013e8e122ab0 (diff)
downloadapimagic-10a51863a2213ea2909f685ca9d7da728e9fabec.tar.bz2
apimagic-10a51863a2213ea2909f685ca9d7da728e9fabec.tar.xz
argv.h: main(): fix signatures.
-rw-r--r--include/apimagic/apimagic.h2
-rw-r--r--src/apimagic.c4
-rw-r--r--src/driver/amgc_driver_ctx.c6
-rw-r--r--src/internal/argv/argv.h18
4 files changed, 15 insertions, 15 deletions
diff --git a/include/apimagic/apimagic.h b/include/apimagic/apimagic.h
index d55d688..9263491 100644
--- a/include/apimagic/apimagic.h
+++ b/include/apimagic/apimagic.h
@@ -154,7 +154,7 @@ struct amgc_layout {
};
/* driver api */
-amgc_api int amgc_get_driver_ctx (const char ** argv, const char ** envp, uint32_t flags, struct amgc_driver_ctx **);
+amgc_api int amgc_get_driver_ctx (char ** argv, char ** envp, uint32_t flags, struct amgc_driver_ctx **);
amgc_api int amgc_create_driver_ctx (const struct amgc_common_ctx *, struct amgc_driver_ctx **);
amgc_api void amgc_free_driver_ctx (struct amgc_driver_ctx *);
diff --git a/src/apimagic.c b/src/apimagic.c
index 6d92db6..fc7e3f1 100644
--- a/src/apimagic.c
+++ b/src/apimagic.c
@@ -35,7 +35,7 @@ static int apimagic_exit(struct amgc_driver_ctx * dctx, int nerrors)
return nerrors ? 2 : 0;
}
-int apimagic_main(int argc, const char ** argv, const char ** envp)
+int apimagic_main(int argc, char ** argv, char ** envp)
{
int ret;
struct amgc_driver_ctx * dctx;
@@ -63,7 +63,7 @@ int apimagic_main(int argc, const char ** argv, const char ** envp)
#ifndef APIMAGIC_IN_A_BOX
-int main(int argc, const char ** argv, const char ** envp)
+int main(int argc, char ** argv, char ** envp)
{
return apimagic_main(argc,argv,envp);
}
diff --git a/src/driver/amgc_driver_ctx.c b/src/driver/amgc_driver_ctx.c
index 1e92e74..fe39dcc 100644
--- a/src/driver/amgc_driver_ctx.c
+++ b/src/driver/amgc_driver_ctx.c
@@ -130,8 +130,8 @@ static int amgc_init_cparser(void)
}
int amgc_get_driver_ctx(
- const char ** argv,
- const char ** envp,
+ char ** argv,
+ char ** envp,
uint32_t flags,
struct amgc_driver_ctx ** pctx)
{
@@ -228,7 +228,7 @@ int amgc_create_driver_ctx(
{
struct argv_meta * meta;
struct amgc_driver_ctx_impl * ctx;
- const char * argv[] = {"apimagic_driver",0};
+ char * argv[] = {"apimagic_driver",0};
if (!(meta = argv_get(argv,amgc_default_options,0)))
return -1;
diff --git a/src/internal/argv/argv.h b/src/internal/argv/argv.h
index 3546be6..409e9e7 100644
--- a/src/internal/argv/argv.h
+++ b/src/internal/argv/argv.h
@@ -109,12 +109,12 @@ struct argv_entry {
};
struct argv_meta {
- const char ** argv;
+ char ** argv;
struct argv_entry * entries;
};
struct argv_meta_impl {
- const char ** argv;
+ char ** argv;
char * strbuf;
struct argv_meta meta;
};
@@ -140,7 +140,7 @@ static void argv_usage(
const char * mode);
static struct argv_meta * argv_get(
- const char **,
+ char **,
const struct argv_option[],
int flags);
@@ -270,12 +270,12 @@ static inline const struct argv_option * option_from_tag(
}
static void argv_scan(
- const char ** argv,
+ char ** argv,
const struct argv_option options[],
struct argv_ctx * ctx,
struct argv_meta * meta)
{
- const char ** parg;
+ char ** parg;
const char * ch;
const char * val;
const struct argv_option * option;
@@ -566,7 +566,7 @@ static void argv_show_status(
struct argv_meta * meta)
{
int argc;
- const char ** argv;
+ char ** argv;
struct argv_entry * entry;
const struct argv_option * option;
char short_name[2] = {0};
@@ -615,10 +615,10 @@ static struct argv_meta * argv_free_impl(struct argv_meta_impl * imeta)
return 0;
}
-static struct argv_meta * argv_alloc(const char ** argv, struct argv_ctx * ctx)
+static struct argv_meta * argv_alloc(char ** argv, struct argv_ctx * ctx)
{
struct argv_meta_impl * imeta;
- const char ** vector;
+ char ** vector;
char * dst;
size_t size;
int argc;
@@ -657,7 +657,7 @@ static struct argv_meta * argv_alloc(const char ** argv, struct argv_ctx * ctx)
}
static struct argv_meta * argv_get(
- const char * argv[],
+ char * argv[],
const struct argv_option options[],
int flags)
{