yylex_init_extra has the same functionality as yylex_init, but follows the * convention of taking the scanner as the last argument. Note however, that * this is a *pointer* to a scanner, as it will be allocated by this call (and * is the reason, too, why this function also must handle its own declaration). * The user defined value in the first argument will be available to yyalloc in * the yy
| 2414 | * the yyextra field. |
| 2415 | */ |
| 2416 | int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals ) |
| 2417 | { |
| 2418 | struct yyguts_t dummy_yyguts; |
| 2419 | |
| 2420 | yyset_extra (yy_user_defined, &dummy_yyguts); |
| 2421 | |
| 2422 | if (ptr_yy_globals == NULL){ |
| 2423 | errno = EINVAL; |
| 2424 | return 1; |
| 2425 | } |
| 2426 | |
| 2427 | *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); |
| 2428 | |
| 2429 | if (*ptr_yy_globals == NULL){ |
| 2430 | errno = ENOMEM; |
| 2431 | return 1; |
| 2432 | } |
| 2433 | |
| 2434 | /* By setting to 0xAA, we expose bugs in |
| 2435 | yy_init_globals. Leave at 0x00 for releases. */ |
| 2436 | memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); |
| 2437 | |
| 2438 | yyset_extra (yy_user_defined, *ptr_yy_globals); |
| 2439 | |
| 2440 | return yy_init_globals ( *ptr_yy_globals ); |
| 2441 | } |
| 2442 | |
| 2443 | static int yy_init_globals (yyscan_t yyscanner) |
| 2444 | { |
nothing calls this directly
no test coverage detected
searching dependent graphs…