~ubuntu-branches/ubuntu/raring/findutils/raring

« back to all changes in this revision

Viewing changes to gnulib/lib/dirname.h

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Metzler
  • Date: 2005-07-04 11:37:37 UTC
  • mto: (11.1.1 lenny) (1.1.10 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20050704113737-oxfumqxsqgfz5gay
Tags: upstream-4.2.22
ImportĀ upstreamĀ versionĀ 4.2.22

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*  Copyright (C) 1998, 2001 Free Software Foundation, Inc.
 
1
/*  Take file names apart into directory and base names.
 
2
 
 
3
    Copyright (C) 1998, 2001, 2003, 2004, 2005 Free Software Foundation, Inc.
2
4
 
3
5
    This program is free software; you can redistribute it and/or modify
4
6
    it under the terms of the GNU General Public License as published by
12
14
 
13
15
    You should have received a copy of the GNU General Public License
14
16
    along with this program; if not, write to the Free Software Foundation,
15
 
    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
17
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
16
18
 
17
19
#ifndef DIRNAME_H_
18
20
# define DIRNAME_H_ 1
19
21
 
20
 
# ifndef PARAMS
21
 
#  if defined PROTOTYPES || (defined __STDC__ && __STDC__)
22
 
#   define PARAMS(Args) Args
23
 
#  else
24
 
#   define PARAMS(Args) ()
25
 
#  endif
26
 
# endif
 
22
# include <stdbool.h>
 
23
# include <stddef.h>
27
24
 
28
25
# ifndef DIRECTORY_SEPARATOR
29
26
#  define DIRECTORY_SEPARATOR '/'
33
30
#  define ISSLASH(C) ((C) == DIRECTORY_SEPARATOR)
34
31
# endif
35
32
 
36
 
# ifndef FILESYSTEM_PREFIX_LEN
37
 
#  define FILESYSTEM_PREFIX_LEN(Filename) 0
 
33
# ifndef FILE_SYSTEM_PREFIX_LEN
 
34
#  define FILE_SYSTEM_PREFIX_LEN(File_name) 0
38
35
# endif
39
36
 
40
 
char *base_name PARAMS ((char const *path));
41
 
char *dir_name PARAMS ((char const *path));
42
 
size_t base_len PARAMS ((char const *path));
43
 
size_t dir_len PARAMS ((char const *path));
44
 
 
45
 
int strip_trailing_slashes PARAMS ((char *path));
 
37
# define IS_ABSOLUTE_FILE_NAME(F) ISSLASH ((F)[FILE_SYSTEM_PREFIX_LEN (F)])
 
38
# define IS_RELATIVE_FILE_NAME(F) (! IS_ABSOLUTE_FILE_NAME (F))
 
39
 
 
40
char *base_name (char const *file);
 
41
char *dir_name (char const *file);
 
42
size_t base_len (char const *file);
 
43
size_t dir_len (char const *file);
 
44
 
 
45
bool strip_trailing_slashes (char *file);
46
46
 
47
47
#endif /* not DIRNAME_H_ */