--------------------------------------------------------------------------- | Facility : libnform | Function : static void Adjust_Cursor_Position( | FORM * form, const char * pos) | | Description : Set current row and column of the form to values | corresponding to the buffer position. | | Return Values : - +---
| 313 | | corresponding to the buffer position. |
| 314 | | |
| 315 | | Return Values : - |
| 316 | +--------------------------------------------------------------------------*/ |
| 317 | INLINE static void Adjust_Cursor_Position(FORM * form, const char * pos) |
| 318 | { |
| 319 | FIELD *field; |
| 320 | int idx; |
| 321 | |
| 322 | field = form->current; |
| 323 | assert( pos >= field->buf && field->dcols > 0); |
| 324 | idx = (int)( pos - field->buf ); |
| 325 | #if USE_DIV_T |
| 326 | *((div_t *)&(form->currow)) = div(idx,field->dcols); |
| 327 | #else |
| 328 | form->currow = idx / field->dcols; |
| 329 | form->curcol = idx - field->cols * form->currow; |
| 330 | #endif |
| 331 | if ( field->drows < form->currow ) |
| 332 | form->currow = 0; |
| 333 | } |
| 334 |
no outgoing calls
no test coverage detected
searching dependent graphs…