Blame gettext-runtime/gnulib-lib/trim.h

Packit Bot 06c835
/* Removes leading and/or trailing whitespaces
Packit Bot 06c835
   Copyright (C) 2006, 2009-2015 Free Software Foundation, Inc.
Packit Bot 06c835
Packit Bot 06c835
   This program is free software: you can redistribute it and/or modify
Packit Bot 06c835
   it under the terms of the GNU General Public License as published by
Packit Bot 06c835
   the Free Software Foundation; either version 3 of the License, or
Packit Bot 06c835
   (at your option) any later version.
Packit Bot 06c835
Packit Bot 06c835
   This program is distributed in the hope that it will be useful,
Packit Bot 06c835
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Bot 06c835
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Bot 06c835
   GNU General Public License for more details.
Packit Bot 06c835
Packit Bot 06c835
   You should have received a copy of the GNU General Public License
Packit Bot 06c835
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
Packit Bot 06c835
Packit Bot 06c835
/* Written by Davide Angelocola <davide.angelocola@gmail.com> */
Packit Bot 06c835
Packit Bot 06c835
/* Trim mode. */
Packit Bot 06c835
#define TRIM_TRAILING 0
Packit Bot 06c835
#define TRIM_LEADING 1
Packit Bot 06c835
#define TRIM_BOTH 2
Packit Bot 06c835
Packit Bot 06c835
/* Removes trailing and leading whitespaces. */
Packit Bot 06c835
#define trim(s) trim2(s, TRIM_BOTH)
Packit Bot 06c835
Packit Bot 06c835
/* Removes trailing whitespaces. */
Packit Bot 06c835
#define trim_trailing(s) trim2(s, TRIM_TRAILING)
Packit Bot 06c835
Packit Bot 06c835
/* Removes leading whitespaces. */
Packit Bot 06c835
#define trim_leading(s) trim2(s, TRIM_LEADING)
Packit Bot 06c835
Packit Bot 06c835
char *trim2 (const char *, int);