Add av1_convolve_ x,y _sse2()
[aom.git] / args.h
blobc3427bcfa39acfeae40de3d11643c903aa9b9055
1 /*
2 * Copyright (c) 2016, Alliance for Open Media. All rights reserved
4 * This source code is subject to the terms of the BSD 2 Clause License and
5 * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
6 * was not distributed with this source code in the LICENSE file, you can
7 * obtain it at www.aomedia.org/license/software. If the Alliance for Open
8 * Media Patent License 1.0 was not distributed with this source code in the
9 * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
12 #ifndef ARGS_H_
13 #define ARGS_H_
14 #include <stdio.h>
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
20 struct arg {
21 char **argv;
22 const char *name;
23 const char *val;
24 unsigned int argv_step;
25 const struct arg_def *def;
28 struct arg_enum_list {
29 const char *name;
30 int val;
32 #define ARG_ENUM_LIST_END \
33 { 0 }
35 typedef struct arg_def {
36 const char *short_name;
37 const char *long_name;
38 int has_val;
39 const char *desc;
40 const struct arg_enum_list *enums;
41 } arg_def_t;
42 #define ARG_DEF(s, l, v, d) \
43 { s, l, v, d, NULL }
44 #define ARG_DEF_ENUM(s, l, v, d, e) \
45 { s, l, v, d, e }
46 #define ARG_DEF_LIST_END \
47 { 0 }
49 struct arg arg_init(char **argv);
50 int arg_match(struct arg *arg_, const struct arg_def *def, char **argv);
51 const char *arg_next(struct arg *arg);
52 void arg_show_usage(FILE *fp, const struct arg_def *const *defs);
53 char **argv_dup(int argc, const char **argv);
55 unsigned int arg_parse_uint(const struct arg *arg);
56 int arg_parse_int(const struct arg *arg);
57 struct aom_rational arg_parse_rational(const struct arg *arg);
58 int arg_parse_enum(const struct arg *arg);
59 int arg_parse_enum_or_int(const struct arg *arg);
60 int arg_parse_list(const struct arg *arg, int *list, int n);
61 #ifdef __cplusplus
62 } // extern "C"
63 #endif
65 #endif // ARGS_H_