PostGIS  2.1.10dev-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
bytesthe byte buffer to scan
lenthe number of bytes in the buffer pointed to by bytes.
Returns
the newly allocated buffer state object.

Definition at line 1807 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().

1808 {
1809  YY_BUFFER_STATE b;
1810  char *buf;
1811  yy_size_t n, i;
1812 
1813  /* Get memory for full buffer, including space for trailing EOB's. */
1814  n = _yybytes_len + 2;
1815  buf = (char *) wkt_yyalloc(n );
1816  if ( ! buf )
1817  YY_FATAL_ERROR( "out of dynamic memory in wkt_yy_scan_bytes()" );
1818 
1819  for ( i = 0; i < _yybytes_len; ++i )
1820  buf[i] = yybytes[i];
1821 
1822  buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1823 
1824  b = wkt_yy_scan_buffer(buf,n );
1825  if ( ! b )
1826  YY_FATAL_ERROR( "bad buffer in wkt_yy_scan_bytes()" );
1827 
1828  /* It's okay to grow etc. this buffer, and we should throw it
1829  * away when we're done.
1830  */
1831  b->yy_is_our_buffer = 1;
1832 
1833  return b;
1834 }
size_t yy_size_t
Definition: lwin_wkt_lex.c:177
#define YY_END_OF_BUFFER_CHAR
Definition: lwin_wkt_lex.c:159
#define YY_FATAL_ERROR(msg)
Definition: lwin_wkt_lex.c:816
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: