MCPcopy Create free account
hub / github.com/apache/httpd / ap_expr_yy_create_buffer

Function ap_expr_yy_create_buffer

server/util_expr_scan.c:2001–2023  ·  view source on GitHub ↗

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. */

Source from the content-addressed store, hash-verified

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()

Callers 2

util_expr_scan.cFile · 0.85
ap_expr_yyrestartFunction · 0.85

Calls 2

ap_expr_yyallocFunction · 0.85
ap_expr_yy_init_bufferFunction · 0.85

Tested by

no test coverage detected