# Category : C Source Code

Archive : TCEGA.ZIP

Filename : POPUP.C

#include

#include

int *open_popup(x2,y2)

int x2,y2;

{

extern int gdcur_x,gdcur_y;

int x1,y1,x3,y3,i;

register int *sp;

x1 = gdcur_x;

y1 = gdcur_y;

if (x1 > x2)

{

i = x2;

x2 = x1;

x1 = x2;

}

if (y1 > y2)

{

i = y2;

y2 = y1;

y1 = y2;

}

x3 = (x2-x1) + 1;

y3 = (y2-y1) + 1;

if ((sp = (int *)calloc(x3 * y3 + (sizeof(unsigned int) * 4), 1)) == 0)

{

gpterm();

abort("Out of memory");

}

sp[0] = x1;

sp[1] = y1;

sp[2] = x3;

sp[3] = y3;

gpmove(x1,y1);

gpmovgtm(&sp[4],x3,y3,x3);

gpcolor(0);

gpbox(x2,y2);

gpcolor(1);

gprect(x2,y2);

return(sp);

}

void close_popup(sp)

int *sp;

{

gpmove(sp[0],sp[1]);

gpmovmtg(&sp[4],sp[2],sp[3],sp[2]);

free(sp);

}

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

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

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/