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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
Jim Meyering <jim@meyering.net>
parents:
diff changeset
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
Jim Meyering <jim@meyering.net>
parents:
diff changeset
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
Jim Meyering <jim@meyering.net>
parents:
diff changeset
10
Jim Meyering <jim@meyering.net>
parents:
diff changeset
11 This program is distributed in the hope that it will be useful,
Jim Meyering <jim@meyering.net>
parents:
diff changeset
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
Jim Meyering <jim@meyering.net>
parents:
diff changeset
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Jim Meyering <jim@meyering.net>
parents:
diff changeset
14 GNU General Public License for more details.
Jim Meyering <jim@meyering.net>
parents:
diff changeset
15
Jim Meyering <jim@meyering.net>
parents:
diff changeset
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
Jim Meyering <jim@meyering.net>
parents:
diff changeset
18
Jim Meyering <jim@meyering.net>
parents:
diff changeset
19 #ifndef DIRNAME_H_
Jim Meyering <jim@meyering.net>
parents:
diff changeset
20 # define DIRNAME_H_ 1
Jim Meyering <jim@meyering.net>
parents:
diff changeset
21
5120
47ab6ef30ad9 Include <stdbool.h>.
Paul Eggert <eggert@cs.ucla.edu>
parents: 4397
diff changeset
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
314715e0260d Merge from coreutils.
Paul Eggert <eggert@cs.ucla.edu>
parents: 5907
diff changeset
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
314715e0260d Merge from coreutils.
Paul Eggert <eggert@cs.ucla.edu>
parents: 5907
diff changeset
32 # endif
314715e0260d Merge from coreutils.
Paul Eggert <eggert@cs.ucla.edu>
parents: 5907
diff changeset
33
12212
8bf6ff9a34bd dirname: split into dirname-lgpl
Eric Blake <ebb9@byu.net>
parents: 12067
diff changeset
34 # if GNULIB_DIRNAME
5907
c47674a83a78 Sync from coreutils.
Paul Eggert <eggert@cs.ucla.edu>
parents: 5848
diff changeset
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
c47674a83a78 Sync from coreutils.
Paul Eggert <eggert@cs.ucla.edu>
parents: 5848
diff changeset
44 bool strip_trailing_slashes (char *file);
1561
Jim Meyering <jim@meyering.net>
parents:
diff changeset
45
Jim Meyering <jim@meyering.net>
parents:
diff changeset
46 #endif /* not DIRNAME_H_ */