Category : C Source Code
Archive   : EGA-C.ZIP
Filename : GPWAREA.C

 
Output of file : GPWAREA.C contained in archive : EGA-C.ZIP

#include
#include
#include

WORKAREA *gdwalist;
WORKAREA *gdwafull;

void gpinitwa()
{
static WORKAREA area1 =
{
0,1,0,0,640,350,0,0,640,350,3,2
};

gdwalist = NULL;

gdwafull = &area1;

}

void gptermwa()
{
register WORKAREA *j;

j = gdwalist;
while (j != NULL)
{
free(j);
j = (WORKAREA *)j->next;
}
}

WORKAREA *gpgenwa(x,y,w,h)
unsigned int x,y,w,h;
{
extern WORKAREA *calloc();

register WORKAREA *j;

if ((j = calloc(sizeof(WORKAREA),1)) == NULL)
{
gpterm();
perror("GPGENWA: Out of local memory!\n");
exit(1);
}

j->device = 1;
j->base = 0;
j->xorigin = x;
j->yorigin = y;
j->width = w;
j->height = h;
j->x = 0;
j->y = 0;
j->w = w;
j->h = h;
j->aspect1 = 3;
j->aspect2 = 2;
j->next = (char *)gdwalist;

gdwalist = j;

return(j);
}

void gpdelwa(wa)
WORKAREA *wa;
{
register WORKAREA *i;
register WORKAREA *j;

j = gdwalist;
while (j != NULL)
{
if (wa == j)
{
if (j == gdwalist)
{
gdwalist = (WORKAREA *)j->next;
}
else
{
i->next = j->next;
};
free(j);
return;
}
i = j;
j = (WORKAREA *)j->next;
}
}


  3 Responses to “Category : C Source Code
Archive   : EGA-C.ZIP
Filename : GPWAREA.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/