Blender V5.3
BLI_args.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
11
12#include <stdarg.h> /* For `va_list`. */
13#include <stdbool.h>
14
15#include "BLI_compiler_attrs.hh"
16
17namespace blender {
18
19struct bArgs;
20
26using BA_ArgCallback = int (*)(int argc, const char **argv, void *data);
27
28struct bArgs *BLI_args_create(int argc, const char **argv);
29void BLI_args_destroy(struct bArgs *ba);
30
31using bArgPrintFn = void (*)(void *user_data, const char *format, va_list args);
32void BLI_args_printf(struct bArgs *ba, const char *format, ...);
34 ATTR_PRINTF_FORMAT(2, 0) bArgPrintFn print_fn,
35 void *user_data);
36
38void BLI_args_pass_set(struct bArgs *ba, int current_pass);
39
44void BLI_args_add(struct bArgs *ba,
45 const char *short_arg,
46 const char *long_arg,
47 const char *doc,
49 void *data);
50
54void BLI_args_add_case(struct bArgs *ba,
55 const char *short_arg,
56 int short_case,
57 const char *long_arg,
58 int long_case,
59 const char *doc,
61 void *data);
62
63void BLI_args_parse(struct bArgs *ba, int pass, BA_ArgCallback default_cb, void *default_data);
64
65void BLI_args_print_arg_doc(struct bArgs *ba, const char *arg);
66void BLI_args_print_other_doc(struct bArgs *ba);
67
68bool BLI_args_has_other_doc(const struct bArgs *ba);
69
70void BLI_args_print(const struct bArgs *ba);
71
72} // namespace blender
BMesh Iterators.
void BLI_args_destroy(struct bArgs *ba)
Definition BLI_args.cc:147
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.cc:245
void BLI_args_print_other_doc(struct bArgs *ba)
Definition BLI_args.cc:320
BMesh const char void * data
void BLI_args_print_fn_set(struct bArgs *ba, ATTR_PRINTF_FORMAT(2, 0) bArgPrintFn print_fn, void *user_data)
void BLI_args_pass_set(struct bArgs *ba, int current_pass)
Definition BLI_args.cc:169
void(*)(void *user_data, const char *format, va_list args) bArgPrintFn
Definition BLI_args.hh:31
bool BLI_args_has_other_doc(const struct bArgs *ba)
void BLI_args_printf(struct bArgs *ba, const char *format,...)
Definition BLI_args.cc:155
size_t ATTR_PRINTF_FORMAT(3, 4)
void BLI_args_print_arg_doc(struct bArgs *ba, const char *arg)
Definition BLI_args.cc:290
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.cc:265
struct bArgs * BLI_args_create(int argc, const char **argv)
Definition BLI_args.cc:127
void BLI_args_print(const struct bArgs *ba)
int(*)(int argc, const char **argv, void *data) BA_ArgCallback
Definition BLI_args.hh:26
void BLI_args_parse(struct bArgs *ba, int pass, BA_ArgCallback default_cb, void *default_data)
Definition BLI_args.cc:339