MCPcopy Create free account
hub / github.com/Kitware/CMake / Adjust_Cursor_Position

Function Adjust_Cursor_Position

Source/CursesDialog/form/frm_driver.c:315–331  ·  view source on GitHub ↗

--------------------------------------------------------------------------- | 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 : - +---

Source from the content-addressed store, hash-verified

313| corresponding to the buffer position.
314|
315| Return Values : -
316+--------------------------------------------------------------------------*/
317INLINE 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

Callers 8

IFN_Next_WordFunction · 0.85
IFN_Previous_WordFunction · 0.85
IFN_Beginning_Of_FieldFunction · 0.85
IFN_End_Of_FieldFunction · 0.85
IFN_Beginning_Of_LineFunction · 0.85
IFN_End_Of_LineFunction · 0.85
FE_Delete_PreviousFunction · 0.85
FE_Delete_WordFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…