MCPcopy Create free account
hub / github.com/KDE/kdevelop / cmListFileLexer_SetString

Function cmListFileLexer_SetString

plugins/cmake/parser/cmListFileLexer.c:2603–2620  ·  view source on GitHub ↗

--------------------------------------------------------------------------*/

Source from the content-addressed store, hash-verified

2601
2602/*--------------------------------------------------------------------------*/
2603int cmListFileLexer_SetString(cmListFileLexer* lexer, const char* text)
2604{
2605 int result = 1;
2606 cmListFileLexerDestroy(lexer);
2607 if (text) {
2608 int length = (int)strlen(text);
2609 lexer->string_buffer = (char*)malloc(length + 1);
2610 if (lexer->string_buffer) {
2611 strcpy(lexer->string_buffer, text);
2612 lexer->string_position = lexer->string_buffer;
2613 lexer->string_left = length;
2614 } else {
2615 result = 0;
2616 }
2617 }
2618 cmListFileLexerInit(lexer);
2619 return result;
2620}
2621
2622/*--------------------------------------------------------------------------*/
2623cmListFileLexer_Token* cmListFileLexer_Scan(cmListFileLexer* lexer)

Callers

nothing calls this directly

Calls 2

cmListFileLexerDestroyFunction · 0.85
cmListFileLexerInitFunction · 0.85

Tested by

no test coverage detected