PostGIS  2.5.0dev-r@@SVN_REVISION@@
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.

Parameters
basethe character buffer
sizethe size in bytes of the character buffer
Returns
the newly allocated buffer state object.

Definition at line 1785 of file lwin_wkt_lex.c.

References wkt_yy_switch_to_buffer(), wkt_yyalloc(), yy_buffer_state::yy_at_bol, yy_buffer_state::yy_buf_pos, yy_buffer_state::yy_buf_size, YY_BUFFER_NEW, yy_buffer_state::yy_buffer_status, yy_buffer_state::yy_ch_buf, YY_END_OF_BUFFER_CHAR, YY_FATAL_ERROR, yy_buffer_state::yy_fill_buffer, yy_buffer_state::yy_input_file, yy_buffer_state::yy_is_interactive, yy_buffer_state::yy_is_our_buffer, and yy_buffer_state::yy_n_chars.

Referenced by wkt_yy_scan_bytes().

1786 {
1787  YY_BUFFER_STATE b;
1788 
1789  if ( size < 2 ||
1790  base[size-2] != YY_END_OF_BUFFER_CHAR ||
1791  base[size-1] != YY_END_OF_BUFFER_CHAR )
1792  /* They forgot to leave room for the EOB's. */
1793  return 0;
1794 
1795  b = (YY_BUFFER_STATE) wkt_yyalloc(sizeof( struct yy_buffer_state ) );
1796  if ( ! b )
1797  YY_FATAL_ERROR( "out of dynamic memory in wkt_yy_scan_buffer()" );
1798 
1799  b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1800  b->yy_buf_pos = b->yy_ch_buf = base;
1801  b->yy_is_our_buffer = 0;
1802  b->yy_input_file = 0;
1803  b->yy_n_chars = b->yy_buf_size;
1804  b->yy_is_interactive = 0;
1805  b->yy_at_bol = 1;
1806  b->yy_fill_buffer = 0;
1808 
1810 
1811  return b;
1812 }
struct yy_buffer_state * YY_BUFFER_STATE
Definition: lwin_wkt_lex.c:198
yy_size_t yy_n_chars
Definition: lwin_wkt_lex.c:249
#define YY_BUFFER_NEW
Definition: lwin_wkt_lex.c:280
#define YY_END_OF_BUFFER_CHAR
Definition: lwin_wkt_lex.c:185
#define YY_FATAL_ERROR(msg)
Definition: lwin_wkt_lex.c:844
FILE * yy_input_file
Definition: lwin_wkt_lex.c:236
yy_size_t yy_buf_size
Definition: lwin_wkt_lex.c:244
void wkt_yy_switch_to_buffer(YY_BUFFER_STATE new_buffer)
Switch to a different input buffer.
void * wkt_yyalloc(yy_size_t)

Here is the call graph for this function:

Here is the caller graph for this function: