PostGIS  2.3.6-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 1835 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().

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