PostGIS  2.5.0dev-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 1834 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().

1835 {
1836  YY_BUFFER_STATE b;
1837  char *buf;
1838  yy_size_t n;
1839  yy_size_t i;
1840 
1841  /* Get memory for full buffer, including space for trailing EOB's. */
1842  n = _yybytes_len + 2;
1843  buf = (char *) wkt_yyalloc(n );
1844  if ( ! buf )
1845  YY_FATAL_ERROR( "out of dynamic memory in wkt_yy_scan_bytes()" );
1846 
1847  for ( i = 0; i < _yybytes_len; ++i )
1848  buf[i] = yybytes[i];
1849 
1850  buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1851 
1852  b = wkt_yy_scan_buffer(buf,n );
1853  if ( ! b )
1854  YY_FATAL_ERROR( "bad buffer in wkt_yy_scan_bytes()" );
1855 
1856  /* It's okay to grow etc. this buffer, and we should throw it
1857  * away when we're done.
1858  */
1859  b->yy_is_our_buffer = 1;
1860 
1861  return b;
1862 }
size_t yy_size_t
Definition: lwin_wkt_lex.c:203
#define YY_END_OF_BUFFER_CHAR
Definition: lwin_wkt_lex.c:185
#define YY_FATAL_ERROR(msg)
Definition: lwin_wkt_lex.c:844
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: