PostGIS  2.1.10dev-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 1757 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().

1758 {
1759  YY_BUFFER_STATE b;
1760 
1761  if ( size < 2 ||
1762  base[size-2] != YY_END_OF_BUFFER_CHAR ||
1763  base[size-1] != YY_END_OF_BUFFER_CHAR )
1764  /* They forgot to leave room for the EOB's. */
1765  return 0;
1766 
1767  b = (YY_BUFFER_STATE) wkt_yyalloc(sizeof( struct yy_buffer_state ) );
1768  if ( ! b )
1769  YY_FATAL_ERROR( "out of dynamic memory in wkt_yy_scan_buffer()" );
1770 
1771  b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1772  b->yy_buf_pos = b->yy_ch_buf = base;
1773  b->yy_is_our_buffer = 0;
1774  b->yy_input_file = 0;
1775  b->yy_n_chars = b->yy_buf_size;
1776  b->yy_is_interactive = 0;
1777  b->yy_at_bol = 1;
1778  b->yy_fill_buffer = 0;
1780 
1782 
1783  return b;
1784 }
struct yy_buffer_state * YY_BUFFER_STATE
Definition: lwin_wkt_lex.c:172
yy_size_t yy_n_chars
Definition: lwin_wkt_lex.c:223
#define YY_BUFFER_NEW
Definition: lwin_wkt_lex.c:254
#define YY_END_OF_BUFFER_CHAR
Definition: lwin_wkt_lex.c:159
#define YY_FATAL_ERROR(msg)
Definition: lwin_wkt_lex.c:816
FILE * yy_input_file
Definition: lwin_wkt_lex.c:210
yy_size_t yy_buf_size
Definition: lwin_wkt_lex.c:218
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: