2004-02-07 Andrew Cagney <cagney@redhat.com>
[deliverable/binutils-gdb.git] / gdb / tui / tui-regs.c
index 68520b9f6eba2e1f450492307f9695b50f06ceba..e5222c297ca4d266c51fecbce017d9eea9a87353 100644 (file)
 /*****************************************
 ** STATIC LOCAL FUNCTIONS FORWARD DECLS    **
 ******************************************/
-static TuiStatus _tuiSetRegsContent
-  (int, int, struct frame_info *, TuiRegisterDisplayType, int);
+static enum tui_status _tuiSetRegsContent
+  (int, int, struct frame_info *, enum tui_register_display_type, int);
 static const char *_tuiRegisterName (int);
-static TuiStatus _tuiGetRegisterRawValue (int, char *, struct frame_info *);
+static enum tui_status _tuiGetRegisterRawValue (int, char *, struct frame_info *);
 static void _tuiSetRegisterElement
-  (int, struct frame_info *, TuiDataElementPtr, int);
-static void _tuiDisplayRegister (int, TuiGenWinInfoPtr, enum precision_type);
+  (int, struct frame_info *, struct tui_data_element *, int);
+static void _tuiDisplayRegister (int, struct tui_gen_win_info *, enum precision_type);
 static void _tuiRegisterFormat
-  (char *, int, int, TuiDataElementPtr, enum precision_type);
-static TuiStatus _tuiSetGeneralRegsContent (int);
-static TuiStatus _tuiSetSpecialRegsContent (int);
-static TuiStatus _tuiSetGeneralAndSpecialRegsContent (int);
-static TuiStatus _tuiSetFloatRegsContent (TuiRegisterDisplayType, int);
+  (char *, int, int, struct tui_data_element *, enum precision_type);
+static enum tui_status _tuiSetGeneralRegsContent (int);
+static enum tui_status _tuiSetSpecialRegsContent (int);
+static enum tui_status _tuiSetGeneralAndSpecialRegsContent (int);
+static enum tui_status _tuiSetFloatRegsContent (enum tui_register_display_type, int);
 static int _tuiRegValueHasChanged
-  (TuiDataElementPtr, struct frame_info *, char *);
+  (struct tui_data_element *, struct frame_info *, char *);
 static void _tuiShowFloat_command (char *, int);
 static void _tuiShowGeneral_command (char *, int);
 static void _tuiShowSpecial_command (char *, int);
-static void _tui_vShowRegisters_commandSupport (TuiRegisterDisplayType);
+static void _tui_vShowRegisters_commandSupport (enum tui_register_display_type);
 static void _tuiToggleFloatRegs_command (char *, int);
 static void _tuiScrollRegsForward_command (char *, int);
 static void _tuiScrollRegsBackward_command (char *, int);
@@ -186,7 +186,7 @@ tuiLastRegElementNoInLine (int lineNo)
 /* Calculate the number of columns that should be used to display the
    registers.  */
 int
-tui_calculate_regs_column_count (TuiRegisterDisplayType dpyType)
+tui_calculate_regs_column_count (enum tui_register_display_type dpyType)
 {
   int colCount, colWidth;
 
@@ -209,9 +209,9 @@ tui_calculate_regs_column_count (TuiRegisterDisplayType dpyType)
    there is any other registers being displayed, then they are
    cleared.  What registers are displayed is dependent upon dpyType.  */
 void
-tui_show_registers (TuiRegisterDisplayType dpyType)
+tui_show_registers (enum tui_register_display_type dpyType)
 {
-  TuiStatus ret = TUI_FAILURE;
+  enum tui_status ret = TUI_FAILURE;
   int refreshValuesOnly = FALSE;
 
   /* Say that registers should be displayed, even if there is a problem */
@@ -249,7 +249,7 @@ tui_show_registers (TuiRegisterDisplayType dpyType)
   if (ret == TUI_FAILURE)
     {
       dataWin->detail.dataDisplayInfo.regsDisplayType = TUI_UNDEFINED_REGS;
-      tuiEraseDataContent (NO_REGS_STRING);
+      tui_erase_data_content (NO_REGS_STRING);
     }
   else
     {
@@ -258,17 +258,17 @@ tui_show_registers (TuiRegisterDisplayType dpyType)
       /* Clear all notation of changed values */
       for (i = 0; (i < dataWin->detail.dataDisplayInfo.regsContentCount); i++)
        {
-         TuiGenWinInfoPtr dataItemWin;
+         struct tui_gen_win_info * dataItemWin;
 
          dataItemWin = &dataWin->detail.dataDisplayInfo.
            regsContent[i]->whichElement.dataWindow;
-         (&((TuiWinElementPtr)
+         (&((struct tui_win_element *)
             dataItemWin->content[0])->whichElement.data)->highlight = FALSE;
        }
       dataWin->detail.dataDisplayInfo.regsDisplayType = dpyType;
-      tuiDisplayAllData ();
+      tui_display_all_data ();
     }
-  (tuiLayoutDef ())->regsDisplayType = dpyType;
+  (tui_layout_def ())->regsDisplayType = dpyType;
 
   return;
 }
@@ -281,7 +281,7 @@ tui_show_registers (TuiRegisterDisplayType dpyType)
 void
 tui_display_registers_from (int startElementNo)
 {
-  if (dataWin->detail.dataDisplayInfo.regsContent != (TuiWinContent) NULL &&
+  if (dataWin->detail.dataDisplayInfo.regsContent != (tui_win_content) NULL &&
       dataWin->detail.dataDisplayInfo.regsContentCount > 0)
     {
       register int i = startElementNo;
@@ -323,13 +323,13 @@ tui_display_registers_from (int startElementNo)
               (j < dataWin->detail.dataDisplayInfo.regsColumnCount &&
                i < dataWin->detail.dataDisplayInfo.regsContentCount); j++)
            {
-             TuiGenWinInfoPtr dataItemWin;
-             TuiDataElementPtr dataElementPtr;
+             struct tui_gen_win_info * dataItemWin;
+             struct tui_data_element * dataElementPtr;
 
              /* create the window if necessary */
              dataItemWin = &dataWin->detail.dataDisplayInfo.
                regsContent[i]->whichElement.dataWindow;
-             dataElementPtr = &((TuiWinElementPtr)
+             dataElementPtr = &((struct tui_win_element *)
                                 dataItemWin->content[0])->whichElement.data;
              if (dataItemWin->handle == (WINDOW *) NULL)
                {
@@ -338,7 +338,7 @@ tui_display_registers_from (int startElementNo)
                    itemWinWidth + 2 : itemWinWidth + 1;
                  dataItemWin->origin.x = (itemWinWidth * j) + 1;
                  dataItemWin->origin.y = curY;
-                 makeWindow (dataItemWin, DONT_BOX_WINDOW);
+                 tui_make_window (dataItemWin, DONT_BOX_WINDOW);
                   scrollok (dataItemWin->handle, FALSE);
                }
               touchwin (dataItemWin->handle);
@@ -370,7 +370,7 @@ tui_display_registers_from (int startElementNo)
 void
 tuiDisplayRegElementAtLine (int startElementNo, int startLineNo)
 {
-  if (dataWin->detail.dataDisplayInfo.regsContent != (TuiWinContent) NULL &&
+  if (dataWin->detail.dataDisplayInfo.regsContent != (tui_win_content) NULL &&
       dataWin->detail.dataDisplayInfo.regsContentCount > 0)
     {
       register int elementNo = startElementNo;
@@ -452,7 +452,7 @@ tui_check_register_values (struct frame_info *frame)
     {
       if (dataWin->detail.dataDisplayInfo.regsContentCount <= 0 &&
          dataWin->detail.dataDisplayInfo.displayRegs)
-       tui_show_registers ((tuiLayoutDef ())->regsDisplayType);
+       tui_show_registers ((tui_layout_def ())->regsDisplayType);
       else
        {
          int i, j;
@@ -461,13 +461,13 @@ tui_check_register_values (struct frame_info *frame)
          for (i = 0;
               (i < dataWin->detail.dataDisplayInfo.regsContentCount); i++)
            {
-             TuiDataElementPtr dataElementPtr;
-             TuiGenWinInfoPtr dataItemWinPtr;
+             struct tui_data_element * dataElementPtr;
+             struct tui_gen_win_info * dataItemWinPtr;
              int wasHilighted;
 
              dataItemWinPtr = &dataWin->detail.dataDisplayInfo.
                regsContent[i]->whichElement.dataWindow;
-             dataElementPtr = &((TuiWinElementPtr)
+             dataElementPtr = &((struct tui_win_element *)
                             dataItemWinPtr->content[0])->whichElement.data;
              wasHilighted = dataElementPtr->highlight;
              dataElementPtr->highlight =
@@ -509,7 +509,7 @@ tui_check_register_values (struct frame_info *frame)
 void
 tuiToggleFloatRegs (void)
 {
-  TuiLayoutDefPtr layoutDef = tuiLayoutDef ();
+  struct tui_layout_def * layoutDef = tui_layout_def ();
 
   if (layoutDef->floatRegsDisplayType == TUI_SFLOAT_REGS)
     layoutDef->floatRegsDisplayType = TUI_DFLOAT_REGS;
@@ -583,7 +583,7 @@ tui_restore_gdbout (void *ui)
  */
 static void
 _tuiRegisterFormat (char *buf, int bufLen, int regNum,
-                    TuiDataElementPtr dataElement,
+                    struct tui_data_element * dataElement,
                     enum precision_type precision)
 {
   struct ui_file *stream;
@@ -641,7 +641,7 @@ _tuiRegisterFormat (char *buf, int bufLen, int regNum,
    ** _tuiSetGeneralRegsContent().
    **      Set the content of the data window to consist of the general registers.
  */
-static TuiStatus
+static enum tui_status
 _tuiSetGeneralRegsContent (int refreshValuesOnly)
 {
   return (_tuiSetRegsContent (0,
@@ -663,10 +663,10 @@ _tuiSetGeneralRegsContent (int refreshValuesOnly)
    ** _tuiSetSpecialRegsContent().
    **      Set the content of the data window to consist of the special registers.
  */
-static TuiStatus
+static enum tui_status
 _tuiSetSpecialRegsContent (int refreshValuesOnly)
 {
-  TuiStatus ret = TUI_FAILURE;
+  enum tui_status ret = TUI_FAILURE;
   int endRegNum;
 
   endRegNum = FP0_REGNUM - 1;
@@ -684,10 +684,10 @@ _tuiSetSpecialRegsContent (int refreshValuesOnly)
    ** _tuiSetGeneralAndSpecialRegsContent().
    **      Set the content of the data window to consist of the special registers.
  */
-static TuiStatus
+static enum tui_status
 _tuiSetGeneralAndSpecialRegsContent (int refreshValuesOnly)
 {
-  TuiStatus ret = TUI_FAILURE;
+  enum tui_status ret = TUI_FAILURE;
   int endRegNum = (-1);
 
   endRegNum = FP0_REGNUM - 1;
@@ -701,10 +701,10 @@ _tuiSetGeneralAndSpecialRegsContent (int refreshValuesOnly)
    ** _tuiSetFloatRegsContent().
    **        Set the content of the data window to consist of the float registers.
  */
-static TuiStatus
-_tuiSetFloatRegsContent (TuiRegisterDisplayType dpyType, int refreshValuesOnly)
+static enum tui_status
+_tuiSetFloatRegsContent (enum tui_register_display_type dpyType, int refreshValuesOnly)
 {
-  TuiStatus ret = TUI_FAILURE;
+  enum tui_status ret = TUI_FAILURE;
   int startRegNum;
 
   startRegNum = FP0_REGNUM;
@@ -724,7 +724,7 @@ _tuiSetFloatRegsContent (TuiRegisterDisplayType dpyType, int refreshValuesOnly)
    **        If TRUE, newValue is filled in with the new value.
  */
 static int
-_tuiRegValueHasChanged (TuiDataElementPtr dataElement,
+_tuiRegValueHasChanged (struct tui_data_element * dataElement,
                         struct frame_info *frame,
                         char *newValue)
 {
@@ -759,10 +759,10 @@ _tuiRegValueHasChanged (TuiDataElementPtr dataElement,
    ** _tuiGetRegisterRawValue().
    **        Get the register raw value.  The raw value is returned in regValue.
  */
-static TuiStatus
+static enum tui_status
 _tuiGetRegisterRawValue (int regNum, char *regValue, struct frame_info *frame)
 {
-  TuiStatus ret = TUI_FAILURE;
+  enum tui_status ret = TUI_FAILURE;
 
   if (target_has_registers)
     {
@@ -785,10 +785,10 @@ _tuiGetRegisterRawValue (int regNum, char *regValue, struct frame_info *frame)
  */
 static void
 _tuiSetRegisterElement (int regNum, struct frame_info *frame,
-                        TuiDataElementPtr dataElement,
+                        struct tui_data_element * dataElement,
                         int refreshValueOnly)
 {
-  if (dataElement != (TuiDataElementPtr) NULL)
+  if (dataElement != (struct tui_data_element *) NULL)
     {
       if (!refreshValueOnly)
        {
@@ -796,9 +796,9 @@ _tuiSetRegisterElement (int regNum, struct frame_info *frame,
          dataElement->name = _tuiRegisterName (regNum);
          dataElement->highlight = FALSE;
        }
-      if (dataElement->value == (Opaque) NULL)
-       dataElement->value = (Opaque) xmalloc (MAX_REGISTER_SIZE);
-      if (dataElement->value != (Opaque) NULL)
+      if (dataElement->value == NULL)
+       dataElement->value = xmalloc (MAX_REGISTER_SIZE);
+      if (dataElement->value != NULL)
        _tuiGetRegisterRawValue (regNum, dataElement->value, frame);
     }
 
@@ -812,41 +812,41 @@ _tuiSetRegisterElement (int regNum, struct frame_info *frame,
    **        numbered from startRegNum to endRegNum.  Note that if
    **        refreshValuesOnly is TRUE, startRegNum and endRegNum are ignored.
  */
-static TuiStatus
+static enum tui_status
 _tuiSetRegsContent (int startRegNum, int endRegNum,
                     struct frame_info *frame,
-                    TuiRegisterDisplayType dpyType,
+                    enum tui_register_display_type dpyType,
                     int refreshValuesOnly)
 {
-  TuiStatus ret = TUI_FAILURE;
+  enum tui_status ret = TUI_FAILURE;
   int numRegs = endRegNum - startRegNum + 1;
   int allocatedHere = FALSE;
 
   if (dataWin->detail.dataDisplayInfo.regsContentCount > 0 &&
       !refreshValuesOnly)
     {
-      freeDataContent (dataWin->detail.dataDisplayInfo.regsContent,
-                      dataWin->detail.dataDisplayInfo.regsContentCount);
+      tui_free_data_content (dataWin->detail.dataDisplayInfo.regsContent,
+                            dataWin->detail.dataDisplayInfo.regsContentCount);
       dataWin->detail.dataDisplayInfo.regsContentCount = 0;
     }
   if (dataWin->detail.dataDisplayInfo.regsContentCount <= 0)
     {
       dataWin->detail.dataDisplayInfo.regsContent =
-       allocContent (numRegs, DATA_WIN);
+       tui_alloc_content (numRegs, DATA_WIN);
       allocatedHere = TRUE;
     }
 
-  if (dataWin->detail.dataDisplayInfo.regsContent != (TuiWinContent) NULL)
+  if (dataWin->detail.dataDisplayInfo.regsContent != (tui_win_content) NULL)
     {
       int i;
 
       if (!refreshValuesOnly || allocatedHere)
        {
-         dataWin->generic.content = (OpaquePtr) NULL;
+         dataWin->generic.content = NULL;
          dataWin->generic.contentSize = 0;
-         addContentElements (&dataWin->generic, numRegs);
+         tui_add_content_elements (&dataWin->generic, numRegs);
          dataWin->detail.dataDisplayInfo.regsContent =
-           (TuiWinContent) dataWin->generic.content;
+           (tui_win_content) dataWin->generic.content;
          dataWin->detail.dataDisplayInfo.regsContentCount = numRegs;
        }
       /*
@@ -854,14 +854,14 @@ _tuiSetRegsContent (int startRegNum, int endRegNum,
        */
       for (i = startRegNum; (i <= endRegNum); i++)
        {
-         TuiGenWinInfoPtr dataItemWin;
+         struct tui_gen_win_info * dataItemWin;
 
          dataItemWin = &dataWin->detail.dataDisplayInfo.
            regsContent[i - startRegNum]->whichElement.dataWindow;
          _tuiSetRegisterElement (
                                   i,
                                   frame,
-          &((TuiWinElementPtr) dataItemWin->content[0])->whichElement.data,
+          &((struct tui_win_element *) dataItemWin->content[0])->whichElement.data,
                                   !allocatedHere && refreshValuesOnly);
        }
       dataWin->detail.dataDisplayInfo.regsColumnCount =
@@ -891,7 +891,7 @@ _tuiSetRegsContent (int startRegNum, int endRegNum,
  */
 static void
 _tuiDisplayRegister (int regNum,
-                     TuiGenWinInfoPtr winInfo,         /* the data item window */
+                     struct tui_gen_win_info * winInfo,                /* the data item window */
                      enum precision_type precision)
 {
   if (winInfo->handle != (WINDOW *) NULL)
@@ -899,7 +899,7 @@ _tuiDisplayRegister (int regNum,
       int i;
       char buf[40];
       int valueCharsWide, labelWidth;
-      TuiDataElementPtr dataElementPtr = &((TuiWinContent)
+      struct tui_data_element * dataElementPtr = &((tui_win_content)
                                    winInfo->content)[0]->whichElement.data;
 
       if (IS_64BIT ||
@@ -941,14 +941,14 @@ _tuiDisplayRegister (int regNum,
 
       if (dataElementPtr->highlight)
        wstandend (winInfo->handle);
-      tuiRefreshWin (winInfo);
+      tui_refresh_win (winInfo);
     }
   return;
 }                              /* _tuiDisplayRegister */
 
 
 static void
-_tui_vShowRegisters_commandSupport (TuiRegisterDisplayType dpyType)
+_tui_vShowRegisters_commandSupport (enum tui_register_display_type dpyType)
 {
 
   if (m_winPtrNotNull (dataWin) && dataWin->generic.isVisible)
@@ -957,7 +957,7 @@ _tui_vShowRegisters_commandSupport (TuiRegisterDisplayType dpyType)
        tui_show_registers (dpyType);
     }
   else
-    (tuiLayoutDef ())->regsDisplayType = dpyType;
+    (tui_layout_def ())->regsDisplayType = dpyType;
 
   return;
 }                              /* _tui_vShowRegisters_commandSupport */
@@ -969,7 +969,7 @@ _tuiShowFloat_command (char *arg, int fromTTY)
   if (m_winPtrIsNull (dataWin) || !dataWin->generic.isVisible ||
       (dataWin->detail.dataDisplayInfo.regsDisplayType != TUI_SFLOAT_REGS &&
        dataWin->detail.dataDisplayInfo.regsDisplayType != TUI_DFLOAT_REGS))
-    _tui_vShowRegisters_commandSupport ((tuiLayoutDef ())->floatRegsDisplayType);
+    _tui_vShowRegisters_commandSupport ((tui_layout_def ())->floatRegsDisplayType);
 
   return;
 }                              /* _tuiShowFloat_command */
@@ -996,7 +996,7 @@ _tuiToggleFloatRegs_command (char *arg, int fromTTY)
     tuiToggleFloatRegs ();
   else
     {
-      TuiLayoutDefPtr layoutDef = tuiLayoutDef ();
+      struct tui_layout_def * layoutDef = tui_layout_def ();
 
       if (layoutDef->floatRegsDisplayType == TUI_SFLOAT_REGS)
        layoutDef->floatRegsDisplayType = TUI_DFLOAT_REGS;
This page took 0.030195 seconds and 4 git commands to generate.