MCPcopy Create free account
hub / github.com/Kitware/CMake / yylex_init_extra

Function yylex_init_extra

Source/LexerParser/cmListFileLexer.c:2416–2441  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

2414 * the yyextra field.
2415 */
2416int 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
2443static int yy_init_globals (yyscan_t yyscanner)
2444{

Callers

nothing calls this directly

Calls 3

yyset_extraFunction · 0.70
yyallocFunction · 0.70
yy_init_globalsFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…