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

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