PostGIS  2.5.0dev-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 1583 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().

1584 {
1585  YY_BUFFER_STATE b;
1586 
1587  b = (YY_BUFFER_STATE) wkt_yyalloc(sizeof( struct yy_buffer_state ) );
1588  if ( ! b )
1589  YY_FATAL_ERROR( "out of dynamic memory in wkt_yy_create_buffer()" );
1590 
1591  b->yy_buf_size = size;
1592 
1593  /* yy_ch_buf has to be 2 characters longer than the size given because
1594  * we need to put in 2 end-of-buffer characters.
1595  */
1596  b->yy_ch_buf = (char *) wkt_yyalloc(b->yy_buf_size + 2 );
1597  if ( ! b->yy_ch_buf )
1598  YY_FATAL_ERROR( "out of dynamic memory in wkt_yy_create_buffer()" );
1599 
1600  b->yy_is_our_buffer = 1;
1601 
1602  wkt_yy_init_buffer(b,file );
1603 
1604  return b;
1605 }
struct yy_buffer_state * YY_BUFFER_STATE
Definition: lwin_wkt_lex.c:198
#define YY_FATAL_ERROR(msg)
Definition: lwin_wkt_lex.c:844
static void wkt_yy_init_buffer(YY_BUFFER_STATE b, FILE *file)
yy_size_t yy_buf_size
Definition: lwin_wkt_lex.c:244
void * wkt_yyalloc(yy_size_t)

Here is the call graph for this function:

Here is the caller graph for this function: