(root)/
coreutils-9.4/
lib/
argv-iter.h
       1  /* Iterate over arguments from argv or --files0-from=FILE
       2     Copyright (C) 2008-2023 Free Software Foundation, Inc.
       3  
       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.
       8  
       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.
      13  
      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/>.  */
      16  
      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
      21  
      22  #include <stdio.h>
      23  
      24  /* Definition of _GL_ARG_NONNULL.  */
      25  #include "arg-nonnull.h"
      26  
      27  struct argv_iterator;
      28  
      29  enum argv_iter_err
      30  {
      31    AI_ERR_OK = 1,
      32    AI_ERR_EOF,
      33    AI_ERR_MEM,
      34    AI_ERR_READ
      35  };
      36  
      37  void argv_iter_free (struct argv_iterator *)
      38    _GL_ARG_NONNULL ((1));
      39  
      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));