(root)/
gettext-0.22.4/
gettext-tools/
src/
msgl-ofn.c
       1  /* Message list test for ordinary file names.
       2     Copyright (C) 2021 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  /* Written by Bruno Haible <bruno@clisp.org>, 2021.  */
      18  
      19  
      20  #ifdef HAVE_CONFIG_H
      21  # include "config.h"
      22  #endif
      23  
      24  /* Specification.  */
      25  #include "msgl-ofn.h"
      26  
      27  #include "pos.h"
      28  
      29  
      30  bool
      31  message_has_filenames_with_spaces (message_ty *mp)
      32  {
      33    size_t n = mp->filepos_count;
      34    size_t i;
      35  
      36    for (i = 0; i < n; i++)
      37      if (pos_filename_has_spaces (&mp->filepos[i]))
      38        return true;
      39  
      40    return false;
      41  }
      42  
      43  bool
      44  message_list_has_filenames_with_spaces (message_list_ty *mlp)
      45  {
      46    size_t j;
      47  
      48    for (j = 0; j < mlp->nitems; j++)
      49      if (message_has_filenames_with_spaces (mlp->item[j]))
      50        return true;
      51  
      52    return false;
      53  }
      54  
      55  bool
      56  msgdomain_list_has_filenames_with_spaces (msgdomain_list_ty *mdlp)
      57  {
      58    size_t k;
      59  
      60    for (k = 0; k < mdlp->nitems; k++)
      61      if (message_list_has_filenames_with_spaces (mdlp->item[k]->messages))
      62        return true;
      63  
      64    return false;
      65  }