pike.git / src / builtin_functions.c

version» Context lines:

pike.git/src/builtin_functions.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: builtin_functions.c,v 1.537 2004/04/06 15:37:54 nilsson Exp $ + || $Id: builtin_functions.c,v 1.538 2004/04/12 00:27:38 per Exp $   */      #include "global.h" - RCSID("$Id: builtin_functions.c,v 1.537 2004/04/06 15:37:54 nilsson Exp $"); + RCSID("$Id: builtin_functions.c,v 1.538 2004/04/12 00:27:38 per Exp $");   #include "interpret.h"   #include "svalue.h"   #include "pike_macros.h"   #include "object.h"   #include "program.h"   #include "array.h"   #include "pike_error.h"   #include "constants.h"   #include "mapping.h"   #include "stralloc.h"
pike.git/src/builtin_functions.c:400:    } else {    hi = mid;    }    }    return(cache = (struct case_info *)case_info + lo);   }      #define DO_LOWER_CASE(C) do {\    INT32 c = C; \    struct case_info *ci = find_ci(c); \ +  if(c<128){if(c >= 'A' && c <= 'Z' ) C=c+0x20;}else {\    if (ci) { \    switch(ci->mode) { \    case CIM_NONE: case CIM_LOWERDELTA: break; \    case CIM_UPPERDELTA: C = c + ci->data; break; \    case CIM_CASEBIT: C = c | ci->data; break; \    case CIM_CASEBITOFF: C = ((c - ci->data) | ci->data) + ci->data; break; \    default: Pike_fatal("lower_case(): Unknown case_info mode: %d\n", ci->mode); \    } \ -  } \ +  }} \    } while(0)      #define DO_LOWER_CASE_SHIFT0(C) do {\    INT32 c = C; \ -  +  if(c<128){if(c >= 'A' && c <= 'Z' ) C=c+0x20;}else {\    struct case_info *ci = find_ci_shift0(c); \    if (ci) { \    switch(ci->mode) { \    case CIM_NONE: case CIM_LOWERDELTA: break; \    case CIM_UPPERDELTA: C = c + ci->data; break; \    case CIM_CASEBIT: C = c | ci->data; break; \    case CIM_CASEBITOFF: C = ((c - ci->data) | ci->data) + ci->data; break; \    default: Pike_fatal("lower_case(): Unknown case_info mode: %d\n", ci->mode); \    } \ -  } \ +  }} \    } while(0)      #define DO_UPPER_CASE(C) do {\    INT32 c = C; \ -  +  if(c<128){if(c >= 'a' && c <= 'z' ) C=c-0x20;}else {\    struct case_info *ci = find_ci(c); \    if (ci) { \    switch(ci->mode) { \    case CIM_NONE: case CIM_UPPERDELTA: break; \    case CIM_LOWERDELTA: C = c - ci->data; break; \    case CIM_CASEBIT: C = c & ~ci->data; break; \    case CIM_CASEBITOFF: C = ((c - ci->data)& ~ci->data) + ci->data; break; \    default: Pike_fatal("upper_case(): Unknown case_info mode: %d\n", ci->mode); \    } \ -  } \ +  }} \    } while(0)      #define DO_UPPER_CASE_SHIFT0(C) do {\    INT32 c = C; \ -  +  if(c<128){if(c >= 'a' && c <= 'z' ) C=c-0x20;}else {\    struct case_info *ci = find_ci_shift0(c); \    if (ci) { \    switch(ci->mode) { \    case CIM_NONE: case CIM_UPPERDELTA: break; \    case CIM_LOWERDELTA: C = c - ci->data; break; \    case CIM_CASEBIT: C = c & ~ci->data; break; \    case CIM_CASEBITOFF: C = ((c - ci->data)& ~ci->data) + ci->data; break; \    default: Pike_fatal("lower_case(): Unknown case_info mode: %d\n", ci->mode); \    } \ -  } \ +  }} \    } while(0)      /*! @decl string lower_case(string s)    *! @decl int lower_case(int c)    *!    *! Convert a string or character to lower case.    *!    *! @returns    *! Returns a copy of the string @[s] with all upper case characters    *! converted to lower case, or the character @[c] converted to lower