Mercurial > hg > octave-lojdl > gnulib-hg
annotate lib/dirname.h @ 17464:290d581e2e24
autoupdate
author | Karl Berry <karl@freefriends.org> |
---|---|
date | Sat, 10 Aug 2013 07:10:55 -0700 |
parents | e542fd46ad6f |
children |
rev | line source |
---|---|
4397
c6450308f123
Assume C89, so PARAMS isn't needed.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4347
diff
changeset
|
1 /* Take file names apart into directory and base names. |
c6450308f123
Assume C89, so PARAMS isn't needed.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4347
diff
changeset
|
2 |
17249
e542fd46ad6f
maint: update all copyright year number ranges
Eric Blake <eblake@redhat.com>
parents:
16201
diff
changeset
|
3 Copyright (C) 1998, 2001, 2003-2006, 2009-2013 Free Software Foundation, |
12559
c2cbabec01dd
update nearly all FSF copyright year lists to include 2010
Jim Meyering <meyering@redhat.com>
parents:
12421
diff
changeset
|
4 Inc. |
1561 | 5 |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
7727
diff
changeset
|
6 This program is free software: you can redistribute it and/or modify |
1561 | 7 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:
7727
diff
changeset
|
8 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:
7727
diff
changeset
|
9 (at your option) any later version. |
1561 | 10 |
11 This program is distributed in the hope that it will be useful, | |
12 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 GNU General Public License for more details. | |
15 | |
16 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:
7727
diff
changeset
|
17 along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
1561 | 18 |
19 #ifndef DIRNAME_H_ | |
20 # define DIRNAME_H_ 1 | |
21 | |
5120 | 22 # include <stdbool.h> |
4347
df44e79ce676
.h files should stand alone, but we shouldn't include <sys/types.h>
Paul Eggert <eggert@cs.ucla.edu>
parents:
3246
diff
changeset
|
23 # include <stddef.h> |
14393
9f47f8c334f2
dirname: move m4/dos.m4 functionality into lib/dosname.h
Paul Eggert <eggert@cs.ucla.edu>
parents:
14079
diff
changeset
|
24 # include "dosname.h" |
4347
df44e79ce676
.h files should stand alone, but we shouldn't include <sys/types.h>
Paul Eggert <eggert@cs.ucla.edu>
parents:
3246
diff
changeset
|
25 |
3246
cb4b1284059f
(DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN): New macros.
Jim Meyering <jim@meyering.net>
parents:
3037
diff
changeset
|
26 # ifndef DIRECTORY_SEPARATOR |
cb4b1284059f
(DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN): New macros.
Jim Meyering <jim@meyering.net>
parents:
3037
diff
changeset
|
27 # define DIRECTORY_SEPARATOR '/' |
cb4b1284059f
(DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN): New macros.
Jim Meyering <jim@meyering.net>
parents:
3037
diff
changeset
|
28 # endif |
cb4b1284059f
(DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN): New macros.
Jim Meyering <jim@meyering.net>
parents:
3037
diff
changeset
|
29 |
6912 | 30 # ifndef DOUBLE_SLASH_IS_DISTINCT_ROOT |
7727
9711a2d74170
* lib/dirname.h (DOUBLE_SLASH_IS_DISTINCT_ROOT): Default to 0, not 1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6912
diff
changeset
|
31 # define DOUBLE_SLASH_IS_DISTINCT_ROOT 0 |
6912 | 32 # endif |
33 | |
12212
8bf6ff9a34bd
dirname: split into dirname-lgpl
Eric Blake <ebb9@byu.net>
parents:
12067
diff
changeset
|
34 # if GNULIB_DIRNAME |
5907 | 35 char *base_name (char const *file); |
12212
8bf6ff9a34bd
dirname: split into dirname-lgpl
Eric Blake <ebb9@byu.net>
parents:
12067
diff
changeset
|
36 char *dir_name (char const *file); |
8bf6ff9a34bd
dirname: split into dirname-lgpl
Eric Blake <ebb9@byu.net>
parents:
12067
diff
changeset
|
37 # endif |
8bf6ff9a34bd
dirname: split into dirname-lgpl
Eric Blake <ebb9@byu.net>
parents:
12067
diff
changeset
|
38 |
12067
c1ef4ce880fc
dirname: add library-safe mdir_name
Eric Blake <ebb9@byu.net>
parents:
9309
diff
changeset
|
39 char *mdir_name (char const *file); |
16128
6beadb731202
mark functions with const and pure attributes
Jim Meyering <meyering@redhat.com>
parents:
14393
diff
changeset
|
40 size_t base_len (char const *file) _GL_ATTRIBUTE_PURE; |
6beadb731202
mark functions with const and pure attributes
Jim Meyering <meyering@redhat.com>
parents:
14393
diff
changeset
|
41 size_t dir_len (char const *file) _GL_ATTRIBUTE_PURE; |
6beadb731202
mark functions with const and pure attributes
Jim Meyering <meyering@redhat.com>
parents:
14393
diff
changeset
|
42 char *last_component (char const *file) _GL_ATTRIBUTE_PURE; |
3246
cb4b1284059f
(DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN): New macros.
Jim Meyering <jim@meyering.net>
parents:
3037
diff
changeset
|
43 |
5907 | 44 bool strip_trailing_slashes (char *file); |
1561 | 45 |
46 #endif /* not DIRNAME_H_ */ |