|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: F T
Length: 2320 (0x910)
Types: TextFile
Names: »FRAME_C«
└─⟦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⟧
#include <stdio.h>
#include <Xm/Xm.h>
#define MAX_LOCAL_FRAME 100
#define NO_FREE_FRAME 0
#define INVALID_WIDGET 0
struct rec_local_frame {
Widget w;
int busy;
char *name;
} local_frames[MAX_LOCAL_FRAME];
void print_frame()
{
int i;
for (i=0; i<MAX_LOCAL_FRAME; i++)
if (local_frames[i].busy)
printf("frame[%d]: %d, %s \n",i,local_frames[i].w,local_frames[i].name);
}
int widget_to_lf(Widget w)
{
int i;
for(i=1;i<MAX_LOCAL_FRAME;i++)
if (local_frames[i].busy)
if (local_frames[i].w==w) return i;
return INVALID_WIDGET;
}
void init_local_frames()
{
int i;
for (i=1;i<MAX_LOCAL_FRAME;i++)
local_frames[i].busy=FALSE;
}
Widget get_local_frame_widget(int lf)
{
return local_frames[lf].w;
}
int get_local_frame_id(char *name)
{
int i;
for (i=1;i<MAX_LOCAL_FRAME;i++)
if (!local_frames[i].busy)
{
local_frames[i].busy=TRUE;
local_frames[i].name=malloc(strlen(name)+1);
strcpy(local_frames[i].name,name);
return i;
}
return NO_FREE_FRAME;
}
int get_local_frame_id_with_name(char *name,int main_lf,char *path)
{
int i;
Widget w_main,w_child;
for (i=1;i<MAX_LOCAL_FRAME;i++)
if (!local_frames[i].busy)
{
w_main=get_local_frame_widget(main_lf);
if (w_main==NULL)
{
printf("get_local_frame_id_with_name: cannot get Widget for main_localframe %d\n",main_lf);
return NO_FREE_FRAME;
}
else
{
w_child=XtNameToWidget(w_main,path);
if (w_child==NULL)
{
printf("get_local_frame_id_with_name: cannot get Widget for path %s\n",path);
return NO_FREE_FRAME;
}
else
{
local_frames[i].busy=TRUE;
local_frames[i].w=w_child;
local_frames[i].name=malloc(strlen(name)+1);
strcpy(local_frames[i].name,name);
return i;
}
}
}
return NO_FREE_FRAME;
}
char *get_local_frame_name(int lf)
{
if (local_frames[lf].busy) return adastr(local_frames[lf].name);
else return adastr((char *) NULL);
}
void free_local_frame(int lf)
{
free(local_frames[lf].name);
local_frames[lf].busy=FALSE;
}
void set_local_frame_widget(int lf, Widget w)
{
local_frames[lf].w = w;
}