MCPcopy Index your code
hub / github.com/MapServer/MapServer / yy_get_next_buffer

Function yy_get_next_buffer

maplexer.c:4348–4478  ·  view source on GitHub ↗

yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */

Source from the content-addressed store, hash-verified

4346 * EOB_ACT_END_OF_FILE - end of file
4347 */
4348static int yy_get_next_buffer (void)
4349{
4350 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
4351 register char *source = (yytext_ptr);
4352 register int number_to_move, i;
4353 int ret_val;
4354
4355 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
4356 YY_FATAL_ERROR(
4357 "fatal flex scanner internal error--end of buffer missed" );
4358
4359 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
4360 { /* Don't try to fill the buffer, so this is an EOF. */
4361 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
4362 {
4363 /* We matched a single character, the EOB, so
4364 * treat this as a final EOF.
4365 */
4366 return EOB_ACT_END_OF_FILE;
4367 }
4368
4369 else
4370 {
4371 /* We matched some text prior to the EOB, first
4372 * process it.
4373 */
4374 return EOB_ACT_LAST_MATCH;
4375 }
4376 }
4377
4378 /* Try to read more data. */
4379
4380 /* First move last chars to start of buffer. */
4381 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
4382
4383 for ( i = 0; i < number_to_move; ++i )
4384 *(dest++) = *(source++);
4385
4386 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
4387 /* don't do the read, it's not guaranteed to return an EOF,
4388 * just force an EOF
4389 */
4390 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
4391
4392 else
4393 {
4394 int num_to_read =
4395 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
4396
4397 while ( num_to_read <= 0 )
4398 { /* Not enough room in the buffer - grow it. */
4399
4400 /* just a shorter name for the current buffer */
4401 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
4402
4403 int yy_c_buf_p_offset =
4404 (int) ((yy_c_buf_p) - b->yy_ch_buf);
4405

Callers 2

maplexer.cFile · 0.85
inputFunction · 0.85

Calls 2

msyyreallocFunction · 0.85
msyyrestartFunction · 0.85

Tested by

no test coverage detected