MCPcopy Create free account
hub / github.com/Entware/Entware / yypush_buffer_state

Function yypush_buffer_state

scripts/config/lexer.lex.c:3557–3581  ·  view source on GitHub ↗

Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. * */

Source from the content-addressed store, hash-verified

3555 *
3556 */
3557void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
3558{
3559 if (new_buffer == NULL)
3560 return;
3561
3562 yyensure_buffer_stack();
3563
3564 /* This block is copied from yy_switch_to_buffer. */
3565 if ( YY_CURRENT_BUFFER )
3566 {
3567 /* Flush out information for old buffer. */
3568 *(yy_c_buf_p) = (yy_hold_char);
3569 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
3570 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
3571 }
3572
3573 /* Only push if top exists. Otherwise, replace top. */
3574 if (YY_CURRENT_BUFFER)
3575 (yy_buffer_stack_top)++;
3576 YY_CURRENT_BUFFER_LVALUE = new_buffer;
3577
3578 /* copied from yy_switch_to_buffer. */
3579 yy_load_buffer_state( );
3580 (yy_did_buffer_switch_on_eof) = 1;
3581}
3582
3583/** Removes and deletes the top of the stack, if present.
3584 * The next element becomes the new top.

Callers

nothing calls this directly

Calls 2

yyensure_buffer_stackFunction · 0.85
yy_load_buffer_stateFunction · 0.85

Tested by

no test coverage detected