Back to index

tetex-bin  3.0
Functions
absolute.c File Reference
#include <kpathsea/config.h>
#include <kpathsea/absolute.h>
#include <kpathsea/c-pathch.h>

Go to the source code of this file.

Functions

boolean kpse_absolute_p P2C (const_string, filename, boolean, relative_ok)

Function Documentation

boolean kpse_absolute_p P2C ( const_string  ,
filename  ,
boolean  ,
relative_ok   
)

Definition at line 28 of file absolute.c.

{
#ifdef VMS
#include <string.h>
  return strcspn (filename, "]>:") != strlen (filename);
#else /* not VMS */
  boolean absolute = IS_DIR_SEP (*filename)
#ifdef DOSISH
                     /* Novell allows non-alphanumeric drive letters. */
                     || (*filename && IS_DEVICE_SEP (filename[1]))
#endif /* DOSISH */
#ifdef AMIGA
                   /* Colon anywhere means a device.  */
                   || strchr (filename, ':')
#endif /* AMIGA */
                    ;
  boolean explicit_relative
    = relative_ok
#ifdef AMIGA
      /* Leading / is like `../' on Unix and DOS.  Allow Unix syntax,
         too, though, because of possible patch programs like
         `UnixDirsII' by Martin Scott.  */
      && IS_DIR_SEP (*filename) || 0
#endif /* AMIGA */
      && (*filename == '.' && (IS_DIR_SEP (filename[1])
                         || (filename[1] == '.' && IS_DIR_SEP (filename[2]))));

  /* FIXME: On UNIX an IS_DIR_SEP of any but the last character in the name
     implies relative.  */
  return absolute || explicit_relative;
#endif /* not VMS */
}

Here is the call graph for this function: