PostGIS  2.1.10dev-r@@SVN_REVISION@@
YY_BUFFER_STATE wkt_yy_create_buffer ( FILE *  file,
int  size 
)

Allocate and initialize an input buffer state.

Parameters
fileA readable stream.
sizeThe character buffer size in bytes. When in doubt, use YY_BUF_SIZE.
Returns
the allocated buffer state.

Definition at line 1555 of file lwin_wkt_lex.c.

References wkt_yy_init_buffer(), wkt_yyalloc(), yy_buffer_state::yy_buf_size, yy_buffer_state::yy_ch_buf, YY_FATAL_ERROR, and yy_buffer_state::yy_is_our_buffer.

Referenced by if(), and wkt_yyrestart().

1556 {
1557  YY_BUFFER_STATE b;
1558 
1559  b = (YY_BUFFER_STATE) wkt_yyalloc(sizeof( struct yy_buffer_state ) );
1560  if ( ! b )
1561  YY_FATAL_ERROR( "out of dynamic memory in wkt_yy_create_buffer()" );
1562 
1563  b->yy_buf_size = size;
1564 
1565  /* yy_ch_buf has to be 2 characters longer than the size given because
1566  * we need to put in 2 end-of-buffer characters.
1567  */
1568  b->yy_ch_buf = (char *) wkt_yyalloc(b->yy_buf_size + 2 );
1569  if ( ! b->yy_ch_buf )
1570  YY_FATAL_ERROR( "out of dynamic memory in wkt_yy_create_buffer()" );
1571 
1572  b->yy_is_our_buffer = 1;
1573 
1574  wkt_yy_init_buffer(b,file );
1575 
1576  return b;
1577 }
struct yy_buffer_state * YY_BUFFER_STATE
Definition: lwin_wkt_lex.c:172
#define YY_FATAL_ERROR(msg)
Definition: lwin_wkt_lex.c:816
static void wkt_yy_init_buffer(YY_BUFFER_STATE b, FILE *file)
yy_size_t yy_buf_size
Definition: lwin_wkt_lex.c:218
void * wkt_yyalloc(yy_size_t)

Here is the call graph for this function:

Here is the caller graph for this function: