pike.git / src / stralloc.c

version» Context lines:

pike.git/src/stralloc.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: stralloc.c,v 1.230 2008/07/18 01:42:49 mast Exp $ + || $Id: stralloc.c,v 1.231 2008/07/22 23:35:12 mast Exp $   */      #include "global.h"   #include "stralloc.h"   #include "pike_macros.h"   #include "dynamic_buffer.h"   #include "pike_macros.h"   #include "pike_memory.h"   #include "pike_error.h"   #include "gc.h"
pike.git/src/stralloc.c:3177:    PCHARP tmp;    int ret=pcharp_to_svalue_inumber(r,    MKPCHARP(str,shift),    &tmp,    base,    maxlength);    if(ptr) *(p_wchar0 **)ptr=tmp.ptr;    return ret;   }    + int safe_wide_string_to_svalue_inumber(struct svalue *r, +  void * str, +  void *ptr, +  int base, +  ptrdiff_t maxlength, +  int shift) + /* For use from the lexer where we can't let errors be thrown. */ + { +  PCHARP tmp; +  JMP_BUF recovery; +  int ret = 0; +  +  free_svalue (&throw_value); +  mark_free_svalue (&throw_value); +  +  if (SETJMP (recovery)) { +  /* We know that pcharp_to_svalue_inumber has initialized the +  * svalue before any error might be thrown. */ +  call_handle_error(); +  ret = 0; +  } +  else +  ret = pcharp_to_svalue_inumber(r, +  MKPCHARP(str,shift), +  &tmp, +  base, +  maxlength); +  UNSETJMP (recovery); +  if(ptr) *(p_wchar0 **)ptr=tmp.ptr; +  return ret; + } +    PMOD_EXPORT int pcharp_to_svalue_inumber(struct svalue *r,    PCHARP str,    PCHARP *ptr,    int base,    ptrdiff_t maxlength)   {    /* Note: Code duplication in STRTOL and STRTOL_PCHARP. */       PCHARP str_start;