--------------------------------------------------------------------------- | Facility : libnform | Function : static void Window_To_Buffer( | WINDOW * win, | FIELD * field) | | Description : Copy the content of the window into the buffer. | The multiple lines of a window
| 379 | | the window will be replaced by blanks in the buffer. |
| 380 | | |
| 381 | | Return Values : - |
| 382 | +--------------------------------------------------------------------------*/ |
| 383 | static void Window_To_Buffer(WINDOW * win, FIELD * field) |
| 384 | { |
| 385 | int pad; |
| 386 | int len = 0; |
| 387 | char *p; |
| 388 | int row, height, width; |
| 389 | |
| 390 | assert(win && field && field->buf ); |
| 391 | |
| 392 | pad = field->pad; |
| 393 | p = field->buf; |
| 394 | getmaxyx(win, height, width); |
| 395 | |
| 396 | for(row=0; (row < height) && (row < field->drows); row++ ) |
| 397 | { |
| 398 | wmove( win, row, 0 ); |
| 399 | len += winnstr( win, p+len, field->dcols ); |
| 400 | } |
| 401 | p[len] = '\0'; |
| 402 | |
| 403 | /* replace visual padding character by blanks in buffer */ |
| 404 | if (pad != C_BLANK) |
| 405 | { |
| 406 | int i; |
| 407 | for(i=0; i<len; i++, p++) |
| 408 | { |
| 409 | if (*p==pad) |
| 410 | *p = C_BLANK; |
| 411 | } |
| 412 | } |
| 413 | } |
| 414 |
no test coverage detected
searching dependent graphs…