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

Function yylex_init

Source/LexerParser/cmListFileLexer.c:2389–2407  ·  view source on GitHub ↗

yylex_init is special because it creates the scanner itself, so it is * the ONLY reentrant function that doesn't take the scanner as the last argument. * That's why we explicitly handle the declaration, instead of using our macros. */

Source from the content-addressed store, hash-verified

2387 * That's why we explicitly handle the declaration, instead of using our macros.
2388 */
2389int yylex_init(yyscan_t* ptr_yy_globals)
2390{
2391 if (ptr_yy_globals == NULL){
2392 errno = EINVAL;
2393 return 1;
2394 }
2395
2396 *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );
2397
2398 if (*ptr_yy_globals == NULL){
2399 errno = ENOMEM;
2400 return 1;
2401 }
2402
2403 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
2404 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2405
2406 return yy_init_globals ( *ptr_yy_globals );
2407}
2408
2409/* yylex_init_extra has the same functionality as yylex_init, but follows the
2410 * convention of taking the scanner as the last argument. Note however, that

Callers

nothing calls this directly

Calls 2

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…