[BACK]Return to theo.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / mg

Diff for /src/usr.bin/mg/Attic/theo.c between version 1.80 and 1.81

version 1.80, 2005/03/09 11:11:52 version 1.81, 2005/04/03 02:09:28
Line 28 
Line 28 
 #include "kbd.h"  #include "kbd.h"
 #include "funmap.h"  #include "funmap.h"
   
 void theo_init(void);  void            theo_init(void);
 static int      theo_analyze(int, int);  static int      theo_analyze(int, int);
 static int      theo(int, int);  static int      theo(int, int);
   
 static PF theo_pf[] = {  static PF theo_pf[] = {
         theo_analyze,          theo_analyze
 };  };
   
 static struct KEYMAPE (1 + IMAPEXT) theomap = {  static struct KEYMAPE (1 + IMAPEXT) theomap = {
Line 41 
Line 41 
         1 + IMAPEXT,          1 + IMAPEXT,
         rescan,          rescan,
         {          {
                 { CCHR('M'), CCHR('M'), theo_pf, NULL },                  { CCHR('M'), CCHR('M'), theo_pf, NULL }
         }          }
 };  };
   
Line 57 
Line 57 
 static int  static int
 theo(int f, int n)  theo(int f, int n)
 {  {
         BUFFER *bp;          BUFFER  *bp;
         MGWIN *wp;          MGWIN   *wp;
   
         bp = bfind("theo", TRUE);          bp = bfind("theo", TRUE);
         if (bclear(bp) != TRUE)          if (bclear(bp) != TRUE)
                 return FALSE;                  return (FALSE);
   
         bp->b_modes[0] = name_mode("fundamental");          bp->b_modes[0] = name_mode("fundamental");
         bp->b_modes[1] = name_mode("theo");          bp->b_modes[1] = name_mode("theo");
         bp->b_nmodes = 1;          bp->b_nmodes = 1;
   
         if ((wp = popbuf(bp)) == NULL)          if ((wp = popbuf(bp)) == NULL)
                 return FALSE;                  return (FALSE);
   
         tbuf = curbp = bp;          tbuf = curbp = bp;
         curwp = wp;          curwp = wp;
         return TRUE;          return (TRUE);
 }  }
   
 static const char *talk[] = {  static const char *talk[] = {
Line 178 
Line 178 
 static int  static int
 theo_analyze(int f, int n)  theo_analyze(int f, int n)
 {  {
         const char *str;          const char      *str;
         int len;          int              len;
   
         str = talk[arc4random() % ntalk];          str = talk[arc4random() % ntalk];
         len = strlen(str);          len = strlen(str);
   
         newline(FFRAND, 2);          newline(FFRAND, 2);
   
         while (len--) {          while (len--)
                 linsert(1, *str++);                  linsert(1, *str++);
         }  
   
         newline(FFRAND, 2);          newline(FFRAND, 2);
   
         return TRUE;          return (TRUE);
 }  }

Legend:
Removed from v.1.80  
changed lines
  Added in v.1.81