DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ B T

⟦c4e291989⟧ TextFile

    Length: 5301 (0x14b5)
    Types: TextFile
    Names: »BREAK_C«

Derivation

└─⟦149519bd4⟧ Bits:30000546 8mm tape, Rational 1000, !projects 93-07-13
    └─ ⟦124ff5788⟧ »DATA« 
        └─⟦this⟧ 
└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11
    └─ ⟦129cab021⟧ »DATA« 
        └─⟦this⟧ 
└─⟦f64eaa120⟧ Bits:30000752 8mm tape, Rational 1000, !projects 93 02 16
    └─ ⟦6f12a12be⟧ »DATA« 
        └─⟦this⟧ 
└─⟦2f6cfab89⟧ Bits:30000547 8mm tape, Rational 1000, !projects 94-01-04
    └─ ⟦d65440be7⟧ »DATA« 
        └─⟦this⟧ 

TextFile

/*=================================================================
;  IRP MULHOUSE                           AVRIL 92
;-------------------------------------------------------------------
; PROJECT  : Z80 SIMULATOR               
; STUDENTS : MOREAUX & VERGER
;
; FILE     : Break.c
==================================================================
; DESCRIPTION :
; Fichier source pour la gestion des Break Points de l'interface 
; WINDOW SYSTEM
;----------------------------------------------------------------*/

/*----------- Inclusion -------------------------*/

#include "GUI_Interface.h"

#include <Xm/List.h>
#include <Xm/ListP.h>

/*----------- Definitions -----------------------*/

#define MAX_BREAKS     10

/*----------- Globales --------------------------*/

char BreakPointList[MAX_BREAKS*4] ="#######################################";
char  avBreak[] = "0000";
Widget wgBreakList;
XmString *xmstrBreakList;
int nbBreakPoint = 0;
int Iterator = 0;

/*-------------------------------------------------
   Initialisation
   ( Appel depuis C )
--------------------------------------------------*/

void BreakInit (Widget TopLevel)
{
Arg    wargs [10];
int i;

   wgBreakList = XtNameToWidget(TopLevel,"MW.BB.BreakFrame.Form.Break.FormList.List");

   xmstrBreakList = (XmString *) XtMalloc (sizeof(XmString) * MAX_BREAKS);
   for (i=0; i<MAX_BREAKS; i++)
                xmstrBreakList [i] = XmStringCreate ( "    ", XmSTRING_DEFAULT_CHARSET);
   XtSetArg (wargs[0], XmNitems, xmstrBreakList); 
   XtSetArg (wargs[1], XmNitemCount,MAX_BREAKS); 
   XtSetValues ( wgBreakList, wargs, 2);

   FmAttachAv ( "Break", avBreak); 

}

/*-------------------------------------------------
  Gestion des PushButons Add,Delete,DeleteAll
  ( Appels depuis WINDOW )    
--------------------------------------------------*/

static Boolean CheckInput ( int nb_car, char * string)
{
int i;
Boolean error_found = FALSE;

  if (strlen(string) != nb_car) 
      error_found = TRUE;

  else 
     {
     i = 0;
     while ( (i <  nb_car) && (! error_found) )
        {
         string[i] = toupper(string[i]);
         error_found = ! (isdigit(string[i]) || ( (string[i] >= 'A') && (string[i] <= 'F') ) );
        i++;
        }
     }

  if (error_found)
      {
      for ( i = 0; i < nb_car; i++ )
         string[i] = '0';
      SetMessage("INPUT ERROR : Hexa value expected !!!");
      FmBeep();
      return TRUE;
      }
  else
      {
      SetMessage("");
      return FALSE;   
      }  
}


static Boolean BreakLower(char *Break1,char *Break2) 
{
 return ( strncmp(Break1,Break2,4) < 0 );
}

static Boolean BreakEqual(char *Break1,char *Break2) 
{
 return ( strncmp(Break1,Break2,4) == 0 );
}



void AddActivate()
{
 int InsertPos,i,j;
 
 if (nbBreakPoint < MAX_BREAKS ) 
   {
    FmGetActiveValue ( 0, "Break");

    if (!CheckInput(4,avBreak))
      { 
       if (nbBreakPoint)
             {
                for (InsertPos=0; InsertPos <= (nbBreakPoint -1 ) ; InsertPos++ ) 
                                   {
                                    if (BreakEqual( avBreak,&BreakPointList[InsertPos*4] )) 
                                           { FmBeep(); 
                                             return; } 

                                    if (BreakLower( avBreak,&BreakPointList[InsertPos*4] )) break;   
                                   }
               
                if( nbBreakPoint != InsertPos )
                     for(i= (nbBreakPoint*4)-1 ; i >= InsertPos*4 ; i--)  BreakPointList[i+4] = BreakPointList[i];  
  
             }  else  InsertPos = 0; 

      for ( i = InsertPos*4,j=0 ; i < (InsertPos+1)*4  ; j++,i ++ )  BreakPointList[i] = avBreak[j];

      XmListAddItemUnselected (wgBreakList, XmStringCreate (avBreak,XmSTRING_DEFAULT_CHARSET), ++InsertPos);

      nbBreakPoint ++;

     }

   } else FmBeep();
}



void DeleteActivate()
{
 int i,j,pos; 
 int delta = 0;
 int *position_list,position_count;

   if (XmListGetSelectedPos (wgBreakList, &position_list, &position_count)) 
   {
       for (i=0; i<position_count; i++) 
        {
         pos = position_list[i] - delta ; 
         XmListDeletePos(wgBreakList, pos);

         for (j=4*(pos-1) ; j <= 4*(nbBreakPoint-1) ; j++) 
             BreakPointList[j] = BreakPointList[j+4];

         for (j = (nbBreakPoint-1)*4 ; j < nbBreakPoint*4 ; j++)
             BreakPointList[j] = '#';      

         delta++;
         }
    nbBreakPoint -= position_count;

   XtFree((char *)position_list);
  }
}


void DeleteAllActivate()
{
 XmListWidget  l = (XmListWidget) wgBreakList;
 int   cntmax = l->list.itemCount;
 int   cnt;

   for (cnt=0; cnt < cntmax; cnt++) 
      {
       XmListDeletePos( wgBreakList, 1);
      }
  nbBreakPoint = 0;
  strcpy(BreakPointList,"#######################################");
 
} 


/*-------------------------------------------------
   Lecture de la variable active
   ( Appels depuis C )  
--------------------------------------------------*/

void BreakListIterInit()
{
  Iterator = 0;
}

void BreakListIterNext ()
{
  Iterator++;
}


Boolean BreakListIterDone ()
{
  return (Iterator == strlen (BreakPointList));
}

char BreakListIterValue()
{
  return BreakPointList[Iterator];
}



/*================= FIN DU FICHIER ======================================*/