home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_100 / 119_01 / tabs.c < prev    next >
C/C++ Source or Header  |  1984-07-13  |  5KB  |  127 lines

  1. /* Tabs.C extra mince commands to set and clear tab stops at irregular
  2.    intervals. Contributed to AUG by Mark of the Unicorn 07/20/81 */
  3.  
  4. /* BINDINGS.C - Set up the key bindings for Mince
  5.  
  6. The seller of this software hereby disclaims any and all
  7. guarantees and warranties, both express and implied.  No
  8. liability of any form shall be assumed by the seller, nor shall
  9. direct, consequential, or other damages be assumed by the seller.
  10. Any user of this software uses it at his or her own risk.
  11.  
  12. Due to the ill-defined nature of "fitness for purpose" or similar
  13. types of guarantees for this type of product, no fitness for any
  14. purpose whatsoever is claimed or implied.
  15.  
  16. The physical medium upon which the software is supplied is
  17. guaranteed for one year against any physical defect.  If it
  18. should fail, return it to the seller, and a new physical medium
  19. with a copy of the purchased software shall be sent.
  20.  
  21. The seller reserve the right to make changes, additions, and
  22. improvements to the software at any time; no guarantee is made
  23. that future versions of the software will be compatible with any
  24. other version.
  25.  
  26. The parts of this disclaimer are severable and fault found in any
  27. one part does not invalidate any other parts.
  28.  
  29.     Copyright (c) 1981 by Mark of the Unicorn
  30.     Created for Version 2.3  10/4/80  JTL
  31.     Updated to version three  1/7/81  JTL
  32.  
  33.     This file contains the function table initializers and mode set up
  34. functions */
  35.  
  36. #include "mince.gbl"
  37.  
  38. finit1()            /* initialize the control and self insert key bindings */
  39. {
  40.     int cnt;
  41.     int MInsert(), MSetMrk(), MBegLin(), MPrevChar();
  42.     int MNotImpl(), MDelChar(), MEndLin(), MNextChar();
  43.     int MAbort(), MDelLin(), NewDsp(), MNewLin();
  44.     int MNextLin(), MOpenLin(), MPrevLin(), MQuote();
  45.     int MRSearch(), MSearch(), MSwapChar(), MArg();
  46.     int MNextPage(), MDelRgn(), MCtrlX(), MYank();
  47.     int MMeta(), MDelIndent(), MRDelChar(), MIndent();
  48. /*    int MTab(); */
  49.  
  50.     for (cnt=0; cnt<128; ++cnt) functs[cnt] = &MInsert;
  51.     TKbChk();
  52.     functs[0] = &MSetMrk;        /* C-@ */
  53.     functs[1] = &MBegLin;        /* C-A */
  54.     functs[2] = &MPrevChar;        /* C-B */
  55.     functs[3] = &MNotImpl;        /* C-C */
  56.     functs[4] = &MDelChar;        /* C-D */
  57.     functs[5] = &MEndLin;        /* C-E */
  58.     functs[6] = &MNextChar;        /* C-F */
  59.     functs[7] = &MAbort;        /* C-G */
  60.     functs[8] = &MRDelChar;        /* C-H */
  61. /*    functs[9] = &MTab;            /* C-I */ */
  62.     functs[10] = &MIndent;        /* C-J */
  63.     functs[11] = &MDelLin;        /* C-K */
  64.     functs[12] = &NewDsp;        /* C-L */
  65.     functs[13] = &MNewLin;        /* C-M */
  66.     functs[14] = &MNextLin;        /* C-N */
  67.     functs[15] = &MOpenLin;        /* C-O */
  68.     functs[16] = &MPrevLin;        /* C-P */
  69.     functs[17] = &MQuote;        /* C-Q */
  70.     functs[18] = &MRSearch;        /* C-R */
  71.     functs[19] = &MSearch;        /* C-S */
  72.     functs[20] = &MSwapChar;        /* C-T */
  73.     functs[21] = &MArg;            /* C-U */
  74.     functs[22] = &MNextPage;        /* C-V */
  75.     functs[23] = &MDelRgn;        /* C-W */
  76.     functs[24] = &MCtrlX;        /* C-X */
  77.     functs[25] = &MYank;        /* C-Y */
  78.     functs[26] = &MNotImpl;        /* C-Z */
  79.     functs[ESC] = &MMeta;        /* ESC */
  80.     functs[28] = &MDelIndent;    /* C-\ */
  81.     functs[29] = &MNotImpl;        /* C-] */
  82.     functs[30] = &MNotImpl;        /* C-^ */
  83.     functs[31] = &MNotImpl;        /* C-_ */
  84.     functs[DEL] = &MRDelChar;    /* DEL */
  85.     }
  86.  
  87. finit2()            /* set up the Meta key bindings */
  88. {
  89.     int cnt;
  90.     int MNotImpl(), MAbort(), MDelELin(), MQryRplc();
  91.     int MMakeDel(), MToStart(), MToEnd(), MBSent();
  92.     int BWord(), MCapWord(), MDelWord(), MFSent();
  93.     int FWord(), MMrkPara(), MDelSent(), MLowWord();
  94.     int MFillPara(), MReplace(), MCntrLine(), MUpWord();
  95.     int MPrevPage(), MCopyRgn(), MBPara(), MDelWhite();
  96.     int MFPara(), MRDelWord(), MSetMrk(), MSwapWord();
  97. /**/ int MScrnSiz();
  98.  
  99.     for (cnt=128; cnt<256; ++cnt) functs[cnt] = &MNotImpl;
  100.     TKbChk();
  101.     functs[128+7] = &MAbort;                    /* M-C-G */
  102.     functs[128+8] = &MRDelWord;                /* M-C-H */
  103.     functs[128+11] = &MDelELin;                /* M-C-K */
  104.     functs[128+18] = &MQryRplc;                /* M-C-R */
  105. /**/ functs[128+19] = &MScrnSiz;                /* M-C-S */
  106.     functs[128+23] = &MMakeDel;                /* M-C-W */
  107.     functs[128+'<'] = &MToStart;                /* M-< */
  108.     functs[128+'>'] = &MToEnd;                /* M-> */
  109.     functs[128+' '] = &MSetMrk;                /* M-  */
  110.     functs[128+'A']=functs[128+'a'] = &MBSent;    /* M-A */
  111.     functs[128+'B']=functs[128+'b'] = &BWord;    /* M-B */
  112.     functs[128+'C']=functs[128+'c'] = &MCapWord;    /* M-C */
  113.     functs[128+'D']=functs[128+'d'] = &MDelWord;    /* M-D */
  114.     functs[128+'E']=functs[128+'e'] = &MFSent;    /* M-E */
  115.     functs[128+'F']=functs[128+'f'] = &FWord;    /* M-F */
  116.     functs[128+'H']=functs[128+'h'] = &MMrkPara;    /* M-H */
  117.     functs[128+'K']=functs[128+'k'] = &MDelSent;    /* M-K */
  118.     functs[128+'L']=functs[128+'l'] = &MLowWord;    /* M-L */
  119.     functs[128+'Q']=functs[128+'q'] = &MFillPara;/* M-Q */
  120.     functs[128+'R']=functs[128+'r'] = &MReplace;    /* M-R */
  121.     functs[128+'S']=functs[128+'s'] = &MCntrLine;/* M-S */
  122.     functs[128+'T']=functs[128+'t'] = &MSwapWord;/* M-T */
  123.     functs[128+'U']=functs[128+'u'] = &MUpWord;    /* M-U */
  124.     functs[128+'V']=functs[128+'v'] = &MPrevPage;/* M-V */
  125.     functs[128+'W']=functs[128+'w'] = &MCopyRgn;    /* M-W */
  126.     functs[128+'['] = &MBPara;                /* M-[ */
  127.     functs[128+'\\'] = &MDelWhite;            /* M-\