--------------------------------------------------------------------------- | Facility : libnform | Function : static void Buffer_To_Window( | const FIELD * field, | WINDOW * win) | | Description : Copy the buffer to the window. If its a multiline | field, the buffer is split to
| 343 | | window without any editing. |
| 344 | | |
| 345 | | Return Values : - |
| 346 | +--------------------------------------------------------------------------*/ |
| 347 | static void Buffer_To_Window(const FIELD * field, WINDOW * win) |
| 348 | { |
| 349 | int width, height; |
| 350 | int len; |
| 351 | int row; |
| 352 | char *pBuffer; |
| 353 | |
| 354 | assert(win && field); |
| 355 | |
| 356 | getmaxyx(win, height, width); |
| 357 | |
| 358 | for(row=0, pBuffer=field->buf; |
| 359 | row < height; |
| 360 | row++, pBuffer += width ) |
| 361 | { |
| 362 | if ((len = (int)( After_End_Of_Data( pBuffer, width ) - pBuffer )) > 0) |
| 363 | { |
| 364 | wmove( win, row, 0 ); |
| 365 | waddnstr( win, pBuffer, len ); |
| 366 | } |
| 367 | } |
| 368 | } |
| 369 |
no test coverage detected
searching dependent graphs…