FreeBSD/contrib/subversion/subversion/libsvn_subr/skel.c
/* Parse an atom with explicit length --- one that starts with a byte
   length, as a decimal ASCII number.  */
Parse an atom with explicit length --- one that starts with a byte
length, as a decimal ASCII number.
Parse an atom with explicit length --- one that starts with a byte length as a decimal ASCII number .
static svn_skel_t *
explicit_atom(const char *data,
              apr_size_t len,
              apr_pool_t *pool)
{
  const char *end = data + len;
  const char *next;
  apr_size_t size;
  svn_skel_t *s;
  size = getsize(data, end - data, &next, end - data);
  data = next;
  if (! data)
    return NULL;
  if (data >= end || skel_char_type[(unsigned char) *data] != type_space)
    return NULL;
  data++;
  if (data + size > end)
    return NULL;
  s = apr_pcalloc(pool, sizeof(*s));
  s->is_atom = TRUE;
  s->data = data;
  s->len = size;
  return s;
}
static svn_skel_t * explicit_atom ( const char * data , apr_size_t len , apr_pool_t * pool ) { const char * end = data + len ; const char * next ; apr_size_t size ; svn_skel_t * s ; size = getsize ( data , end - data , & next , end - data ) ; data = next ; if ( ! data ) return NULL ; if ( data >= end || skel_char_type [ ( unsigned char ) * data ] != type_space ) return NULL ; data ++ ; if ( data + size > end ) return NULL ; s = apr_pcalloc ( pool , sizeof ( * s ) ) ; s -> is_atom = TRUE ; s -> data = data ; s -> len = size ; return s ; }
Parse an atom with explicit length --- one that starts with a byte
length, as a decimal ASCII number.
Parse an atom with explicit length --- one that starts with a byte length as a decimal ASCII number .
/* Parse the length.  */ /* Exit if we overflowed, or there wasn't a valid number there.  */ /* Skip the whitespace character after the length.  */ /* Check the length.  */ /* Allocate the skel representing this string.  */