Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. * @param yyscanner The scanner object. * @return the allocated buffer state. */
| 1999 | * @return the allocated buffer state. |
| 2000 | */ |
| 2001 | YY_BUFFER_STATE ap_expr_yy_create_buffer (FILE * file, int size , yyscan_t yyscanner) |
| 2002 | { |
| 2003 | YY_BUFFER_STATE b; |
| 2004 | |
| 2005 | b = (YY_BUFFER_STATE) ap_expr_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner ); |
| 2006 | if ( ! b ) |
| 2007 | YY_FATAL_ERROR( "out of dynamic memory in ap_expr_yy_create_buffer()" ); |
| 2008 | |
| 2009 | b->yy_buf_size = size; |
| 2010 | |
| 2011 | /* yy_ch_buf has to be 2 characters longer than the size given because |
| 2012 | * we need to put in 2 end-of-buffer characters. |
| 2013 | */ |
| 2014 | b->yy_ch_buf = (char *) ap_expr_yyalloc(b->yy_buf_size + 2 ,yyscanner ); |
| 2015 | if ( ! b->yy_ch_buf ) |
| 2016 | YY_FATAL_ERROR( "out of dynamic memory in ap_expr_yy_create_buffer()" ); |
| 2017 | |
| 2018 | b->yy_is_our_buffer = 1; |
| 2019 | |
| 2020 | ap_expr_yy_init_buffer(b,file ,yyscanner); |
| 2021 | |
| 2022 | return b; |
| 2023 | } |
| 2024 | |
| 2025 | /** Destroy the buffer. |
| 2026 | * @param b a buffer created with ap_expr_yy_create_buffer() |
no test coverage detected