MCPcopy Index your code
hub / github.com/MapServer/MapServer / msyy_scan_bytes

Function msyy_scan_bytes

maplexer.c:4971–4999  ·  view source on GitHub ↗

Setup the input buffer state to scan the given bytes. The next call to msyylex() 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. * * @return the newly allocated buffer state object. */

Source from the content-addressed store, hash-verified

4969 * @return the newly allocated buffer state object.
4970 */
4971YY_BUFFER_STATE msyy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
4972{
4973 YY_BUFFER_STATE b;
4974 char *buf;
4975 yy_size_t n;
4976 int i;
4977
4978 /* Get memory for full buffer, including space for trailing EOB's. */
4979 n = _yybytes_len + 2;
4980 buf = (char *) msyyalloc(n );
4981 if ( ! buf )
4982 YY_FATAL_ERROR( "out of dynamic memory in msyy_scan_bytes()" );
4983
4984 for ( i = 0; i < _yybytes_len; ++i )
4985 buf[i] = yybytes[i];
4986
4987 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
4988
4989 b = msyy_scan_buffer(buf,n );
4990 if ( ! b )
4991 YY_FATAL_ERROR( "bad buffer in msyy_scan_bytes()" );
4992
4993 /* It's okay to grow etc. this buffer, and we should throw it
4994 * away when we're done.
4995 */
4996 b->yy_is_our_buffer = 1;
4997
4998 return b;
4999}
5000
5001#ifndef YY_EXIT_FAILURE
5002#define YY_EXIT_FAILURE 2

Callers 1

msyy_scan_stringFunction · 0.85

Calls 2

msyyallocFunction · 0.85
msyy_scan_bufferFunction · 0.85

Tested by

no test coverage detected