Blender  V2.93
BLI_args.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
17  * All rights reserved.
18  */
19 
20 #pragma once
21 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 struct bArgs;
32 typedef struct bArgs bArgs;
33 
39 typedef int (*BA_ArgCallback)(int argc, const char **argv, void *data);
40 
41 struct bArgs *BLI_args_create(int argc, const char **argv);
42 void BLI_args_destroy(struct bArgs *ba);
43 
45 void BLI_args_pass_set(struct bArgs *ba, int current_pass);
46 
51 void BLI_args_add(struct bArgs *ba,
52  const char *short_arg,
53  const char *long_arg,
54  const char *doc,
55  BA_ArgCallback cb,
56  void *data);
57 
61 void BLI_args_add_case(struct bArgs *ba,
62  const char *short_arg,
63  int short_case,
64  const char *long_arg,
65  int long_case,
66  const char *doc,
67  BA_ArgCallback cb,
68  void *data);
69 
70 void BLI_args_parse(struct bArgs *ba, int pass, BA_ArgCallback default_cb, void *data);
71 
72 void BLI_args_print_arg_doc(struct bArgs *ba, const char *arg);
73 void BLI_args_print_other_doc(struct bArgs *ba);
74 
75 bool BLI_args_has_other_doc(const struct bArgs *ba);
76 
77 void BLI_args_print(struct bArgs *ba);
78 
79 #ifdef __cplusplus
80 }
81 #endif
void BLI_args_parse(struct bArgs *ba, int pass, BA_ArgCallback default_cb, void *data)
Definition: BLI_args.c:289
void BLI_args_print(struct bArgs *ba)
Definition: BLI_args.c:144
void BLI_args_destroy(struct bArgs *ba)
Definition: BLI_args.c:130
void BLI_args_print_other_doc(struct bArgs *ba)
Definition: BLI_args.c:268
void BLI_args_print_arg_doc(struct bArgs *ba, const char *arg)
Definition: BLI_args.c:255
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)
Definition: BLI_args.c:210
void BLI_args_pass_set(struct bArgs *ba, int current_pass)
Definition: BLI_args.c:138
void BLI_args_add(struct bArgs *ba, const char *short_arg, const char *long_arg, const char *doc, BA_ArgCallback cb, void *data)
Definition: BLI_args.c:230
struct bArgs * BLI_args_create(int argc, const char **argv)
Definition: BLI_args.c:115
bool BLI_args_has_other_doc(const struct bArgs *ba)
Definition: BLI_args.c:279
int(* BA_ArgCallback)(int argc, const char **argv, void *data)
Definition: BLI_args.h:39
Definition: BLI_args.c:61
int current_pass
Definition: BLI_args.c:69
const char ** argv
Definition: BLI_args.c:65
int argc
Definition: BLI_args.c:64