exp2l: Work around a NetBSD 10.0/i386 bug.
[gnulib.git] / lib / argv-iter.h
blobd75a26416c93528701b1cb2e2bf51a04d9c419c4
1 /* Iterate over arguments from argv or --files0-from=FILE
2 Copyright (C) 2008-2024 Free Software Foundation, Inc.
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <https://www.gnu.org/licenses/>. */
17 /* This file uses _GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_PURE. */
18 #if !_GL_CONFIG_H_INCLUDED
19 #error "Please include config.h first."
20 #endif
22 #include <stdio.h>
24 /* Definition of _GL_ARG_NONNULL. */
25 #include "arg-nonnull.h"
27 struct argv_iterator;
29 enum argv_iter_err
31 AI_ERR_OK = 1,
32 AI_ERR_EOF,
33 AI_ERR_MEM,
34 AI_ERR_READ
37 void argv_iter_free (struct argv_iterator *)
38 _GL_ARG_NONNULL ((1));
40 struct argv_iterator *argv_iter_init_argv (char **argv)
41 _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_DEALLOC (argv_iter_free, 1);
42 struct argv_iterator *argv_iter_init_stream (FILE *fp)
43 _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_DEALLOC (argv_iter_free, 1);
44 char *argv_iter (struct argv_iterator *, enum argv_iter_err *)
45 _GL_ARG_NONNULL ((1, 2));
46 size_t argv_iter_n_args (struct argv_iterator const *)
47 _GL_ATTRIBUTE_PURE _GL_ARG_NONNULL ((1));