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

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

Here is the call graph for this function:

Here is the caller graph for this function: