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

Function cmListFileLexer_yy_scan_bytes

plugins/cmake/parser/cmListFileLexer.c:1995–2023  ·  view source on GitHub ↗

Setup the input buffer state to scan the given bytes. The next call to cmListFileLexer_yylex() will * scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */

Source from the content-addressed store, hash-verified

1993 * @return the newly allocated buffer state object.
1994 */
1995YY_BUFFER_STATE cmListFileLexer_yy_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
1996{
1997 YY_BUFFER_STATE b;
1998 char *buf;
1999 yy_size_t n;
2000 yy_size_t i;
2001
2002 /* Get memory for full buffer, including space for trailing EOB's. */
2003 n = (yy_size_t) _yybytes_len + 2;
2004 buf = (char *) cmListFileLexer_yyalloc(n ,yyscanner );
2005 if ( ! buf )
2006 YY_FATAL_ERROR( "out of dynamic memory in cmListFileLexer_yy_scan_bytes()" );
2007
2008 for ( i = 0; i < (size_t)_yybytes_len; ++i )
2009 buf[i] = yybytes[i];
2010
2011 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2012
2013 b = cmListFileLexer_yy_scan_buffer(buf,n ,yyscanner);
2014 if ( ! b )
2015 YY_FATAL_ERROR( "bad buffer in cmListFileLexer_yy_scan_bytes()" );
2016
2017 /* It's okay to grow etc. this buffer, and we should throw it
2018 * away when we're done.
2019 */
2020 b->yy_is_our_buffer = 1;
2021
2022 return b;
2023}
2024
2025#ifndef YY_EXIT_FAILURE
2026#define YY_EXIT_FAILURE 2

Callers 1

Calls 2

cmListFileLexer_yyallocFunction · 0.85

Tested by

no test coverage detected