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

Function Perform_Justification

Source/CursesDialog/form/frm_driver.c:743–773  ·  view source on GitHub ↗

--------------------------------------------------------------------------- | Facility : libnform | Function : static void Perform_Justification( | FIELD * field, | WINDOW * win) | | Description : Output field with requested justification | | Return Values : - +-----------------------------

Source from the content-addressed store, hash-verified

741| Description : Output field with requested justification
742|
743| Return Values : -
744+--------------------------------------------------------------------------*/
745static void Perform_Justification(FIELD * field, WINDOW * win)
746{
747 char *bp;
748 int len;
749 int col = 0;
750
751 bp = Get_Start_Of_Data(field->buf,Buffer_Length(field));
752 len = (int)(After_End_Of_Data(field->buf,Buffer_Length(field)) - bp);
753
754 if (len>0)
755 {
756 assert(win && (field->drows == 1) && (field->dcols == field->cols));
757
758 switch(field->just)
759 {
760 case JUSTIFY_LEFT:
761 break;
762 case JUSTIFY_CENTER:
763 col = (field->cols - len)/2;
764 break;
765 case JUSTIFY_RIGHT:
766 col = field->cols - len;
767 break;
768 default:
769 break;
770 }
771
772 wmove(win,0,col);
773 waddnstr(win,bp,len);
774 }
775}
776

Callers 2

Display_Or_Erase_FieldFunction · 0.85
_nc_Set_Current_FieldFunction · 0.85

Calls 4

Get_Start_Of_DataFunction · 0.85
After_End_Of_DataFunction · 0.85
wmoveFunction · 0.85
waddnstrFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…