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

Function ap_expr_yy_scan_bytes

server/util_expr_scan.c:2259–2287  ·  view source on GitHub ↗

Setup the input buffer state to scan the given bytes. The next call to ap_expr_yylex() will * scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */

Source from the content-addressed store, hash-verified

2257 * @return the newly allocated buffer state object.
2258 */
2259YY_BUFFER_STATE ap_expr_yy_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
2260{
2261 YY_BUFFER_STATE b;
2262 char *buf;
2263 yy_size_t n;
2264 int i;
2265
2266 /* Get memory for full buffer, including space for trailing EOB's. */
2267 n = _yybytes_len + 2;
2268 buf = (char *) ap_expr_yyalloc(n ,yyscanner );
2269 if ( ! buf )
2270 YY_FATAL_ERROR( "out of dynamic memory in ap_expr_yy_scan_bytes()" );
2271
2272 for ( i = 0; i < _yybytes_len; ++i )
2273 buf[i] = yybytes[i];
2274
2275 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2276
2277 b = ap_expr_yy_scan_buffer(buf,n ,yyscanner);
2278 if ( ! b )
2279 YY_FATAL_ERROR( "bad buffer in ap_expr_yy_scan_bytes()" );
2280
2281 /* It's okay to grow etc. this buffer, and we should throw it
2282 * away when we're done.
2283 */
2284 b->yy_is_our_buffer = 1;
2285
2286 return b;
2287}
2288
2289 static void yy_push_state (int new_state , yyscan_t yyscanner)
2290{

Callers 1

ap_expr_yy_scan_stringFunction · 0.85

Calls 2

ap_expr_yyallocFunction · 0.85
ap_expr_yy_scan_bufferFunction · 0.85

Tested by

no test coverage detected