PostGIS  2.2.7dev-r@@SVN_REVISION@@
YY_BUFFER_STATE wkt_yy_scan_bytes ( yyconst char *  yybytes,
yy_size_t  _yybytes_len 
)

Setup the input buffer state to scan the given bytes.

The next call to wkt_yylex() will scan from a copy of bytes.

Parameters
yybytesthe byte buffer to scan
_yybytes_lenthe number of bytes in the buffer pointed to by bytes.
Returns
the newly allocated buffer state object.

Definition at line 1810 of file lwin_wkt_lex.c.

References wkt_yy_scan_buffer(), wkt_yyalloc(), YY_END_OF_BUFFER_CHAR, YY_FATAL_ERROR, and yy_buffer_state::yy_is_our_buffer.

Referenced by wkt_yy_scan_string().

1811 {
1812  YY_BUFFER_STATE b;
1813  char *buf;
1814  yy_size_t n;
1815  int i;
1816 
1817  /* Get memory for full buffer, including space for trailing EOB's. */
1818  n = _yybytes_len + 2;
1819  buf = (char *) wkt_yyalloc(n );
1820  if ( ! buf )
1821  YY_FATAL_ERROR( "out of dynamic memory in wkt_yy_scan_bytes()" );
1822 
1823  for ( i = 0; i < _yybytes_len; ++i )
1824  buf[i] = yybytes[i];
1825 
1826  buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1827 
1828  b = wkt_yy_scan_buffer(buf,n );
1829  if ( ! b )
1830  YY_FATAL_ERROR( "bad buffer in wkt_yy_scan_bytes()" );
1831 
1832  /* It's okay to grow etc. this buffer, and we should throw it
1833  * away when we're done.
1834  */
1835  b->yy_is_our_buffer = 1;
1836 
1837  return b;
1838 }
size_t yy_size_t
Definition: lwin_wkt_lex.c:178
#define YY_END_OF_BUFFER_CHAR
Definition: lwin_wkt_lex.c:160
#define YY_FATAL_ERROR(msg)
Definition: lwin_wkt_lex.c:819
YY_BUFFER_STATE wkt_yy_scan_buffer(char *base, yy_size_t size)
Setup the input buffer state to scan directly from a user-specified character buffer.
void * wkt_yyalloc(yy_size_t)

Here is the call graph for this function:

Here is the caller graph for this function: