PostGIS  2.2.7dev-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 1760 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().

1761 {
1762  YY_BUFFER_STATE b;
1763 
1764  if ( size < 2 ||
1765  base[size-2] != YY_END_OF_BUFFER_CHAR ||
1766  base[size-1] != YY_END_OF_BUFFER_CHAR )
1767  /* They forgot to leave room for the EOB's. */
1768  return 0;
1769 
1770  b = (YY_BUFFER_STATE) wkt_yyalloc(sizeof( struct yy_buffer_state ) );
1771  if ( ! b )
1772  YY_FATAL_ERROR( "out of dynamic memory in wkt_yy_scan_buffer()" );
1773 
1774  b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1775  b->yy_buf_pos = b->yy_ch_buf = base;
1776  b->yy_is_our_buffer = 0;
1777  b->yy_input_file = 0;
1778  b->yy_n_chars = b->yy_buf_size;
1779  b->yy_is_interactive = 0;
1780  b->yy_at_bol = 1;
1781  b->yy_fill_buffer = 0;
1783 
1785 
1786  return b;
1787 }
struct yy_buffer_state * YY_BUFFER_STATE
Definition: lwin_wkt_lex.c:173
yy_size_t yy_n_chars
Definition: lwin_wkt_lex.c:224
#define YY_BUFFER_NEW
Definition: lwin_wkt_lex.c:255
#define YY_END_OF_BUFFER_CHAR
Definition: lwin_wkt_lex.c:160
#define YY_FATAL_ERROR(msg)
Definition: lwin_wkt_lex.c:819
FILE * yy_input_file
Definition: lwin_wkt_lex.c:211
yy_size_t yy_buf_size
Definition: lwin_wkt_lex.c:219
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: