home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / BBS / MISC / HSRC_117.ZIP / DISPLAY.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-11-14  |  18.2 KB  |  686 lines

  1. #include "msgg.h"
  2. #include "twindow.h"
  3. #include "keys.h"
  4. #include "headedit.h"
  5.  
  6. extern word threadstart;
  7. extern WINDOW *ewnd;
  8. extern int wasconfinedx1,wasconfinedy1,wasconfinedx2,wasconfinedy2;
  9.  
  10. extern void pascal do_recpt(void);
  11.  
  12.  
  13. /* This is the main display function for reading messages
  14.    (see also read_mess()).  This is pretty big and pretty nasty,
  15.    but rather efficient, so what the hell... */
  16.  
  17.  
  18. int pascal display (word *lastmess,char type) {
  19.  
  20.   register word x;
  21.   int  x1;
  22.   int  y1;
  23.   word temp;
  24.   char *hold;
  25.   char *tempo;
  26.   char *p;
  27.   char caret=0;
  28.   char message[133];
  29.   char nextkey;
  30.   char lines;
  31.   char stop;
  32.   word numlines;
  33.   char findend;
  34.   struct nodeidx nid;
  35.   int cx,cy;
  36.  
  37.   if (kbhit()) {
  38.     nextkey=get_char();
  39.     if (nextkey==CTRL_PGUP || nextkey==CTRL_PGDN) return nextkey;
  40.   }
  41. Toggler:
  42.   highvideo();
  43.   current_color=readtextcolor + (readtextback * 16);
  44.   clear_message();
  45.   dclrwnd(1,6,maxx,maxy-1);
  46.   hold=get_text();
  47.   if (hold==NULL || *hold==0) return 0;
  48.   if(tempo=strstr(hold,"\01URGENT")) {
  49.       strncpy(urgent_text,&tempo[8],79);
  50.       urgent_text[78]=0;
  51.       tempo=strchr(urgent_text,'\r');
  52.       if(tempo)*tempo=0;
  53.       lstrip(urgent_text);
  54.       rstrip(urgent_text);
  55.   }
  56.   else *lastmsgid=0;
  57.   if(!threadstart) {
  58.       if(tempo=strstr(hold,"\01MSGID:")) {
  59.         strncpy(lastmsgid,&tempo[7],80);
  60.         lastmsgid[79]=0;
  61.         tempo=strchr(lastmsgid,'\r');
  62.         if(tempo)*tempo=0;
  63.         lstrip(lastmsgid);
  64.         rstrip(lastmsgid);
  65.       }
  66.       else *lastmsgid=0;
  67.       if(tempo=strstr(hold,"\01REPLY:")) {
  68.         strncpy(lastreply,&tempo[7],80);
  69.         lastreply[79]=0;
  70.         tempo=strchr(lastreply,'\r');
  71.         if(tempo)*tempo=0;
  72.         lstrip(lastreply);
  73.         rstrip(lastreply);
  74.       }
  75.       else *lastreply=0;
  76.   }
  77.   if(tempo=strstr(hold,"\01ASSOC:")) {
  78.     strncpy(assocfile,&tempo[7],80);
  79.     assocfile[132]=0;
  80.     tempo=strchr(assocfile,'\r');
  81.     if(tempo)*tempo=0;
  82.     lstrip(assocfile);
  83.     rstrip(assocfile);
  84.   }
  85.   else *assocfile=0;
  86.  
  87.   if (!ctla) strip_seenbys(hold);
  88.   strip_blanklines(hold);
  89.   if (hold==NULL || &hold==NULL) return 0;
  90.   if (kbhit()) {
  91.     nextkey=get_char();
  92.     if (nextkey==CTRL_PGUP || nextkey==CTRL_PGDN) return nextkey;
  93.   }
  94.   if (messno>*lastmess) *lastmess=messno;
  95.   numlines=0;
  96.   line[0]=hold;
  97.   lines=findend=stop=0;
  98.   cx=1;
  99.   cy=6;
  100.   p=hold;
  101.   while (1) {
  102. Continuing:
  103.    if (currarea->attr & ANSI) {
  104.       while(*p) {
  105.         if(*p=='\01' && !ctla) {
  106.             do {
  107.                 p++;
  108.             }while(*p!='\r' && *p);
  109.             if(p)p++;
  110.             continue;
  111.         }
  112.         fputc(*p++,stdout);
  113.         if(cy>(maxy)) cy=maxy;
  114.         if(cy<6) cy=6;
  115.         if (kbhit()) {
  116.             nextkey=toupper(get_char());
  117.             if (nextkey==32) break;
  118.             if (nextkey==80) {
  119.                 while (!kbhit());
  120.                 get_char();
  121.             }
  122.         }
  123.       }
  124.       printf("\r%s",make_ansi(readtextcolor,readtextback));
  125.       goto ReLoop;
  126.    }
  127.    strcpy(message,write_line(&p,maxx,ctla));
  128.    tempo=message;
  129.  
  130.    if (currarea->attr & MCI) {
  131.       if (strchr(tempo,'^')) {
  132.         caret++;
  133.         tempo=mci(tempo);
  134.         if (strlen(tempo)>maxx) {
  135.             if (!findend) lines+=(strlen(tempo)/maxx)+1;
  136.             numlines+=(strlen(tempo)/maxx)+1;
  137.         }
  138.       }
  139.    }
  140.    if (!findend) {
  141.  
  142.       char altered=0;
  143.  
  144.     if(!hilite) {
  145.  
  146.       if(*tempo=='\01') {    /* Highlight kludge lines */
  147.         current_color=kludge_fore + (kludge_back * 16);
  148.         if(caret) fputs(make_ansi(kludge_fore,kludge_back),stdout);
  149.         altered++;
  150.       }
  151.       else if(isbrktquote(tempo)) {    /* Highlight quotes */
  152.             current_color=quote_fore+(quote_back * 16);
  153.             if(caret)fputs(make_ansi(quote_fore,quote_back),stdout);
  154.             altered++;
  155.       }
  156.       else if(currarea->attr & ECHO) {
  157.         if (!strncmp(tempo," * Origin: ",11)) {    /* Highlight origins */
  158.             current_color=orig_fore+(orig_back * 16);
  159.             if(caret)fputs(make_ansi(orig_fore,orig_back),stdout);
  160.             altered++;
  161.           }
  162.           else if (!strncmp(tempo,"--- ",4) || !strcmp(message,"---")) {
  163.             lowvideo();
  164.             current_color=tear_fore+(tear_back * 16);
  165.             if(caret)fputs(make_ansi(tear_fore,tear_back),stdout);
  166.             altered++;
  167.           }
  168.       }
  169.     }
  170.     if (!caret && !slowprint) {
  171.         dputs(cx,cy,tempo);
  172.         cy++;
  173.     }
  174.     else {
  175.         gotoxy(cx,cy);
  176.         if(slowprint) {
  177.  
  178.             char *p;
  179.             unsigned long t1;
  180.  
  181.           p=tempo;
  182.           while(*p) {
  183.              fputc(*p,stdout);
  184.              t1=(unsigned long)biostime(0,0L)+(unsigned long)slowprint;
  185.              while((unsigned long)biostime(0,0L)<t1 && t1<(unsigned long)biostime(0,0L)+256L);
  186.              p++;
  187.           }
  188.           slowprint=0;
  189.         }
  190.         else fputs(tempo,stdout);
  191.         cy++;
  192.     }
  193.  
  194.     if(altered) {
  195.         highvideo();
  196.         current_color=readtextcolor + (readtextback * 16);
  197.         if(caret)fputs(make_ansi(readtextcolor,readtextback),stdout);
  198.     }
  199.  
  200.     caret=0;
  201.     lines++;
  202.    }
  203.    numlines++;
  204.    if (numlines>=(maxlines-1)) numlines=0;
  205.    line[numlines]=p;
  206. EOFF:
  207.    slowprint=0;
  208.    if (currarea->attr & ANSI) goto ReLoop;
  209.    if ((lines>=(maxy-6)-((currarea->attr & MCI)!=0)) || stop || !*p) {
  210.         if (findend) {
  211.             clear_message();
  212.             findend=0;
  213.             numlines-=(maxy-6);
  214.             p=(char *)line[numlines];
  215.             lines=0;
  216.             goto NewPage;
  217.         }
  218.         stop=0;
  219.         if ((numlines>(maxy-6) && lines<(maxy-6)) && !*p) {
  220.             numlines-=(maxy-6);
  221.             p=(char *)line[numlines];
  222.             lines=0;
  223.             goto NewPage;
  224.         }
  225.        while (kbhit()) get_char();
  226. ReLoop:
  227.        cursor(cx-1,cy-1);
  228.        fputs("\r\x1b[0m",stderr);
  229. RealEnd:
  230.        current_color=readheadcolor + (readheadback * 16);
  231.        if (!*p) dputs(70,3," END");
  232.        else if (numlines<=(maxy-6)) dputs(70,3," TOP");
  233.        else dputs(70,3,"MORE");
  234.        dprintf(75,3,"%u",numlines);
  235. FreeKey:
  236.        if(*urgent_text) {
  237.             _anymsg(" URGENT! ",urgent_text);
  238.             *urgent_text=0;
  239.        }
  240.        nextkey=0;
  241.        current_color=readtextcolor + (readtextback * 16);
  242.        set_help ("readkeys  ",0,23);
  243.        SHOWMOUSE;
  244.        if(usemouse) {    /* Allow to roam full screen */
  245.  
  246.           union REGS rg;
  247.  
  248.            rg.x.ax=7;
  249.            rg.x.cx=0;
  250.            rg.x.dx=((maxx-1)*8);
  251.            int86(0x33,&rg,&rg);
  252.            rg.x.ax=8;
  253.            rg.x.cx=0;
  254.            rg.x.dx=((maxy-1)*8);
  255.            int86(0x33,&rg,&rg);
  256.            wasconfinedx1=0;
  257.            wasconfinedy1=0;
  258.            wasconfinedx2=((maxx-1)*8);
  259.            wasconfinedy2=((maxy-1)*8);
  260.        }
  261.        while(!kbhit()) {
  262.           if(usemouse) {
  263.  
  264.                 union REGS rg;
  265.  
  266.                 rg.x.ax=3;
  267.                 int86(0x33,&rg,&rg);
  268.                 move_mouse(rg.x.cx/8,rg.x.dx/8);
  269.                 rg.x.ax=5;
  270.                 rg.x.bx=0;          /* Check left button */
  271.                 int86(0x33,&rg,&rg);
  272.                 if(rg.x.bx) {       /* Button pressed */
  273.                     rg.x.cx/=8;     /* Mouse x */
  274.                     rg.x.dx/=8;     /* Mouse y */
  275.                     if(rg.x.dx<=1) {
  276.                             nextkey='/';
  277.                             break;
  278.                     }
  279.                     if(rg.x.cx==0 && rg.x.dx==(maxy-1)) {
  280.                         nextkey=PGDN;
  281.                         break;
  282.                     }
  283.                     if(rg.x.cx==(maxx-1) && rg.x.dx==(maxy-1)) {
  284.                         nextkey=PGUP;
  285.                         break;
  286.                     }
  287.                     if(rg.x.dx==3 && rg.x.cx>60) {
  288.                         nextkey=ALT_A;
  289.                         break;
  290.                     }
  291.                     if(rg.x.dx==2 && rg.x.cx>29 && rg.x.cx<44) {
  292.                         nextkey=ALT_L;
  293.                         break;
  294.                     }
  295.                     if(rg.x.dx<4) {
  296.                         nextkey=F7;
  297.                         break;
  298.                     }
  299.                     if(rg.x.dx==4) {
  300.                         nextkey=CTRL_N;
  301.                         break;
  302.                     }
  303.                     nextkey=toupper(get_screen_char(rg.x.cx,rg.x.dx));
  304.                     switch((int)nextkey) {
  305.                         case '':   nextkey=CTRL_PGUP;
  306.                                     break;
  307.                         case 26:    nextkey=CTRL_PGDN;
  308.                                     break;
  309.                         case '':   nextkey=DN;
  310.                                     break;
  311.                         case '':   nextkey=UP;
  312.                                     break;
  313.                         case '≈':    nextkey=CTRL_F6;
  314.                                     break;
  315.                         case 168:   set_help ("mousekeys  ",0,23);
  316.                         case '?':   HIDEMOUSE;
  317.                                     if (helpfunc) {
  318.                                        if (!helping) {
  319.                                          helping=1;
  320.                                          (*helpfunc)();
  321.                                          helping=0;
  322.                                        }
  323.                                     }
  324.                                     SHOWMOUSE;
  325.                                     rg.x.ax=5;
  326.                                     rg.x.bx=0;
  327.                                     int86(0x33,&rg,&rg);    /* Clear buttons */
  328.                                     rg.x.ax=5;
  329.                                     rg.x.bx=1;
  330.                                     int86(0x33,&rg,&rg);    /* Clear buttons */
  331.                                     rg.x.ax=5;
  332.                                     rg.x.bx=2;
  333.                                     int86(0x33,&rg,&rg);    /* Clear buttons */
  334.                                     nextkey=0;
  335.                                     set_help ("readkeys  ",0,23);
  336.                                     break;
  337.                         case '':   nextkey=F6;
  338.                                     break;
  339.                         case 173:   nextkey=CTRL_L;
  340.                                     break;
  341.                         case 251:   nextkey=ALT_L;
  342.                                     break;
  343.                         case '':   nextkey=PGUP;
  344.                                     break;
  345.                         case '':   nextkey=PGDN;
  346.                                     break;
  347.                         case 'φ':   nextkey=CTRL_D;
  348.                                     break;
  349.                         case '≥':   nextkey=CTRL_F;
  350.                                     break;
  351.                         case '≤':   nextkey=CTRL_B;
  352.                                     break;
  353.                         case '':   nextkey=ALT_B;
  354.                                     break;
  355.                         case '':   nextkey=ALT_F;
  356.                                     break;
  357.                     }
  358.                     if(nextkey && nextkey!=' ') break;
  359.                     else nextkey=0;
  360.                 }
  361.                 rg.x.ax=3;
  362.                 int86(0x33,&rg,&rg);
  363.                 move_mouse(rg.x.cx/8,rg.x.dx/8);
  364.                 rg.x.ax=5;          /* Right button */
  365.                 rg.x.bx=1;
  366.                 int86(0x33,&rg,&rg);
  367.                 if(rg.x.bx) {
  368.                     nextkey=ESC;
  369.                     break;
  370.                 }
  371.                 rg.x.ax=3;
  372.                 int86(0x33,&rg,&rg);
  373.                 move_mouse(rg.x.cx/8,rg.x.dx/8);
  374.                 rg.x.ax=5;          /* Middle button */
  375.                 rg.x.bx=2;
  376.                 int86(0x33,&rg,&rg);
  377.                 if(rg.x.bx) {
  378.                     nextkey=PGDN;
  379.                     break;
  380.                 }
  381.           }
  382. #ifdef USECLOCK
  383.           print_clock();
  384. #endif
  385.        }
  386.        HIDEMOUSE;
  387.        if(!nextkey) nextkey=toupper(get_char());
  388.        clear_message();
  389. NotFreeKey:
  390.        current_color=readtextcolor + (readtextback * 16);
  391.        set_help ("readkeys  ",0,23);
  392.        switch ((int)nextkey) {
  393.             case ALT_D: skipdeleted=1-skipdeleted;
  394.                         if(skipdeleted) {
  395.                             _anymsg(" Toggled Deleted View "," OFF ");
  396.                         }
  397.                         else {
  398.                             _anymsg(" Toggled Deleted View "," ON ");
  399.                         }
  400.                         pause();
  401.                         goto FreeKey;
  402.             case CTRL_Q:threadstart=0;
  403.                         show_header(0);
  404.                         goto FreeKey;
  405.             case CTRL_A:load_lastread();
  406.                         goto FreeKey;
  407.             case CTRL_S:save_lastread();
  408.                         goto FreeKey;
  409.             case ALT_X: save_lastread();
  410.                         fputs("\x1b[2J",stdout);
  411.                         exit(0);
  412.             case '/':    nextkey=exec();
  413.                         set_help ("readkeys  ",0,23);
  414.                         if(!nextkey) goto FreeKey;
  415.                         goto NotFreeKey;
  416.             case ' ':    goto FreeKey;
  417.             case ALT_T: select_name();
  418.                         goto ReLoop;
  419.             case ALT_C: select_address();
  420.                         goto ReLoop;
  421.             case ALT_N: if(!nidxsize) {
  422.                             any_message(" No nodelist available. ");
  423.                             nopause();
  424.                         }
  425.                         else node_lister();
  426.                         goto ReLoop;
  427.             case '-':
  428.             case 'P':
  429.             case PGUP:  if (numlines<=(maxy-6)) {
  430.                             nextkey=CTRL_PGUP;
  431.                             goto EndIt;
  432.                         }
  433.                         if (numlines<((maxy * 2)-13)) numlines=0;
  434.                         else numlines-=((maxy * 2)-14);
  435.                         p=(char *)line[numlines];
  436.                         break;
  437.             case '\r':
  438.             case 'N':
  439.             case PGDN:
  440. DoPageDown:
  441.                         if (!*p) {
  442.                             nextkey=CTRL_PGDN;
  443.                             goto EndIt;
  444.                         }
  445.                         break;
  446.             case 24:
  447.             case DN:
  448. DoDown:
  449.                         if (!*p) goto ReLoop;
  450.                         stop++;
  451. DoEnd:
  452.                         dscrollup(1,6,maxx,maxy-1);
  453.                         cx=1;
  454.                         cy=maxy-1;
  455.                         goto Continuing;
  456.             case UP:
  457.                         if (numlines>(maxy-6)) {
  458.                           dscrolldn(1,6,maxx,maxy-1);
  459.                           cx=1;
  460.                           cy=6;
  461.                         }
  462. DoUp:
  463.                         if (numlines>(maxy-6)) {
  464.                           numlines--;
  465.                           p=(char *)line[numlines-(maxy-6)];
  466.                           strcpy(message,write_line(&p,maxx,ctla));
  467.                           dputs(cx,cy,message);
  468.                           p=(char *)line[numlines];
  469.                         }
  470.                         goto ReLoop;
  471.             case 'H':
  472.             case HOME:  p=hold;
  473.                         numlines=0;
  474.                         break;
  475.             case 'E':
  476.             case END:   if (!*p) goto ReLoop;
  477.                         findend++;
  478.                         lines=0;
  479.                         goto Continuing;
  480.             case '+':   _AH=2;
  481.                         _DX=0;
  482.                         geninterrupt(0x17);
  483.                         x=_AH;
  484.                         if (x!=144) {
  485.                             error_message(" Printer not ready ");
  486.                             nopause();
  487.                             goto ReLoop;
  488.                         }
  489.                         if (hold) free(hold);
  490.                         any_message(" Printing ");
  491.                         export("PRN",((currarea->attr & ALTERNATE) ||
  492.                           (currarea->attr & NET)),PRINTIT,"","",NULL);
  493.                         get_mess(0);
  494.                         hold=get_text();
  495.                         if (hold==NULL || &hold==NULL) return 0;
  496.                         if(!ctla) strip_seenbys(hold);
  497.                         strip_blanklines(hold);
  498.                         if (hold==NULL || &hold==NULL) return 0;
  499.                         any_message(" Complete ");
  500.                         nopause();
  501.                         goto ReLoop;
  502.             case ALT_O:    get_origin();
  503.                         goto ReLoop;
  504.             case CTRL_O: usedefault=1-usedefault;
  505.                          if(usedefault) any_message(" Always using default origin line");
  506.                          else any_message(" Looking up origin lines in ORIGINS.BBS ");
  507.                          nopause();
  508.                          goto ReLoop;
  509.             case CTRL_W: wrapit=1-wrapit;
  510.                          if(wrapit || !wrapcall) _anymsg(" Toggled Wrapping "," OFF ");
  511.                          else _anymsg(" Toggled Wrapping "," ON ");
  512.                          nopause();
  513.                          goto ReLoop;
  514.             case ALT_J:     do_spawn("");
  515.                          goto ReLoop;
  516.             case ALT_F1:
  517.             case ALT_F2:
  518.             case ALT_F3:
  519.             case ALT_F4:
  520.             case ALT_F5:
  521.             case ALT_F6:
  522.             case ALT_F7:
  523.             case ALT_F8:
  524.             case ALT_F9:
  525.             case ALT_F10: do_spawn(convertstring(fkey[nextkey-ALT_F1]));
  526.                           goto ReLoop;
  527.             case '>':
  528.             case '<':   if (type) goto ReLoop;
  529.             case LEFT:
  530.             case RIGHT:
  531.             case CTRL_PGDN:
  532.             case CTRL_PGUP:
  533.             case F10:
  534.             case 81:
  535.             case ESC:
  536.             case F9:
  537.             case F8:
  538.             case F7:
  539.             case F6:
  540.             case 82:
  541.             case F5:
  542.             case 'W':
  543.             case F4:
  544.             case F3:
  545.             case F2:
  546.             case ALT_L:
  547.             case CTRL_K:
  548.             case CTRL_L:
  549.             case CTRL_E:
  550.             case ALT_1:
  551.             case ALT_2:
  552.             case ALT_3:
  553.             case ALT_4:
  554.             case ALT_5:
  555.             case ALT_6:
  556.             case ALT_7:
  557.             case ALT_8:
  558.             case ALT_9:
  559.             case ALT_0:
  560.             case '1':
  561.             case '2':
  562.             case '3':
  563.             case '4':
  564.             case '5':
  565.             case '6':
  566.             case '7':
  567.             case '8':
  568.             case '9':
  569.             case '0':
  570.             case CTRL_R:
  571.             case CTRL_F1:
  572.             case CTRL_F2:
  573.             case CTRL_F3:
  574.             case CTRL_F4:
  575.             case CTRL_F5:
  576.             case CTRL_F6:
  577.             case CTRL_F7:
  578.             case ALT_Q:
  579.             case ALT_A:     goto EndIt;
  580.             case ALT_F:
  581.             case ALT_B:
  582.             case CTRL_F:
  583.             case CTRL_B:    if(!threadstart) threadstart=messno;
  584.                             goto EndIt;
  585.             case CTRL_N:    nid.node=msg.orig;
  586.                             nid.net=msg.orig_net;
  587.                             nid.zone=msg.o_zone;
  588.                             nid.type=255;
  589.                             nodelist(&nid,0);
  590.                             nopause();
  591.                             delete_window(wnd6);
  592.                             goto ReLoop;
  593.             case CTRL_T:    ctla=1-ctla;
  594.                             if (hold) free(hold);
  595.                             goto Toggler;
  596.             case 'V':        if(!*assocfile) any_message (" No Associated File ");
  597.                             else if((!strchr(assocfile,':') && !strchr(assocfile,'\\')) && !find_filearea()) any_message(" Associated File Area not found ");
  598.                             else {
  599.  
  600.                                 struct ffblk f;
  601.                                 char temp[163];
  602.  
  603.                                 if(strchr(assocfile,':') || strchr(assocfile,'\\')) strcpy(temp,assocfile);
  604.                                 else sprintf(temp,"%s%s",filepath,assocfile);
  605.                                 if(!findfirst(temp,&f,0)) {
  606.                                     if(strchr(assocfile,':') || strchr(assocfile,'\\')) sprintf(temp," %s  %lu bytes ",assocfile,f.ff_fsize);
  607.                                     else sprintf(temp," %s%-13s  %lu bytes ",filepath,f.ff_name,f.ff_fsize);
  608.                                     any_message(temp);
  609.                                     if(*spawnview) {
  610.                                         if(strchr(assocfile,':') || strchr(assocfile,'\\')) strcpy(temp,assocfile);
  611.                                         else sprintf(temp,"%s%s",filepath,assocfile);
  612.                                         sprintf(buffer,"%s %s",spawnview,temp);
  613.                                         do_spawn(buffer);
  614.                                         goto ReLoop;
  615.                                     }
  616.                                 }
  617.                                 else any_message(" Associated file not found ");
  618.                             }
  619.                             nopause();
  620.                             goto ReLoop;
  621.             case CTRL_D:    if(msg.m_attr & MSGKEEP) bell();
  622.                             else {
  623.                                 msg.m_attr = msg.m_attr ^ MSGDELETED;
  624.                                 put_mess();
  625.                                 if (msg.m_attr & MSGDELETED) {
  626.                                     any_message(" Deleted. ");
  627.                                     if(*assocfile) {
  628.                                         if (find_filearea() || strchr(assocfile,':') || strchr(assocfile,'\\')) {
  629.  
  630.                                             struct ffblk f;
  631.                                             char temp[158];
  632.  
  633.                                             if(strchr(assocfile,':') || strchr(assocfile,'\\')) strcpy(temp,assocfile);
  634.                                             else sprintf(temp,"%s%s",filepath,assocfile);
  635.                                             if(!findfirst(temp,&f,0)) {
  636.                                                 sprintf(temp," Delete %s? (Y-n) ",assocfile);
  637.                                                 any_message(temp);
  638. DeleteLoop:
  639.                                                 nextkey=toupper(generic_mouse_input(ewnd));
  640.                                                 if(nextkey=='Y' || nextkey==13) {
  641.                                                     if(strchr(assocfile,':') || strchr(assocfile,'\\')) strcpy(temp,assocfile);
  642.                                                     else sprintf(temp,"%s%s",filepath,assocfile);
  643.                                                     unlink(temp);
  644.                                                     sprintf(temp," %s is dead. ",assocfile);
  645.                                                     any_message(temp);
  646.                                                 }
  647.                                                 else if (nextkey!='N' && nextkey!=27) {
  648.                                                     bell();
  649.                                                     goto DeleteLoop;
  650.                                                 }
  651.                                                 else any_message(" File remains ");
  652.                                             }
  653.                                         }
  654.                                     }
  655.                                 }
  656.                                 else any_message(" UnDeleted. ");
  657.                                 nopause();
  658.                             }
  659.                             goto ReLoop;
  660.             case CTRL_END:    messno=nomess;
  661.                             get_mess(0);
  662.                             return CTRL_END;
  663.             case CTRL_HOME:    messno=1;
  664.                             get_mess(0);
  665.                             return CTRL_HOME;
  666.             default:        bell();
  667.                             goto ReLoop;
  668.         }
  669. NewPage:
  670.         dclrwnd(1,6,maxx,maxy-1);
  671.         cx=1;
  672.         cy=6;
  673.         lines=0;
  674.     }
  675.     if(cy>(maxy-1)) {
  676.         cy=(maxy-1);
  677.         dscrollup(1,6,maxx,maxy-1);
  678.     }
  679.   }
  680. EndIt:
  681.   if (hold) free(hold);
  682.   if(msg.attr & MSGRRQ) do_recpt();
  683.   return (int)nextkey;
  684. }
  685.  
  686.