home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / Dloads / WWIVMODS / MODSUNKN.ZIP / PREVLINE.C < prev    next >
Text File  |  1990-10-12  |  6KB  |  158 lines

  1. First, load up FCNS.H and make the following change (note: - designates
  2. existing code, + designates new or modified code.  The & symbol indicates
  3. lines that were split by the message editor to make it fit into the 80
  4. column width.  All these should be removed before trying to compile.  They
  5. are there to make your life easier):
  6.  
  7. - char *mmkey(int dl);
  8. + int inli2(char *s, char *rollover, int maxlen, int crend, int wb); /* mod -
  9. & add */
  10. - void inli(char *s, char *rollover, int maxlen, int crend);
  11. - void getuser();
  12.  
  13. Now, load up BBSUTL.C and add the following external variable declaration at
  14. the top of the file:
  15.  
  16. - extern char charbuffer[161];
  17. - extern userrec thisuser;
  18. + extern int charbufferpointer,chatting,curatr;              /* mod - change */
  19. - extern int usernum,useron,num_sec,helpl;
  20.  
  21. Now find the inli(..) void to and rename it to inli2(..), and make the
  22. following changes to it.  Note also that it is being changed from a void to an
  23. int function:
  24.  
  25. + int inli2(char *s, char *rollover, int maxlen, int crend, int wb) /* mod -
  26. & change */
  27. - {
  28. -   int cp,i,i1,done,cm,begx;
  29. -   char s1[255];
  30. -   unsigned char ch;
  31.  
  32. And a little farther down in the code:
  33.  
  34. -                   backspace();
  35. -                 }
  36. +             } else                                       /* mod - change */
  37. +               if (wb) {                                  /* mod - add */
  38. +                 i=curatr;                                /* mod - add */
  39. +                 ansic(3);                                /* mod - add */
  40. +                 pl("[*> Previous Line <*]");             /* mod - add */
  41. +                 setc(i);                                 /* mod - add */
  42. +                 return(1);                               /* mod - add */
  43. +               }                                          /* mod - add */
  44. -             break;
  45. -           case 24: /* Ctrl-X */
  46.  
  47. And at the very bottom of the function:
  48.  
  49. -   }
  50. -   if (crend)
  51. -     nl();
  52. +   return(0);                                               /* mod - add */
  53. - }
  54.  
  55. Then, add a replacement inli function as shown.  This will allow other mods to
  56. call this function in the same way they always have:
  57.  
  58. + void inli(char *s, char *rollover, int maxlen, int crend) /* mod - change
  59. & entire void */
  60. + {
  61. +   inli2(s,rollover,maxlen,crend,0);
  62. + }
  63.  
  64. - void getuser()
  65.  
  66. Next, load COM.C and make the following change in char inkey() to fix the
  67. problem with changing colors in the line:
  68.  
  69. -   if (charbufferpointer) {
  70. -     if (!charbuffer[charbufferpointer])
  71. -       charbufferpointer = charbuffer[0] = 0;
  72. +     else {                                                 /* mod - change */
  73. +       if ((charbuffer[charbufferpointer])==3)              /* mod - add */
  74. +         charbuffer[charbufferpointer]=16;                  /* mod - add */
  75. -       return(charbuffer[charbufferpointer++]);
  76. +     }                                                      /* mod - add */
  77. -   }
  78.  
  79. OK, now for the change to MSGBASE.C to allow the user to actually to the
  80. backspace.  Make the following changes in void inmsg(...):
  81.  
  82. -     while (!done) {
  83. -       helpl=27;
  84. +       while (inli2(s,ro,160,1,curli)) {         /* mod - change */
  85. +         --curli;                                /* mod - add */
  86. +         strcpy(ro,&(lin[(curli)*LEN]));         /* mod - add */
  87. +         if (strlen(ro)>thisuser.screenchars-1)  /* mod - add */
  88. +           ro[thisuser.screenchars-2]=0;         /* mod - add */
  89. +       }                                         /* mod - add */
  90. -       if (hangup)
  91. -         done=1;
  92. -       savel=1;
  93.  
  94. And one more change in XFER.C to allow the user to back up when entering the
  95. extended file description in void modify_extended_description(...).  The first
  96. part is in the variable declarations:
  97.  
  98. - void modify_extended_description(char **sss)
  99. - {
  100. -   char s[161],s1[161];
  101. +   int f,ii,i,i1,i2,i3;                           /* mod - change */
  102. -
  103. -   if (*sss)
  104.  
  105. Then, a little farther down in the code:
  106.  
  107. -       i=1;
  108. +       i3=0;                                              /* mod - add */
  109. -       nl();
  110. -       sprintf(s,"Enter up to %d lines, %d chars
  111. & each.",MAX_LINES,78-INDENTION);
  112. -       pl(s);
  113. -       nl();
  114. -       s[0]=0;
  115. -       i1=thisuser.screenchars;
  116. -       if (thisuser.screenchars>(76-INDENTION))
  117. -         thisuser.screenchars=76-INDENTION;
  118. -       do {
  119. -         itoa(i,s1,10);
  120. -         strcat(s1,": ");
  121. -         prt(2,s1);
  122. -         s1[0]=0;
  123. +         while (inli2(s1,s,90,1,i3)) {              /* mod - change */
  124. +           --i;                                     /* mod - add */
  125. +           itoa(i,s1,10);                           /* mod - add */
  126. +           strcat(s1,": ");                         /* mod - add */
  127. +           prt(2,s1);                               /* mod - add */
  128. +           i2=0;                                    /* mod - add */
  129. +           i3-=2;                                   /* mod - add */
  130. +           do {                                     /* mod - add */
  131. +             s[i2]=*(sss[0]+i3-1);                  /* mod - add */
  132. +             ++i2;                                  /* mod - add */
  133. +             --i3;                                  /* mod - add */
  134. +           } while ((*(sss[0]+i3)!=10) && (i3!=0)); /* mod - add */
  135. +           if (i3)                                  /* mod - add */
  136. +             ++i3;                                  /* mod - add */
  137. +           *(sss[0]+i3)=0;                          /* mod - add */
  138. +           s[i2]=0;                                 /* mod - add */
  139. +           strrev(s);                               /* mod - add */
  140. +           if (strlen(s)>thisuser.screenchars-1)    /* mod - add */
  141. +             s[thisuser.screenchars-2]=0;           /* mod - add */
  142. +         }                                          /* mod - add */
  143. -         i2=strlen(s1);
  144. -         if (i2 && (s1[i2-1]==1))
  145. -           s1[i2-1]=0;
  146. -         if (s1[0]) {
  147. -           strcat(s1,"En");
  148. +           i3+=strlen(s1);                         /* mod - add */
  149. -           strcat(*sss,s1);
  150. -         }
  151. -       } while ((i++<10) && (s1[0]));
  152.  
  153. (NOTE: There may have been an easier way to accomplish this part of the code,
  154. but I sure can't figure it out!).
  155.  
  156. That's it.  You will need to recompile the entire BBS due to the change to
  157. FCNS.H.
  158.