diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-07-05 00:47:12 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-07-05 00:47:12 +0400 |
commit | 9f22750422940681dba14839a762c6f8bf02dba6 (patch) | |
tree | 66678d732a1271433f0890efd9ae3d856b892b8e /source/blender/blenlib | |
parent | 21bf13989f0a38d56dbe98334e9503623a976ea2 (diff) |
style cleanup
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_args.h | 25 | ||||
-rw-r--r-- | source/blender/blenlib/intern/BLI_args.c | 18 |
2 files changed, 32 insertions, 11 deletions
diff --git a/source/blender/blenlib/BLI_args.h b/source/blender/blenlib/BLI_args.h index 7a240e0e08a..6758fa399a4 100644 --- a/source/blender/blenlib/BLI_args.h +++ b/source/blender/blenlib/BLI_args.h @@ -36,18 +36,31 @@ struct bArgs; typedef struct bArgs bArgs; -/* returns the number of extra arguments consumed by the function. 0 is normal value, -1 stops parsing arguments, other negative indicates skip */ +/** + * Returns the number of extra arguments consumed by the function. + * - 0 is normal value, + * - -1 stops parsing arguments, other negative indicates skip + */ 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); -/* pass starts at 1, -1 means valid all the time +/** + * 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, int pass, 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, int pass, const char *short_arg, int short_case, const char *long_arg, int long_case, const char *doc, BA_ArgCallback cb, void *data); + */ +void BLI_argsAdd(struct bArgs *ba, int pass, + 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, int pass, + 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); diff --git a/source/blender/blenlib/intern/BLI_args.c b/source/blender/blenlib/intern/BLI_args.c index 785c9f9f32b..22b93948512 100644 --- a/source/blender/blenlib/intern/BLI_args.c +++ b/source/blender/blenlib/intern/BLI_args.c @@ -173,7 +173,8 @@ static bArgDoc *internalDocs(struct bArgs *ba, const char *short_arg, const char return d; } -static void internalAdd(struct bArgs *ba, const char *arg, int pass, int case_str, BA_ArgCallback cb, void *data, bArgDoc *d) +static void internalAdd(struct bArgs *ba, const char *arg, int pass, + int case_str, BA_ArgCallback cb, void *data, bArgDoc *d) { bArgument *a; bAKey *key; @@ -182,8 +183,10 @@ static void internalAdd(struct bArgs *ba, const char *arg, int pass, int case_st if (a) { printf("WARNING: conflicting argument\n"); - printf("\ttrying to add '%s' on pass %i, %scase sensitive\n", arg, pass, case_str == 1 ? "not " : ""); - printf("\tconflict with '%s' on pass %i, %scase sensitive\n\n", a->key->arg, (int)a->key->pass, a->key->case_str == 1 ? "not " : ""); + printf("\ttrying to add '%s' on pass %i, %scase sensitive\n", + arg, pass, case_str == 1 ? "not " : ""); + printf("\tconflict with '%s' on pass %i, %scase sensitive\n\n", + a->key->arg, (int)a->key->pass, a->key->case_str == 1 ? "not " : ""); } a = MEM_callocN(sizeof(bArgument), "bArgument"); @@ -201,7 +204,10 @@ static void internalAdd(struct bArgs *ba, const char *arg, int pass, int case_st BLI_ghash_insert(ba->items, key, a); } -void BLI_argsAddCase(struct bArgs *ba, int pass, const char *short_arg, int short_case, const char *long_arg, int long_case, const char *doc, BA_ArgCallback cb, void *data) +void BLI_argsAddCase(struct bArgs *ba, int pass, + 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); @@ -214,7 +220,9 @@ void BLI_argsAddCase(struct bArgs *ba, int pass, const char *short_arg, int shor } -void BLI_argsAdd(struct bArgs *ba, int pass, const char *short_arg, const char *long_arg, const char *doc, BA_ArgCallback cb, void *data) +void BLI_argsAdd(struct bArgs *ba, int pass, + const char *short_arg, const char *long_arg, + const char *doc, BA_ArgCallback cb, void *data) { BLI_argsAddCase(ba, pass, short_arg, 0, long_arg, 0, doc, cb, data); } |