~ubuntu-branches/ubuntu/utopic/coreutils/utopic-proposed

« back to all changes in this revision

Viewing changes to lib/canonicalize.h

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2012-11-28 03:03:42 UTC
  • mfrom: (8.3.4 sid)
  • Revision ID: package-import@ubuntu.com-20121128030342-21zanj8354gas5gr
Tags: 8.20-3ubuntu1
* Resynchronise with Debian.  Remaining changes:
  - Make 'uname -i -p' return the real processor/hardware, instead of
    unknown.
  - Build-depend on gettext:any instead of on gettext, so that apt-get can
    properly resolve build-dependencies on the tool when cross-building.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* Return the canonical absolute name of a given file.
2
 
   Copyright (C) 1996-2007, 2009-2011 Free Software Foundation, Inc.
 
2
   Copyright (C) 1996-2007, 2009-2012 Free Software Foundation, Inc.
3
3
 
4
4
   This program is free software: you can redistribute it and/or modify
5
5
   it under the terms of the GNU General Public License as published by
19
19
 
20
20
#include <stdlib.h> /* for canonicalize_file_name */
21
21
 
 
22
#define CAN_MODE_MASK (CAN_EXISTING | CAN_ALL_BUT_LAST | CAN_MISSING)
 
23
 
22
24
enum canonicalize_mode_t
23
25
  {
24
26
    /* All components must exist.  */
28
30
    CAN_ALL_BUT_LAST = 1,
29
31
 
30
32
    /* No requirements on components existence.  */
31
 
    CAN_MISSING = 2
 
33
    CAN_MISSING = 2,
 
34
 
 
35
    /* Don't expand symlinks.  */
 
36
    CAN_NOLINKS = 4
32
37
  };
33
38
typedef enum canonicalize_mode_t canonicalize_mode_t;
34
39
 
35
 
/* Return a malloc'd string containing the canonical absolute name of
36
 
   the named file.  This acts like canonicalize_file_name, except that
37
 
   whether components must exist depends on the canonicalize_mode_t
38
 
   argument.  */
 
40
/* Return the canonical absolute name of file NAME, while treating
 
41
   missing elements according to CAN_MODE.  A canonical name
 
42
   does not contain any `.', `..' components nor any repeated file name
 
43
   separators ('/') or, depending on other CAN_MODE flags, symlinks.
 
44
   Whether components must exist or not depends on canonicalize mode.
 
45
   The result is malloc'd.  */
39
46
char *canonicalize_filename_mode (const char *, canonicalize_mode_t);
40
47
 
41
48
#endif /* !CANONICALIZE_H_ */