Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. * @param yyscanner The scanner object. * @return the allocated buffer state. */
| 1735 | * @return the allocated buffer state. |
| 1736 | */ |
| 1737 | YY_BUFFER_STATE cmListFileLexer_yy_create_buffer (FILE * file, int size , yyscan_t yyscanner) |
| 1738 | { |
| 1739 | YY_BUFFER_STATE b; |
| 1740 | |
| 1741 | b = (YY_BUFFER_STATE) cmListFileLexer_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner ); |
| 1742 | if ( ! b ) |
| 1743 | YY_FATAL_ERROR( "out of dynamic memory in cmListFileLexer_yy_create_buffer()" ); |
| 1744 | |
| 1745 | b->yy_buf_size = (yy_size_t)size; |
| 1746 | |
| 1747 | /* yy_ch_buf has to be 2 characters longer than the size given because |
| 1748 | * we need to put in 2 end-of-buffer characters. |
| 1749 | */ |
| 1750 | b->yy_ch_buf = (char *) cmListFileLexer_yyalloc(b->yy_buf_size + 2 ,yyscanner ); |
| 1751 | if ( ! b->yy_ch_buf ) |
| 1752 | YY_FATAL_ERROR( "out of dynamic memory in cmListFileLexer_yy_create_buffer()" ); |
| 1753 | |
| 1754 | b->yy_is_our_buffer = 1; |
| 1755 | |
| 1756 | cmListFileLexer_yy_init_buffer(b,file ,yyscanner); |
| 1757 | |
| 1758 | return b; |
| 1759 | } |
| 1760 | |
| 1761 | /** Destroy the buffer. |
| 1762 | * @param b a buffer created with cmListFileLexer_yy_create_buffer() |
no test coverage detected