Mercurial > hg > octave-kai > gnulib-hg
annotate lib/trim.h @ 17249:e542fd46ad6f
maint: update all copyright year number ranges
Run "make update-copyright". Compare to commit 1602f0a from last year.
Signed-off-by: Eric Blake <eblake@redhat.com>
author | Eric Blake <eblake@redhat.com> |
---|---|
date | Tue, 01 Jan 2013 00:50:58 +0000 (2013-01-01) |
parents | 8250f2777afc |
children |
rev | line source |
---|---|
7258
448f74ab8f39
New 'trim' module, from Davide Angelocola <davide.angelocola@tiscali.it>.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1 /* Removes leading and/or trailing whitespaces |
17249
e542fd46ad6f
maint: update all copyright year number ranges
Eric Blake <eblake@redhat.com>
parents:
16201
diff
changeset
|
2 Copyright (C) 2006, 2009-2013 Free Software Foundation, Inc. |
7258
448f74ab8f39
New 'trim' module, from Davide Angelocola <davide.angelocola@tiscali.it>.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3 |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
7258
diff
changeset
|
4 This program is free software: you can redistribute it and/or modify |
7258
448f74ab8f39
New 'trim' module, from Davide Angelocola <davide.angelocola@tiscali.it>.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5 it under the terms of the GNU General Public License as published by |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
7258
diff
changeset
|
6 the Free Software Foundation; either version 3 of the License, or |
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
7258
diff
changeset
|
7 (at your option) any later version. |
7258
448f74ab8f39
New 'trim' module, from Davide Angelocola <davide.angelocola@tiscali.it>.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
8 |
448f74ab8f39
New 'trim' module, from Davide Angelocola <davide.angelocola@tiscali.it>.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
9 This program is distributed in the hope that it will be useful, |
448f74ab8f39
New 'trim' module, from Davide Angelocola <davide.angelocola@tiscali.it>.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
10 but WITHOUT ANY WARRANTY; without even the implied warranty of |
448f74ab8f39
New 'trim' module, from Davide Angelocola <davide.angelocola@tiscali.it>.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
448f74ab8f39
New 'trim' module, from Davide Angelocola <davide.angelocola@tiscali.it>.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
12 GNU General Public License for more details. |
448f74ab8f39
New 'trim' module, from Davide Angelocola <davide.angelocola@tiscali.it>.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
13 |
448f74ab8f39
New 'trim' module, from Davide Angelocola <davide.angelocola@tiscali.it>.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
14 You should have received a copy of the GNU General Public License |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
7258
diff
changeset
|
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
7258
448f74ab8f39
New 'trim' module, from Davide Angelocola <davide.angelocola@tiscali.it>.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
16 |
448f74ab8f39
New 'trim' module, from Davide Angelocola <davide.angelocola@tiscali.it>.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
17 /* Written by Davide Angelocola <davide.angelocola@gmail.com> */ |
448f74ab8f39
New 'trim' module, from Davide Angelocola <davide.angelocola@tiscali.it>.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
18 |
448f74ab8f39
New 'trim' module, from Davide Angelocola <davide.angelocola@tiscali.it>.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
19 /* Trim mode. */ |
448f74ab8f39
New 'trim' module, from Davide Angelocola <davide.angelocola@tiscali.it>.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
20 #define TRIM_TRAILING 0 |
448f74ab8f39
New 'trim' module, from Davide Angelocola <davide.angelocola@tiscali.it>.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
21 #define TRIM_LEADING 1 |
448f74ab8f39
New 'trim' module, from Davide Angelocola <davide.angelocola@tiscali.it>.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
22 #define TRIM_BOTH 2 |
448f74ab8f39
New 'trim' module, from Davide Angelocola <davide.angelocola@tiscali.it>.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
23 |
448f74ab8f39
New 'trim' module, from Davide Angelocola <davide.angelocola@tiscali.it>.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
24 /* Removes trailing and leading whitespaces. */ |
12845
ad16dedc2e1d
removing useless parentheses in cpp #define directives
Jim Meyering <meyering@redhat.com>
parents:
12559
diff
changeset
|
25 #define trim(s) trim2(s, TRIM_BOTH) |
7258
448f74ab8f39
New 'trim' module, from Davide Angelocola <davide.angelocola@tiscali.it>.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
26 |
448f74ab8f39
New 'trim' module, from Davide Angelocola <davide.angelocola@tiscali.it>.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
27 /* Removes trailing whitespaces. */ |
12845
ad16dedc2e1d
removing useless parentheses in cpp #define directives
Jim Meyering <meyering@redhat.com>
parents:
12559
diff
changeset
|
28 #define trim_trailing(s) trim2(s, TRIM_TRAILING) |
7258
448f74ab8f39
New 'trim' module, from Davide Angelocola <davide.angelocola@tiscali.it>.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
29 |
448f74ab8f39
New 'trim' module, from Davide Angelocola <davide.angelocola@tiscali.it>.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
30 /* Removes leading whitespaces. */ |
12845
ad16dedc2e1d
removing useless parentheses in cpp #define directives
Jim Meyering <meyering@redhat.com>
parents:
12559
diff
changeset
|
31 #define trim_leading(s) trim2(s, TRIM_LEADING) |
7258
448f74ab8f39
New 'trim' module, from Davide Angelocola <davide.angelocola@tiscali.it>.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
32 |
13051 | 33 char *trim2 (const char *, int); |