Back to index

tetex-bin  3.0
Defines | Functions
strcasecmp.c File Reference
#include "dialogconfig.h"

Go to the source code of this file.

Defines

#define toupper(c)   ((c) - 32)
#define coerce_to_upper(c)   ((islower(c) ? toupper(c) : (c)))

Functions

int strcasecmp (char *string1, char *string2)

Define Documentation

#define coerce_to_upper (   c)    ((islower(c) ? toupper(c) : (c)))

Definition at line 242 of file makeinfo.h.

#define toupper (   c)    ((c) - 32)

Definition at line 6 of file strcasecmp.c.


Function Documentation

int strcasecmp ( char *  string1,
char *  string2 
)

Definition at line 12 of file strcasecmp.c.

{
  char ch1, ch2;

  for (;;)
    {
      ch1 = *string1++;
      ch2 = *string2++;

      if (!(ch1 | ch2))
        return (0);

      ch1 = coerce_to_upper (ch1);
      ch2 = coerce_to_upper (ch2);

      if (ch1 != ch2)
        return (ch1 - ch2);
    }
}