diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-11-06 02:29:06 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-11-06 04:32:54 +0300 |
commit | 548b3516479b478653b4eb074bbdcea535c4071f (patch) | |
tree | 017ac590b6df3fc579ac55dfacf09e7935502e67 /source/blender | |
parent | c8f2ad0ab96dfe1f34b91ccd20d0002944010ca3 (diff) |
Cleanup: use snake case for BLI_args API
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenlib/BLI_args.h | 44 | ||||
-rw-r--r-- | source/blender/blenlib/intern/BLI_args.c | 46 |
2 files changed, 45 insertions, 45 deletions
diff --git a/source/blender/blenlib/BLI_args.h b/source/blender/blenlib/BLI_args.h index ebf88ea69f5..b12b7ff5d1e 100644 --- a/source/blender/blenlib/BLI_args.h +++ b/source/blender/blenlib/BLI_args.h @@ -38,41 +38,41 @@ typedef struct bArgs bArgs; */ typedef int (*BA_ArgCallback)(int argc, const char **argv, void *data); -struct bArgs *BLI_argsInit(int argc, const char **argv); -void BLI_argsFree(struct bArgs *ba); +struct bArgs *BLI_args_create(int argc, const char **argv); +void BLI_args_destroy(struct bArgs *ba); -/** The pass to use for #BLI_argsAdd. */ -void BLI_argsPassSet(struct bArgs *ba, int current_pass); +/** The pass to use for #BLI_args_add. */ +void BLI_args_pass_set(struct bArgs *ba, int current_pass); /** * Pass starts at 1, -1 means valid all the time * short_arg or long_arg can be null to specify no short or long versions */ -void BLI_argsAdd(struct bArgs *ba, - const char *short_arg, - const char *long_arg, - const char *doc, - BA_ArgCallback cb, - void *data); +void BLI_args_add(struct bArgs *ba, + const char *short_arg, + const char *long_arg, + const char *doc, + BA_ArgCallback cb, + void *data); /** * Short_case and long_case specify if those arguments are case specific */ -void BLI_argsAddCase(struct bArgs *ba, - const char *short_arg, - int short_case, - const char *long_arg, - int long_case, - const char *doc, - BA_ArgCallback cb, - void *data); +void BLI_args_add_case(struct bArgs *ba, + const char *short_arg, + int short_case, + const char *long_arg, + int long_case, + const char *doc, + BA_ArgCallback cb, + void *data); -void BLI_argsParse(struct bArgs *ba, int pass, BA_ArgCallback default_cb, void *data); +void BLI_args_parse(struct bArgs *ba, int pass, BA_ArgCallback default_cb, void *data); -void BLI_argsPrintArgDoc(struct bArgs *ba, const char *arg); -void BLI_argsPrintOtherDoc(struct bArgs *ba); +void BLI_args_print_arg_doc(struct bArgs *ba, const char *arg); +void BLI_args_print_other_doc(struct bArgs *ba); -void BLI_argsPrint(struct bArgs *ba); +void BLI_args_print(struct bArgs *ba); #ifdef __cplusplus } diff --git a/source/blender/blenlib/intern/BLI_args.c b/source/blender/blenlib/intern/BLI_args.c index 2f1571d4ea1..3d4521a3304 100644 --- a/source/blender/blenlib/intern/BLI_args.c +++ b/source/blender/blenlib/intern/BLI_args.c @@ -111,7 +111,7 @@ static bArgument *lookUp(struct bArgs *ba, const char *arg, int pass, int case_s return BLI_ghash_lookup(ba->items, &key); } -bArgs *BLI_argsInit(int argc, const char **argv) +bArgs *BLI_args_create(int argc, const char **argv) { bArgs *ba = MEM_callocN(sizeof(bArgs), "bArgs"); ba->passes = MEM_callocN(sizeof(int) * argc, "bArgs passes"); @@ -120,13 +120,13 @@ bArgs *BLI_argsInit(int argc, const char **argv) ba->argc = argc; ba->argv = argv; - /* Must be initialized by #BLI_argsPassSet. */ + /* Must be initialized by #BLI_args_pass_set. */ ba->current_pass = 0; return ba; } -void BLI_argsFree(struct bArgs *ba) +void BLI_args_destroy(struct bArgs *ba) { BLI_ghash_free(ba->items, MEM_freeN, MEM_freeN); MEM_freeN(ba->passes); @@ -134,13 +134,13 @@ void BLI_argsFree(struct bArgs *ba) MEM_freeN(ba); } -void BLI_argsPassSet(struct bArgs *ba, int current_pass) +void BLI_args_pass_set(struct bArgs *ba, int current_pass) { BLI_assert((current_pass != 0) && (current_pass >= -1)); ba->current_pass = current_pass; } -void BLI_argsPrint(struct bArgs *ba) +void BLI_args_print(struct bArgs *ba) { int i; for (i = 0; i < ba->argc; i++) { @@ -206,14 +206,14 @@ static void internalAdd( BLI_ghash_insert(ba->items, key, a); } -void BLI_argsAddCase(struct bArgs *ba, - const char *short_arg, - int short_case, - const char *long_arg, - int long_case, - const char *doc, - BA_ArgCallback cb, - void *data) +void BLI_args_add_case(struct bArgs *ba, + const char *short_arg, + int short_case, + const char *long_arg, + int long_case, + const char *doc, + BA_ArgCallback cb, + void *data) { bArgDoc *d = internalDocs(ba, short_arg, long_arg, doc); @@ -226,14 +226,14 @@ void BLI_argsAddCase(struct bArgs *ba, } } -void BLI_argsAdd(struct bArgs *ba, - const char *short_arg, - const char *long_arg, - const char *doc, - BA_ArgCallback cb, - void *data) +void BLI_args_add(struct bArgs *ba, + const char *short_arg, + const char *long_arg, + const char *doc, + BA_ArgCallback cb, + void *data) { - BLI_argsAddCase(ba, short_arg, 0, long_arg, 0, doc, cb, data); + BLI_args_add_case(ba, short_arg, 0, long_arg, 0, doc, cb, data); } static void internalDocPrint(bArgDoc *d) @@ -251,7 +251,7 @@ static void internalDocPrint(bArgDoc *d) printf(" %s\n\n", d->documentation); } -void BLI_argsPrintArgDoc(struct bArgs *ba, const char *arg) +void BLI_args_print_arg_doc(struct bArgs *ba, const char *arg) { bArgument *a = lookUp(ba, arg, -1, -1); @@ -264,7 +264,7 @@ void BLI_argsPrintArgDoc(struct bArgs *ba, const char *arg) } } -void BLI_argsPrintOtherDoc(struct bArgs *ba) +void BLI_args_print_other_doc(struct bArgs *ba) { bArgDoc *d; @@ -275,7 +275,7 @@ void BLI_argsPrintOtherDoc(struct bArgs *ba) } } -void BLI_argsParse(struct bArgs *ba, int pass, BA_ArgCallback default_cb, void *default_data) +void BLI_args_parse(struct bArgs *ba, int pass, BA_ArgCallback default_cb, void *default_data) { BLI_assert((pass != 0) && (pass >= -1)); int i = 0; |