Back to index

cell-binutils  2.17cvs20070401
Defines | Functions
filenames.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define IS_DIR_SEPARATOR(c)   ((c) == '/')
#define IS_ABSOLUTE_PATH(f)   (IS_DIR_SEPARATOR((f)[0]))
#define FILENAME_CMP(s1, s2)   filename_cmp(s1, s2)

Functions

int filename_cmp (const char *s1, const char *s2)

Define Documentation

#define FILENAME_CMP (   s1,
  s2 
)    filename_cmp(s1, s2)

Definition at line 50 of file filenames.h.

#define IS_ABSOLUTE_PATH (   f)    (IS_DIR_SEPARATOR((f)[0]))

Definition at line 45 of file filenames.h.

#define IS_DIR_SEPARATOR (   c)    ((c) == '/')

Definition at line 44 of file filenames.h.


Function Documentation

int filename_cmp ( const char *  s1,
const char *  s2 
)

Definition at line 46 of file filename_cmp.c.

{
#ifndef HAVE_DOS_BASED_FILE_SYSTEM
  return strcmp(s1, s2);
#else
  for (;;)
    {
      int c1 = tolower (*s1);
      int c2 = tolower (*s2);

      /* On DOS-based file systems, the '/' and the '\' are equivalent.  */
      if (c1 == '/')
        c1 = '\\';
      if (c2 == '/')
        c2 = '\\';

      if (c1 != c2)
        return (c1 - c2);

      if (c1 == '\0')
        return 0;

      s1++;
      s2++;
    }
#endif
}

Here is the call graph for this function: