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

Function ap_expr_yylex_destroy

server/util_expr_scan.c:2587–2614  ·  view source on GitHub ↗

ap_expr_yylex_destroy is for both reentrant and non-reentrant scanners. */

Source from the content-addressed store, hash-verified

2585
2586/* ap_expr_yylex_destroy is for both reentrant and non-reentrant scanners. */
2587int ap_expr_yylex_destroy (yyscan_t yyscanner)
2588{
2589 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2590
2591 /* Pop the buffer stack, destroying each element. */
2592 while(YY_CURRENT_BUFFER){
2593 ap_expr_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
2594 YY_CURRENT_BUFFER_LVALUE = NULL;
2595 ap_expr_yypop_buffer_state(yyscanner);
2596 }
2597
2598 /* Destroy the stack itself. */
2599 ap_expr_yyfree(yyg->yy_buffer_stack ,yyscanner);
2600 yyg->yy_buffer_stack = NULL;
2601
2602 /* Destroy the start condition stack. */
2603 ap_expr_yyfree(yyg->yy_start_stack ,yyscanner );
2604 yyg->yy_start_stack = NULL;
2605
2606 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2607 * ap_expr_yylex() is called, initialization will occur. */
2608 yy_init_globals( yyscanner);
2609
2610 /* Destroy the main struct (reentrant only). */
2611 ap_expr_yyfree ( yyscanner , yyscanner );
2612 yyscanner = NULL;
2613 return 0;
2614}
2615
2616/*
2617 * Internal utility routines.

Callers 1

ap_expr_parseFunction · 0.85

Calls 4

ap_expr_yy_delete_bufferFunction · 0.85
ap_expr_yyfreeFunction · 0.85
yy_init_globalsFunction · 0.85

Tested by

no test coverage detected