pike.git / src / opcodes.c

version» Context lines:

pike.git/src/opcodes.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: opcodes.c,v 1.137 2003/02/11 15:22:28 mirar Exp $ + || $Id: opcodes.c,v 1.138 2003/02/11 16:16:01 grubba Exp $   */      #include "global.h"   #include <errno.h>   #include <math.h>   #include <ctype.h>   #include "interpret.h"   #include "svalue.h"   #include "array.h"   #include "stralloc.h"
pike.git/src/opcodes.c:23:   #include "fd_control.h"   #include "cyclic.h"   #include "builtin_functions.h"   #include "module_support.h"   #include "security.h"   #include "bignum.h"   #include "operators.h"      #define sp Pike_sp    - RCSID("$Id: opcodes.c,v 1.137 2003/02/11 15:22:28 mirar Exp $"); + RCSID("$Id: opcodes.c,v 1.138 2003/02/11 16:16:01 grubba Exp $");      void index_no_free(struct svalue *to,struct svalue *what,struct svalue *ind)   {    INT32 i;      #ifdef PIKE_SECURITY    if(what->type <= MAX_COMPLEX)    if(!CHECK_DATA_SECURITY(what->u.array, SECURITY_BIT_INDEX))    Pike_error("Index permission denied.\n");   #endif
pike.git/src/opcodes.c:856:    sp[-2]=sp[-1];    sp--;    dmalloc_touch_svalue(sp);   }         /*    * helper functions for sscanf %O    */    - static PMOD_EXPORT int pcharp_extract_char_const(PCHARP str, + static int pcharp_extract_char_const(PCHARP str,    PCHARP *dstr,    ptrdiff_t maxlength,    ptrdiff_t *dmaxlength)   {    int c;       *dstr=str; -  maxlength--; -  *dmaxlength=maxlength; +  *dmaxlength=maxlength-1;    -  switch (c=EXTRACT_PCHARP(str)) +  /* use of macros to keep similar to lexer.h: char_const */ + #define LOOK() (maxlength?INDEX_PCHARP(str,1):0) + #define GETC() (maxlength?(INC_PCHARP(str,1),maxlength--,EXTRACT_PCHARP(str)):0) +  +  switch (c=GETC())    {    case 0:    *dmaxlength=maxlength+1;    *dstr=str;    return 0;    case '\\':    return '\\';    -  /* use of macros to keep similar to lexer.h: char_const */ - #define LOOK() (maxlength?INDEX_PCHARP(str,1):0) - #define GETC() (INC_PCHARP(str,1),INDEX_PCHARP(str,0)) -  +     case '0': case '1': case '2': case '3':    case '4': case '5': case '6': case '7':    c-='0';    while(LOOK()>='0' && LOOK()<='8')    c=c*8+(GETC()-'0');    break;       case 'a': return 7; /* BEL */    case 'b': return 8; /* BS */    case 't': return 9; /* HT */
pike.git/src/opcodes.c:945:    }    break;   #undef LOOK   #undef GETC    }    *dmaxlength=maxlength;    *dstr=str;    return c;   }    - static PMOD_EXPORT int pcharp_to_svalue_procento(struct svalue *r, + static int pcharp_to_svalue_percent_o(struct svalue *r,    PCHARP str,    PCHARP *dstr,    ptrdiff_t maxlength)   {    *dstr=str; /* default: no hit */       maxlength--;   /* calling convention: max_length <= 0 means no max length. */       for (;;)
pike.git/src/opcodes.c:1964:    return matches; \    } \    } \    if(set.a) { free_array(set.a); set.a=0; } \    sval.type=T_STRING; \    DO_IF_CHECKER(sval.subtype=0); \    sval.u.string=PIKE_CONCAT(make_shared_binary_string, \    INPUT_SHIFT)(input+e,eye-e); \    break; \    \ -  case 'O': \ -  { \ +  case 'O': \ +  { \    PIKE_CONCAT(p_wchar, INPUT_SHIFT) *t; \ -  PCHARP tmp; \ -  if(eye>=input_len) \ -  { \ -  chars_matched[0]=eye; \ -  return matches; \ -  } \ +  PCHARP tmp; \ +  if(eye>=input_len) \ +  { \ +  chars_matched[0]=eye; \ +  return matches; \ +  } \    \ -  pcharp_to_svalue_procento(&sval, \ -  MKPCHARP(input+eye,INPUT_SHIFT), \ -  &tmp, \ +  pcharp_to_svalue_percent_o(&sval, \ +  MKPCHARP(input+eye,INPUT_SHIFT), \ +  &tmp, \    field_length); \ -  t=(PIKE_CONCAT(p_wchar, INPUT_SHIFT) *)tmp.ptr; \ -  if(input + eye == t) \ -  { \ -  chars_matched[0]=eye; \ -  return matches; \ -  } \ -  eye=t-input; \ +  t=(PIKE_CONCAT(p_wchar, INPUT_SHIFT) *)tmp.ptr; \ +  if(input + eye == t) \ +  { \ +  chars_matched[0]=eye; \ +  return matches; \ +  } \ +  eye=t-input; \    \ -  break; \ -  } \ +  break; \ +  } \    \    case 'n': \    sval.type=T_INT; \    sval.subtype=NUMBER_NUMBER; \    sval.u.integer=TO_INT32(eye); \    break; \    \    default: \    Pike_error("Unknown sscanf token %%%c(0x%02x)\n", \    match[cnt], match[cnt]); \