home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / xmmx.zip / source / mmm_cfg.cpp < prev    next >
C/C++ Source or Header  |  1996-12-23  |  50KB  |  1,256 lines

  1. /**************************
  2. *  mmm.cfg file creator   *
  3. * Creates default config. *
  4. ***************************/
  5. //&<<&Headers
  6. #include <stdio.h>
  7. #include <stdlib.h>
  8. #include <string.h>
  9. //&>>&2 0 2 0
  10. #include "mmmconst.h"
  11.  
  12. //&<<&void putExtensions(FILE *fptr);
  13. void putExtensions(FILE *fptr){
  14.     fprintf(fptr,"&<<&*EXTENSIONS*\n");
  15.     fprintf(fptr,"cpp //\nc //\nhpp //\nh //\n"); // c/c++
  16.     fprintf(fptr,"tex %%\nsty %%\n");               // TeX
  17.     fprintf(fptr,"prg //\nch  //\nrmk #\n");      // Clipper
  18.     fprintf(fptr,"bat @Rem -\nsys rem -\n");      // MSDOS config
  19.     fprintf(fptr,"lsp ;\nasm ;\n");               // Lsp, asm
  20.     fprintf(fptr,"conf #\n");                     // Linux ".conf"
  21.     fprintf(fptr,"mif #\n");                      // makefiles
  22.     fprintf(fptr," #\n");
  23.     fprintf(fptr,"&>>&0 0 0 0\n");
  24.     }
  25. //&>>&A 0 A 4
  26. //&<<&void putKeyboardLayouts(FILE *fptr);
  27. //&<<&void pkl_PrintTable(FILE *fptr, char *keys[]){
  28. void pkl_PrintTable(FILE *fptr, char *keys[]){
  29.     int i;
  30.     for(i=0;i<4;i++) fprintf(fptr,"%s\n",keys[i]);
  31.     }
  32. //&>>&2 0 2 0
  33. void putKeyboardLayouts(FILE *fptr){
  34.     int etype=100;
  35.     while(etype!=0 && etype!=1 && etype!=2 && etype!=3 && etype!=4 ){
  36.         printf("Keyboard layout (0-ALT, 1-KOI8, 2-ISO, 3-WIN, 4-X11) :");
  37.         scanf("%d",&etype);
  38.         }
  39.  
  40.     fprintf(fptr,"&<<&*KEYMAP*\n");
  41.     if(etype==0){
  42. //&<<&        Alt enc. (dos, os2)
  43.     char *altCase="aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ"
  44.           "áÇíüóéúâñäÑàªåºç¿ê⌐ë¬è½ï¼î¡ì«Ä»ÅαÉßæΓÆπôΣöσòµûτùΦÿΘÖ∞£δ¢ΩÜφ¥ε₧∩ƒ";
  45.  
  46.     char *keys[]={                   /*  size = 4x108  */
  47.       "....1!2@3#4$5%6^7&8*9(0)-_=+"                    // 0..13
  48.       "....qQwWeErRtTyYuUiIoOpP[{]}"                    // 14..27
  49.       "....aAsSdDfFgGhHjJkKlL;:'\"`~"                   // 28..41
  50.       "..\\|zZxXcCvVbBnNmM,<.>/?",                      // 42..53
  51.  
  52.       "....1!2@3#4$5%6^7&8*9(0)-_=+"                    // 0..13
  53.       "....∩ƒóéÑàαÉΓÆδ¢πô¿ê«Ä»ÅΦÿΘÖ"                    // 14..27
  54.       "....áÇßæñäΣöúâσò⌐ë¬è½ïΩÜφ¥`~"                    // 28..41
  55.       "..\\|ºç∞£µûªåíü¡ì¼îτùε₧/?",                      // 42..53
  56.  
  57.       "....1!2@3#4$5%6^7&8*9(0)-_=+"                    // 0..13
  58.       "....⌐ëµûπô¬èÑà¡ìúâΦÿΘÖºçσòΩÜ"                    // 14..27
  59.       "....Σöδ¢óéáÇ»ÅαɫĽïñäªåφ¥`~"                    // 28..41
  60.       "..\\|∩ƒτùßæ¼î¿êΓÆ∞£íüε₧/?",                      // 42..53
  61.  
  62.       "....≡±≥≤⌠⌡÷≈°∙·√ⁿ²......■■.."                    // 0..13
  63.       "....┌╒┬╤┐╕╓╔╥╦╖╗..▀▀░░▒▒▓▓██"                    // 14..27
  64.       "....├╞┼╪┤╡╟╠╫╬╢╣▌▌▐▐││║║─═.."                    // 28..41
  65.       "....└╘┴╧┘╛╙╚╨╩╜╝▄▄......"                        // 42..53
  66.       };
  67.  
  68. //&>>&0 0 0 0
  69.         fprintf(fptr,"%s\n", altCase);
  70.         pkl_PrintTable(fptr, keys);
  71.         }
  72.     if(etype==1){
  73. //&<<&        KOI8
  74.     char *altCase="aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ"
  75.           "┴ß┬Γ╫≈╟τ─Σ┼σ╓÷┌·╔Θ╩Ω╦δ╠∞═φ╬ε╧∩╨≡╥≥╙≤╘⌠╒⌡╞µ╚Φ├π▐■█√▌²╪°┘∙▀ ▄ⁿ└α╤±";
  76.  
  77.     char *keys[]={      /* size = 4x108 */
  78.       "....1!2@3#4$5%6^7&8*9(0)-_=+"                    //  0..13
  79.       "....qQwWeErRtTyYuUiIoOpP[{]}"                    // 14..27
  80.       "....aAsSdDfFgGhHjJkKlL;:'\"`~"                   // 28..41
  81.       "..\\|zZxXcCvVbBnNmM,<.>/?",                      // 42..53
  82.  
  83.       "....1!2@3#4$5%6^7&8*9(0)-_=+"                    //  0..13
  84.       "....╤±╫≈┼σ╥≥╘⌠┘∙╒⌡╔Θ╧∩╨≡█√▌²"                    // 14..27
  85.       "....┴ß╙≤─Σ╞µ╟τ╩Ω╚Φ╦δ╠∞▀ ▄ⁿ`~"                    // 28..41
  86.       "..\\|┌·╪°╙≤╫≈┬Γ╬ε═φ▐■└α/?",                      // 42..53
  87.  
  88.       "....1!2@3#4$5%6^7&8*9(0)-_=+"                    //  0..13
  89.       "....╩Ω├π╒⌡╦δ┼σ╬ε╟τ█√▌²┌·╚Φ▀ "                    // 14..27
  90.       "....╞µ┘∙╫≈┴ß╨≡╥≥╧∩╠∞─Σ╓÷▄ⁿ`~"                    // 28..41
  91.       "..\\|╤±▐■╙≤═φ╔Θ╘⌠╪°┬Γ└α/?",                      // 42..53
  92.  
  93.       "......Öÿô¢ƒù£...........öö.."                    //  0..13
  94.       "....éóê╢âªñÑ╖╕º¿..ïïÉÉææÆÆìì"                    // 14..27
  95.       "....å»è╝ç▓░▒╜╛┤╡ÄÄÅÅüüííÇá.."                    // 28..41
  96.       "....ä⌐ë╣༬½║╗¡«îî......"                        // 42..53
  97.  
  98.       };
  99. //&>>&0 0 0 8
  100.         fprintf(fptr,"%s\n", altCase);
  101.         pkl_PrintTable(fptr, keys);
  102.         }
  103.     if(etype==2){
  104. //&<<&        ISO
  105.     char *altCase="aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ"
  106.           "╨░╤▒╥▓╙│╘┤╒╡╓╢╫╖╪╕┘╣┌║█╗▄╝▌╜▐╛▀┐α└ß┴Γ┬π├Σ─σ┼µ╞τ╟Φ╚Θ╔∞╠δ╦Ω╩φ═ε╬∩╧";
  107.  
  108.     char *keys[]={      /* size = 4x108 */
  109.       "....1!2@3#4$5%6^7&8*9(0)-_=+"                    //  0..13
  110.       "....qQwWeErRtTyYuUiIoOpP[{]}"                    // 14..27
  111.       "....aAsSdDfFgGhHjJkKlL;:'\"`~"                   // 28..41
  112.       "..\\|zZxXcCvVbBnNmM,<.>/?",                      // 42..53
  113.  
  114.       "....1!2@3#4$5%6^7&8*9(0)-_=+"                    //  0..13
  115.       "....∩╧╥▓╒╡α└Γ┬δ╦π├╪╕▐╛▀┐Φ╚Θ╔"                    // 14..27
  116.       "....╨░ß┴╘┤Σ─╙│σ┼┘╣┌║█╗Ω╩φ═`~"                    // 28..41
  117.       "..\\|╫╖∞╠ß┴╥▓╤▒▌╜▄╝τ╟ε╬/?",                      // 42..53
  118.  
  119.       "....1!2@3#4$5%6^7&8*9(0)-_=+"                    //  0..13
  120.       "....┘╣µ╞π├┌║╒╡▌╜╙│Φ╚Θ╔╫╖σ┼Ω╩"                    // 14..27
  121.       "....Σ─δ╦╥▓╨░▀┐α└▐╛█╗╘┤╓╢φ═`~"                    // 28..41
  122.       "..\\|∩╧τ╟ß┴▄╝╪╕Γ┬∞╠╤▒ε╬/?",                      // 42..53
  123.  
  124.       "............................"                    //  0..13
  125.       "............................"                    // 14..27
  126.       "............................"                    // 28..41
  127.       "........................"                        // 42..53
  128.  
  129.       };
  130. //&>>&17 0 14 0
  131.         fprintf(fptr,"%s\n", altCase);
  132.         pkl_PrintTable(fptr, keys);
  133.         }
  134.     if(etype==3){
  135. //&<<&        WIN    (w95)
  136.     char *altCase="aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ"
  137.           "áÇíüóéúâñäÑàªåºç¿ê⌐ë¬è½ï¼î¡ì«Ä»ÅαÉßæΓÆπôΣöσòµûτùΦÿΘÖ∞£δ¢ΩÜφ¥ε₧∩ƒ";
  138.  
  139.     char *keys[]={      /* size = 4x108 */
  140.       "....1!2@3#4$5%6^7&8*9(0)-_=+"                    // 0..13
  141.       "....qQwWeErRtTyYuUiIoOpP[{]}"                    // 14..27
  142.       "....aAsSdDfFgGhHjJkKlL;:'\"`~"                   // 28..41
  143.       "..\\|zZxXcCvVbBnNmM,<.>/?",                      // 42..53
  144.  
  145.       "....1!2@3#4$5%6^7&8*9(0)-_=+"                    // 0..13
  146.       ".... ▀Γ┬σ┼≡╨≥╥√█≤╙Φ╚ε╬∩╧°╪∙┘"                    // 14..27
  147.       "....α└±╤Σ─⌠╘π├⌡╒Θ╔Ω╩δ╦·┌²▌`~"                    // 28..41
  148.       "..\\|τ╟ⁿ▄÷╓µ╞ß┴φ═∞╠≈╫■▐/?",                      // 42..53
  149.  
  150.       "....1!2@3#4$5%6^7&8*9(0)-_=+"                    // 0..13
  151.       "....Θ╔÷╓≤╙Ω╩σ┼φ═π├°╪∙┘τ╟⌡╒·┌"                    // 14..27
  152.       "....⌠╘√█Γ┬α└∩╧≡╨ε╬δ╦Σ─µ╞²▌`~"                    // 28..41
  153.       "..\\| ▀≈╫±╤∞╠Φ╚≥╥ⁿ▄ß┴■▐/?",                      // 42..53
  154.  
  155.       "....░▒▓│┤╡╢╖╕╣║╗╝╜......╛╛.."                    // 0..13
  156.       "....¬ÑÆíÅêªÖó¢çï..»»ÇÇüüéé½½"                    // 14..27
  157.       "....ôûò¿äàù£º₧åë¡¡««ââèèö¥.."                    // 28..41
  158.       "....Éñæƒ⌐ÄúÿáÜìî¼¼......"                        // 42..53
  159.       };
  160.  
  161. //&>>&18 0 16 0
  162.         fprintf(fptr,"%s\n", altCase);
  163.         pkl_PrintTable(fptr, keys);
  164.         }
  165.     if(etype==4){
  166. //&<<&        X11 R6
  167.     char *altCase="aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ";
  168.  
  169.     char *keys[]={      /* size = 4x128 */
  170.  
  171.       "...................."                //
  172.       "1!2@3#4$5%6^7&8*9(0)-_=+...."        //
  173.       "qQwWeErRtTyYuUiIoOpP[{]}...."        //
  174.       "aAsSdDfFgGhHjJkKlL;:'\"`~.."         //
  175.       "\\|zZxXcCvVbBnNmM,<.>/?"        ,    //
  176.  
  177.       "...................."
  178.       "1!2@3#4$5%6^7&8*9(0)-_=+...."
  179.       "qQwWeErRtTyYuUiIoOpP[{]}...."
  180.       "aAsSdDfFgGhHjJkKlL;:'\"`~.."
  181.       "\\|zZxXcCvVbBnNmM,<.>/?"        ,
  182.  
  183.       "...................."
  184.       "1!2@3#4$5%6^7&8*9(0)-_=+...."
  185.       "jJcCuUkKeEnNgG[{]}zZhH......"
  186.       "fFyYwWaApPrRoOlLdDvV'\"`~.."
  187.       "\\|qQ`~sSmMiItTxXbB,<.>/?"        ,
  188.  
  189.       "...................."
  190.       "1!2@3#4$5%6^7&8*9(0)-_=+...."
  191.       "qQwWeErRtTyYuUiIoOpP[{]}...."
  192.       "aAsSdDfFgGhHjJkKlL;:'\"`~.."
  193.       "\\|zZxXcCvVbBnNmM,<.>/?"
  194.  
  195.       };
  196.  
  197. //&>>&12 0 12 0
  198.         fprintf(fptr,"%s\n", altCase);
  199.         pkl_PrintTable(fptr, keys);
  200.         }
  201.  
  202.     fprintf(fptr,"&>>&0 0 0 0\n");
  203.     }
  204. //&>>&1E 0 18 3
  205. //&<<&void putSetup(FILE *fptr);
  206. void putSetup(FILE *fptr){
  207.     int etype=100;
  208.     while(etype!=0 && etype!=1&& etype!=2 ){
  209.         printf("Color type (0-Dos,os2,win, 1-Linux-color, 2-X11-color) :");
  210.         scanf("%d",&etype);
  211.         }
  212.  
  213.     fprintf(fptr,"&<<&*SETUP*\n");
  214.     switch(etype){
  215. //&<<&        case 0:
  216.         case 0:
  217.             fprintf(fptr,"Attrs=7 70 a 60 17 6f 1a 31\n");
  218.             break;
  219. //&>>&1 0 1 32
  220. //&<<&        case 1:
  221.         case 1:
  222.             fprintf(fptr,"Attrs=7 70 a 60 47 6f 4a 60\n");
  223.             break;
  224. //&>>&1 0 1 35
  225. //&<<&        case 2:
  226.         case 2:
  227.             fprintf(fptr,"Attrs=1 10 8 80 91 61 98 91\n");
  228.             break;
  229. //&>>&2 0 2 0
  230.         }
  231.     fprintf(fptr,"Params=1 1 1 0\n");
  232.     fprintf(fptr,"&>>&0 0 0 0\n");
  233.  
  234.     }
  235. //&>>&B 0 B 19
  236. //&<<&void putCommand(FILE *fptr);
  237. void putCommand(FILE *fptr) {
  238.     int etype=100;
  239.     while(etype!=0 && etype!=1 && etype!=2 && etype!=3 && etype!=4 ){
  240.         printf("Command Table (0-DOS, 1-OS2, 2-Linux, 3-Win95, 4-X11) :");
  241.         scanf("%d",&etype);
  242.         }
  243.     fprintf(fptr,"&<<&*COMMAND*\n");
  244.     fprintf(fptr,"40e HelloWorld\n");
  245. //&<<&    if(etype==0 || etype==2 || etype==3 ){    /// Dos Linux Win95
  246.     if(etype==0 || etype==2 || etype==3 ){    /// Dos Linux Win95
  247. //&<<&        // Movement
  248.     fprintf(fptr, "048 Up\n");
  249.     fprintf(fptr, "068 Up\n");
  250.     fprintf(fptr, "050 Down\n");
  251.     fprintf(fptr, "06d Down\n");
  252.     fprintf(fptr, "04b Left\n");
  253.     fprintf(fptr, "06a Left\n");
  254.     fprintf(fptr, "04d Right\n");
  255.     fprintf(fptr, "06b Right\n");
  256.  
  257.     fprintf(fptr, "448 TUp\n");  // Ctrl + Up
  258.     fprintf(fptr, "468 TUp\n");  // Ctrl + Up
  259.     fprintf(fptr, "450 TDown\n");  // Ctrl + Down
  260.     fprintf(fptr, "46d TDown\n");  // Ctrl + Down
  261.     fprintf(fptr, "44b TLeft\n");  // Ctrl + Left
  262.     fprintf(fptr, "46a TLeft\n");  // Ctrl + Left
  263.     fprintf(fptr, "44d TRight\n");  // Ctrl + Right
  264.     fprintf(fptr, "46b TRight\n");  // Ctrl + Right
  265.  
  266.     fprintf(fptr, "148 PUp\n");  // Shift + Up
  267.     fprintf(fptr, "168 PUp\n");  // Shift + Up
  268.     fprintf(fptr, "150 PDown\n");  // Shift + Down
  269.     fprintf(fptr, "16d PDown\n");  // Shift + Down
  270.     fprintf(fptr, "14b PLeft\n");  // Shift + Left
  271.     fprintf(fptr, "16a PLeft\n");  // Shift + Left
  272.     fprintf(fptr, "14d PRight\n");  // Shift + Right
  273.     fprintf(fptr, "16b PRight\n");  // Shift + Right
  274.  
  275.     fprintf(fptr, "248 FUp\n");  // Alt + Up
  276.     fprintf(fptr, "268 FUp\n");  // Alt + Up
  277.     fprintf(fptr, "250 FDown\n");  // Alt + Down
  278.     fprintf(fptr, "26d FDown\n");  // Alt + Down
  279.     fprintf(fptr, "24b FLeft\n");  // Alt + Left
  280.     fprintf(fptr, "26a FLeft\n");  // Alt + Left
  281.     fprintf(fptr, "24d FRight\n");  // Alt + Right
  282.     fprintf(fptr, "26b FRight\n");  // Alt + Right
  283.  
  284.     fprintf(fptr, "01c Enter\n");  // Enter
  285.     fprintf(fptr, "061 Enter\n");  // Enter
  286.     fprintf(fptr, "11c REnter\n");  // Shift + Enter
  287.     fprintf(fptr, "161 REnter\n");  // Shift + Enter
  288.  
  289.     fprintf(fptr, "00f Tab\n");  // Tab
  290.     fprintf(fptr, "10f LTab\n");  // Shift + Tab
  291.  
  292. //&>>&0 0 0 1B
  293. //&<<&        // Insert and delete
  294. // Insert and delete
  295.  
  296.     fprintf(fptr, "052 InsCh\n");  // Ins
  297.     fprintf(fptr, "06f InsCh\n");  // Ins
  298.     fprintf(fptr, "053 DelCh\n");  // Del
  299.     fprintf(fptr, "070 DelCh\n");  // Del
  300.     fprintf(fptr, "152 InsLine\n");  // Shift + Ins
  301.     fprintf(fptr, "16f InsLine\n");  // Shift + Ins
  302.     fprintf(fptr, "252 InsFold\n");  // Alt + Ins
  303.     fprintf(fptr, "26f InsFold\n");  // Alt + Ins
  304.     fprintf(fptr, "153 DelLine\n");  // Shift + Del
  305.     fprintf(fptr, "170 DelLine\n");  // Shift + Del
  306.     fprintf(fptr, "253 DelLine\n");  // Alt + Del
  307.     fprintf(fptr, "270 DelLine\n");  // Alt + Del
  308.     fprintf(fptr, "00E BS\n");  // BS
  309.     fprintf(fptr, "10e R_BS\n");  // Shift + BS
  310.  
  311. //&>>&F 0 F B
  312. //&<<&        // Line Killing
  313. // Line Killing
  314.     fprintf(fptr, "04a KillWord\n" );     // [+]
  315.     fprintf(fptr, "14a KillEnd\n" );     // SHIFT [+]
  316.     fprintf(fptr, "44a KillBeg\n" );     // CTRL [+]
  317.     fprintf(fptr, "04e KillWord\n" );     // [-]
  318.     fprintf(fptr, "14e KillEnd\n" );     // SHIFT [-]
  319.     fprintf(fptr, "44e KillBeg\n" );     // CTRL [-]
  320. //&>>&6 0 6 14
  321. //&<<&        // Copying of chars
  322.     fprintf(fptr,"03b CSave\n"      );  //  F1:            Ch
  323.     fprintf(fptr,"13b CMove\n"      );  //  SHIFT-F1:      Ch
  324.     fprintf(fptr,"23b WSave\n"      );  //  ALT-F1:        Wo
  325.     fprintf(fptr,"33b WMove\n"      );  //  ALT-SHIFT-F1:  Wo
  326.     fprintf(fptr,"63b BWord\n"      );  //  CTRL-ALT-F1
  327.     fprintf(fptr,"73b BWord\n"      );  //  CTRL-SHIFT-ALT-F1
  328.     fprintf(fptr,"43b TSave\n"      );  //  CTRL-F1:       Li
  329.     fprintf(fptr,"53b TMove\n"      );  //  CTRL-SHIFT-F1: Li
  330.     fprintf(fptr,"03c CRest\n"      );  //  F2: Clipboard =>
  331.     fprintf(fptr,"13c CClear\n"     );  //  SHIFT-F2: Clear C
  332. //&>>&6 0 6 1B
  333. //&<<&        // Copying of lines
  334. // Copying of lines
  335.     fprintf(fptr, "03d LSave\n");  // F3:
  336.     fprintf(fptr, "43d LTSave\n");  // CTRL-F3:
  337.     fprintf(fptr, "13d LMove\n");  // SHIFT-F3:
  338.     fprintf(fptr, "53d LTMove\n");  // CTRL-SHIFT-F3
  339.     fprintf(fptr, "03e LRest\n");  // F4:
  340.     fprintf(fptr, "13e LClear\n");  // SHIFT-F4:
  341. //&>>&6 0 6 0
  342. //&<<&        // Various types of exit
  343. // Various types of exit
  344.  
  345.     fprintf(fptr,"001 Escape\n"); // ESC: temporary exit to DOS
  346.     fprintf(fptr,"101 EscapeExec\n"); // SHIFT-ESC: execute current line
  347.     fprintf(fptr,"23e EscapeExecLCB\n"); // ALT-F4: execute ClipBoard
  348. //&>>&4 0 4 1E
  349. //&<<&        // Various switchings  (ins/ovr , alt key , status line .........)
  350.     fprintf(fptr, "21c S_AutoIndent\n");   // ALT-ENTER    (on/off auto-indent)
  351.     fprintf(fptr, "452 S_ModeIns\n");   // CTRL-INS (insert mode)
  352.     fprintf(fptr, "453 S_ModeOvr\n");   // CTRL-DEL (overwrite mode)
  353.     fprintf(fptr, "46f S_ModeIns\n");   // CTRL-INS (insert mode)
  354.     fprintf(fptr, "470 S_ModeOvr\n");   // CTRL-DEL (overwrite mode)
  355.     fprintf(fptr, "802 S_ACode1\n");   // CAPS+1 switch to QQ keyboard as alt
  356.     fprintf(fptr, "803 S_ACode2\n");   // CAPS+2 switch to QJ keyboard as alt
  357.     fprintf(fptr, "804 S_ACode3\n");   // CAPS+3 switch to ┼╬ keyboard as alt
  358.     fprintf(fptr, "41f S_StatusLine\n");   // Ctrl+'S' switch status line ON/OFF
  359.     fprintf(fptr, "837 S_SearchMode\n");   // CAPS + "*\n"  search modes switching
  360. //&>>&8 0 8 1C
  361. //&<<&        // Search & replace commands
  362.     fprintf(fptr,"037 SearchFWD\n");       // "*\n" search forward
  363.     fprintf(fptr,"137 SearchBCK\n");       // SHIFT+"*\n" search back
  364.     fprintf(fptr,"237 Replace\n");       // ALT+"*\n" REPLACE
  365.     fprintf(fptr,"437 SearchPage\n");       //  CTRL+"*\n"  switch into SearchPage
  366. //&>>&3 0 3 13
  367.         fprintf(fptr,"852 PageIns\n");    // CAPS+INS insert new page
  368.         fprintf(fptr,"86f PageIns\n");    // CAPS+INS insert new page
  369. //&<<&        // Marked Lines Commands
  370.  
  371.     fprintf(fptr,"848 MarkUp\n");  // CAPS+UP
  372.     fprintf(fptr,"868 MarkUp\n");  // CAPS+UP
  373.     fprintf(fptr,"850 MarkDown\n");  // CAPS+DOWN
  374.     fprintf(fptr,"86d MarkDown\n");  // CAPS+DOWN
  375.     fprintf(fptr,"c48 MarkTUp\n");  // CAPS+CTRL+UP
  376.     fprintf(fptr,"c68 MarkTUp\n");  // CAPS+CTRL+UP
  377.     fprintf(fptr,"c50 MarkTDown\n");  // CAPS+CTRL+DOWN
  378.     fprintf(fptr,"c6d MarkTDown\n");  // CAPS+CTRL+DOWN
  379.     fprintf(fptr,"948 MarkPUp\n");  // CAPS+SHIFT+UP
  380.     fprintf(fptr,"968 MarkPUp\n");  // CAPS+SHIFT+UP
  381.     fprintf(fptr,"950 MarkPDown\n");  // CAPS+SHIFT+DOWN
  382.     fprintf(fptr,"96d MarkPDown\n");  // CAPS+SHIFT+DOWN
  383.  
  384.     fprintf(fptr,"03f MarkSaveB\n");  // F5 - push marked lines to stack
  385.     fprintf(fptr,"040 MarkRestB\n");  // F6 - pop marked lines from stack
  386.  
  387.     fprintf(fptr,"c4b MarkLast\n");     // CAPS-CTRL-LEFT  : LastMarked();
  388.     fprintf(fptr,"c6a MarkLast\n");     // CAPS-CTRL-LEFT  : LastMarked();
  389.     fprintf(fptr,"c4d MarkFirst\n");     // CAPS-CTRL-RIGHT
  390.     fprintf(fptr,"c6b MarkFirst\n");     // CAPS-CTRL-RIGHT
  391.  
  392.     fprintf(fptr,"84b MarkPrev\n");    // CAPS-Left
  393.     fprintf(fptr,"86a MarkPrev\n");    // CAPS-Left
  394.     fprintf(fptr,"84d MarkNext\n");    // CAPS-Right
  395.     fprintf(fptr,"86b MarkNext\n");    // CAPS-Right
  396.  
  397.     fprintf(fptr,"80e MarkBS\n");                   // CAPS-BS
  398.  
  399. //&>>&1B 0 15 13
  400. //&<<&        // Macros
  401.     fprintf(fptr,"041 Macro\n");        // F7
  402.     fprintf(fptr,"141 MacroRec\n");     // SHIFT+F7
  403. //&>>&0 0 0 23
  404.         }
  405. //&>>&7 0 7 28
  406. //&<<&    if(etype==1){    /// os2
  407.     if(etype==1){    /// os2
  408. //&<<&        // Movement
  409.     fprintf(fptr, "048 Up\n");
  410.     fprintf(fptr, "050 Down\n");
  411.     fprintf(fptr, "04b Left\n");
  412.     fprintf(fptr, "04d Right\n");
  413.  
  414.     fprintf(fptr, "48d TUp\n");  // Ctrl + Up
  415.     fprintf(fptr, "491 TDown\n");  // Ctrl + Down
  416.     fprintf(fptr, "473 TLeft\n");  // Ctrl + Left
  417.     fprintf(fptr, "474 TRight\n");  // Ctrl + Right
  418.  
  419.     fprintf(fptr, "148 PUp\n");  // Shift + Up
  420.     fprintf(fptr, "150 PDown\n");  // Shift + Down
  421.     fprintf(fptr, "14b PLeft\n");  // Shift + Left
  422.     fprintf(fptr, "14d PRight\n");  // Shift + Right
  423.  
  424.     fprintf(fptr, "298 FUp\n");  // Alt + Up
  425.     fprintf(fptr, "2A0 FDown\n");  // Alt + Down
  426.     fprintf(fptr, "29b FLeft\n");  // Alt + Left
  427.     fprintf(fptr, "29d FRight\n");  // Alt + Right
  428.  
  429.     fprintf(fptr, "01c Enter\n");  // Enter
  430.     fprintf(fptr, "11c REnter\n");  // Shift + Enter
  431.  
  432.     fprintf(fptr, "00f Tab\n");  // Tab
  433.     fprintf(fptr, "10f LTab\n");  // Shift + Tab
  434.  
  435. //&>>&0 0 0 14
  436. //&<<&        // Insert and delete
  437. // Insert and delete
  438.  
  439.     fprintf(fptr, "052 InsCh\n");  // Ins
  440.     fprintf(fptr, "053 DelCh\n");  // Del
  441.     fprintf(fptr, "152 InsLine\n");  // Shift + Ins
  442.     fprintf(fptr, "2a2 InsFold\n");  // Alt + Ins
  443.     fprintf(fptr, "153 DelLine\n");  // Shift + Del
  444.     fprintf(fptr, "2a3 DelLine\n");  // Alt + Del
  445.     fprintf(fptr, "00e BS\n");  // BS
  446.     fprintf(fptr, "10e R_BS\n");  // Shift + BS
  447.  
  448. //&>>&7 0 7 0
  449. //&<<&        // Line Killing
  450. // Line Killing
  451.     fprintf(fptr, "04a KillWord\n" );     // [+]
  452.     fprintf(fptr, "14a KillEnd\n" );     // SHIFT [+]
  453.     fprintf(fptr, "490 KillBeg\n" );     // CTRL [+]
  454.     fprintf(fptr, "04e KillWord\n" );     // [-]
  455.     fprintf(fptr, "14e KillEnd\n" );     // SHIFT [-]
  456.     fprintf(fptr, "48e KillBeg\n" );     // CTRL [-]
  457. //&>>&6 0 6 14
  458. //&<<&        // Copying of chars
  459.     fprintf(fptr,"03b CSave\n"      );  //  F1:            Ch
  460.     fprintf(fptr,"154 CMove\n"      );  //  SHIFT-F1:      Ch
  461.     fprintf(fptr,"268 WSave\n"      );  //  ALT-F1:        Wo
  462.     fprintf(fptr,"368 WMove\n"      );  //  ALT-SHIFT-F1:  Wo
  463.     fprintf(fptr,"668 BWord\n"      );  //  CTRL-ALT-F1
  464.     fprintf(fptr,"768 BWord\n"      );  //  CTRL-SHIFT-ALT-F1
  465.     fprintf(fptr,"45e TSave\n"      );  //  CTRL-F1:       Li
  466.     fprintf(fptr,"55e TMove\n"      );  //  CTRL-SHIFT-F1: Li
  467.     fprintf(fptr,"03c CRest\n"      );  //  F2: Clipboard =>
  468.     fprintf(fptr,"155 CClear\n"     );  //  SHIFT-F2: Clear C
  469. //&>>&6 0 6 1B
  470. //&<<&        // Copying of lines
  471. // Copying of lines
  472.     fprintf(fptr, "03d LSave\n");  // F3:
  473.     fprintf(fptr, "460 LTSave\n");  // CTRL-F3:
  474.     fprintf(fptr, "156 LMove\n");  // SHIFT-F3:
  475.     fprintf(fptr, "560 LTMove\n");  // CTRL-SHIFT-F3
  476.     fprintf(fptr, "03e LRest\n");  // F4:
  477.     fprintf(fptr, "157 LClear\n");  // SHIFT-F4:
  478. //&>>&6 0 6 0
  479. //&<<&        // Various types of exit
  480. // Various types of exit
  481.  
  482.     fprintf(fptr,"001 Escape\n"); // ESC: temporary exit to DOS
  483.     fprintf(fptr,"101 EscapeExec\n"); // SHIFT-ESC: execute current line
  484.     fprintf(fptr,"26b EscapeExecLCB\n"); // ALT-F4: execute ClipBoard
  485. //&>>&2 0 2 13
  486. //&<<&        // Various switchings  (ins/ovr , alt key , status line .........)
  487.     fprintf(fptr, "21c S_AutoIndent\n");   // ALT-ENTER    (on/off auto-indent)
  488.     fprintf(fptr, "492 S_ModeIns\n");   // CTRL-INS (insert mode)
  489.     fprintf(fptr, "493 S_ModeOvr\n");   // CTRL-DEL (overwrite mode)
  490.     fprintf(fptr, "802 S_ACode1\n");   // CAPS+1 switch to QQ keyboard as alt
  491.     fprintf(fptr, "803 S_ACode2\n");   // CAPS+2 switch to QJ keyboard as alt
  492.     fprintf(fptr, "804 S_ACode3\n");   // CAPS+3 switch to ┼╬ keyboard as alt
  493.     fprintf(fptr, "41f S_StatusLine\n");   // Ctrl+'S' switch status line ON/OFF
  494.     fprintf(fptr, "837 S_SearchMode\n");   // CAPS + "*\n"  search modes switching
  495. //&>>&1 0 1 0
  496. //&<<&        // Search & replace commands
  497.     fprintf(fptr,"037 SearchFWD\n");       // "*\n" search forward
  498.     fprintf(fptr,"137 SearchBCK\n");       // SHIFT+"*\n" search back
  499.     fprintf(fptr,"237 Replace\n");       // ALT+"*\n" REPLACE
  500.     fprintf(fptr,"496 SearchPage\n");       //  CTRL+"*\n"  switch into SearchPage
  501. //&>>&3 0 3 13
  502.         fprintf(fptr,"852 PageIns\n");    // CAPS+INS insert new page
  503.         fprintf(fptr,"86f PageIns\n");    // CAPS+INS insert new page
  504. //&<<&        // Marked Lines Commands
  505.  
  506.     fprintf(fptr,"848 MarkUp\n");  // CAPS+UP
  507.     fprintf(fptr,"850 MarkDown\n");  // CAPS+DOWN
  508.     fprintf(fptr,"c8d MarkTUp\n");  // CAPS+CTRL+UP
  509.     fprintf(fptr,"c91 MarkTDown\n");  // CAPS+CTRL+DOWN
  510.     fprintf(fptr,"948 MarkPUp\n");  // CAPS+SHIFT+UP
  511.     fprintf(fptr,"950 MarkPDown\n");  // CAPS+SHIFT+DOWN
  512.  
  513.     fprintf(fptr,"03f MarkSaveB\n");  // F5 - push marked lines to stack
  514.     fprintf(fptr,"040 MarkRestB\n");  // F6 - pop marked lines from stack
  515.  
  516.     fprintf(fptr,"c73 MarkLast\n");     // CAPS-CTRL-LEFT  : LastMarked();
  517.     fprintf(fptr,"c74 MarkFirst\n");     // CAPS-CTRL-RIGHT
  518.  
  519.     fprintf(fptr,"84b MarkPrev\n");    // CAPS-Left
  520.     fprintf(fptr,"84d MarkNext\n");    // CAPS-Right
  521.  
  522.     fprintf(fptr,"80e MarkBS\n");                   // CAPS-BS
  523.  
  524. //&>>&12 0 12 10
  525. //&<<&        // Macros
  526.     fprintf(fptr,"041 Macro\n");     // F7
  527.     fprintf(fptr,"15a MacroRec\n");     // SHIFT+F7
  528. //&>>&1 0 1 0
  529.         }
  530. //&>>&0 0 0 23
  531. //&<<&    if(etype==0 || etype==1 || etype==2 || etype==3){
  532.     if(etype==0 || etype==1 || etype==2 || etype==3){
  533. //&<<&        digits/Letters/Delimiters
  534.  
  535. fprintf( fptr, " %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n" ,  2  , 0x100+ 2 , 0x200+ 2 , 0x300+ 2  );
  536. fprintf( fptr, " %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n" ,  3  , 0x100+ 3 , 0x200+ 3 , 0x300+ 3  );
  537. fprintf( fptr, " %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n" ,  4  , 0x100+ 4 , 0x200+ 4 , 0x300+ 4  );
  538. fprintf( fptr, " %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n" ,  5  , 0x100+ 5 , 0x200+ 5 , 0x300+ 5  );
  539. fprintf( fptr, " %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n" ,  6  , 0x100+ 6 , 0x200+ 6 , 0x300+ 6  );
  540. fprintf( fptr, " %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n" ,  7  , 0x100+ 7 , 0x200+ 7 , 0x300+ 7  );
  541. fprintf( fptr, " %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n" ,  8  , 0x100+ 8 , 0x200+ 8 , 0x300+ 8  );
  542. fprintf( fptr, " %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n" ,  9  , 0x100+ 9 , 0x200+ 9 , 0x300+ 9  );
  543. fprintf( fptr, " %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n" , 10  , 0x100+10 , 0x200+10 , 0x300+10  );
  544. fprintf( fptr, " %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n" , 11  , 0x100+11 , 0x200+11 , 0x300+11  );
  545. fprintf( fptr, " %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n" , 12  , 0x100+12 , 0x200+12 , 0x300+12  );
  546. fprintf( fptr, " %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n" , 13  , 0x100+13 , 0x200+13 , 0x300+13  );
  547. fprintf( fptr, " %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n" , 41  , 0x100+41 , 0x200+41 , 0x300+41  );
  548. fprintf( fptr, " %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n" , 43  , 0x100+43 , 0x200+43 , 0x300+43  );
  549. fprintf( fptr, " %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n" , 53  , 0x100+53 , 0x200+53 , 0x300+53  );
  550.  
  551. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 16  , 0x100+16 , 0x200+16 , 0x300+16  );
  552. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 17  , 0x100+17 , 0x200+17 , 0x300+17  );
  553. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 18  , 0x100+18 , 0x200+18 , 0x300+18  );
  554. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 19  , 0x100+19 , 0x200+19 , 0x300+19  );
  555. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 20  , 0x100+20 , 0x200+20 , 0x300+20  );
  556. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 21  , 0x100+21 , 0x200+21 , 0x300+21  );
  557. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 22  , 0x100+22 , 0x200+22 , 0x300+22  );
  558. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 23  , 0x100+23 , 0x200+23 , 0x300+23  );
  559. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 24  , 0x100+24 , 0x200+24 , 0x300+24  );
  560. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 25  , 0x100+25 , 0x200+25 , 0x300+25  );
  561. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 30  , 0x100+30 , 0x200+30 , 0x300+30  );
  562. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 31  , 0x100+31 , 0x200+31 , 0x300+31  );
  563. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 32  , 0x100+32 , 0x200+32 , 0x300+32  );
  564. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 33  , 0x100+33 , 0x200+33 , 0x300+33  );
  565. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 34  , 0x100+34 , 0x200+34 , 0x300+34  );
  566. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 35  , 0x100+35 , 0x200+35 , 0x300+35  );
  567. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 36  , 0x100+36 , 0x200+36 , 0x300+36  );
  568. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 37  , 0x100+37 , 0x200+37 , 0x300+37  );
  569. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 38  , 0x100+38 , 0x200+38 , 0x300+38  );
  570. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 44  , 0x100+44 , 0x200+44 , 0x300+44  );
  571. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 45  , 0x100+45 , 0x200+45 , 0x300+45  );
  572. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 46  , 0x100+46 , 0x200+46 , 0x300+46  );
  573. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 47  , 0x100+47 , 0x200+47 , 0x300+47  );
  574. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 48  , 0x100+48 , 0x200+48 , 0x300+48  );
  575. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 49  , 0x100+49 , 0x200+49 , 0x300+49  );
  576. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 50  , 0x100+50 , 0x200+50 , 0x300+50  );
  577.  
  578. fprintf( fptr, " %0004x Ascii2\n %0004x Ascii2\n %0004x Ascii2\n %0004x Ascii2\n" , 26  , 0x100+26 , 0x200+26 , 0x300+26  );
  579. fprintf( fptr, " %0004x Ascii2\n %0004x Ascii2\n %0004x Ascii2\n %0004x Ascii2\n" , 27  , 0x100+27 , 0x200+27 , 0x300+27  );
  580. fprintf( fptr, " %0004x Ascii2\n %0004x Ascii2\n %0004x Ascii2\n %0004x Ascii2\n" , 39  , 0x100+39 , 0x200+39 , 0x300+39  );
  581. fprintf( fptr, " %0004x Ascii2\n %0004x Ascii2\n %0004x Ascii2\n %0004x Ascii2\n" , 40  , 0x100+40 , 0x200+40 , 0x300+40  );
  582. fprintf( fptr, " %0004x Ascii2\n %0004x Ascii2\n %0004x Ascii2\n %0004x Ascii2\n" , 51  , 0x100+51 , 0x200+51 , 0x300+51  );
  583. fprintf( fptr, " %0004x Ascii2\n %0004x Ascii2\n %0004x Ascii2\n %0004x Ascii2\n" , 52  , 0x100+52 , 0x200+52 , 0x300+52  );
  584.  
  585. fprintf( fptr, " %0004x Space \n %0004x Space \n %0004x Space \n %0004x Space \n" , 57  , 0x100+57 , 0x200+57 , 0x300+57  );
  586.  
  587. //&>>&0 0 0 E
  588.         }
  589. //&>>&1 0 1 4
  590. //&<<&    if(etype==2){    //// Linux Console
  591.     if(etype==2){    //// Linux Console
  592.         fprintf(fptr, " 702 Console\n");
  593.         fprintf(fptr, " 703 Console\n");
  594.         fprintf(fptr, " 704 Console\n");
  595.         fprintf(fptr, " 705 Console\n");
  596.         fprintf(fptr, " 706 Console\n");
  597.         fprintf(fptr, " 707 Console\n");
  598.         fprintf(fptr, " 708 Console\n");
  599.         fprintf(fptr, " 709 Console\n");
  600.         }
  601. //&>>&A 0 A 28
  602. //&<<&    if(etype==4){  /// X11 R6
  603.     if(etype==4){  /// X11 R6
  604.         fprintf(fptr,"062 Up\n");
  605.         fprintf(fptr,"068 Down\n");
  606.         fprintf(fptr,"064 Left\n");
  607.         fprintf(fptr,"066 Right\n");
  608.         fprintf(fptr,"462 TUp\n");
  609.         fprintf(fptr,"468 TDown\n");
  610.         fprintf(fptr,"464 TLeft\n");
  611.         fprintf(fptr,"466 TRight\n");
  612.         fprintf(fptr,"162 PUp\n");
  613.         fprintf(fptr,"168 PDown\n");
  614.         fprintf(fptr,"164 PLeft\n");
  615.         fprintf(fptr,"166 PRight\n");
  616.         fprintf(fptr,"262 FUp\n");
  617.         fprintf(fptr,"268 FDown\n");
  618.         fprintf(fptr,"264 FLeft\n");
  619.         fprintf(fptr,"266 FRight\n");
  620.         fprintf(fptr,"024 Enter\n");
  621.         fprintf(fptr,"124 REnter\n");
  622.         fprintf(fptr,"017 Tab\n");
  623.         fprintf(fptr,"117 LTab\n");
  624.         fprintf(fptr,"06a InsCh\n");
  625.         fprintf(fptr,"06b DelCh\n");
  626.         fprintf(fptr,"16a InsLine\n");
  627.         fprintf(fptr,"26a InsFold\n");
  628.         fprintf(fptr,"16b DelLine\n");
  629.         fprintf(fptr,"26b DelLine\n");
  630.         fprintf(fptr,"043 CSave\n");
  631.         fprintf(fptr,"143 CMove\n");
  632.         fprintf(fptr,"243 WSave\n");
  633.         fprintf(fptr,"343 WMove\n");
  634.         fprintf(fptr,"643 BWord\n");
  635.         fprintf(fptr,"743 BWord\n");
  636.         fprintf(fptr,"443 TSave\n");
  637.         fprintf(fptr,"543 TMove\n");
  638.         fprintf(fptr,"044 CRest\n");
  639.         fprintf(fptr,"144 CClear\n");
  640.         fprintf(fptr,"045 LSave\n");
  641.         fprintf(fptr,"445 LTSave\n");
  642.         fprintf(fptr,"145 LMove\n");
  643.         fprintf(fptr,"545 LTMove\n");
  644.         fprintf(fptr,"046 LRest\n");
  645.         fprintf(fptr,"146 LClear\n");
  646.         fprintf(fptr,"009 Escape\n");
  647.         fprintf(fptr,"109 EscapeExec\n");
  648.         fprintf(fptr,"246 EscapeExecLCB\n");
  649.         fprintf(fptr,"46a S_ModeIns\n");
  650.         fprintf(fptr,"46b S_ModeOvr\n");
  651.         fprintf(fptr,"224 S_AutoIndent\n");
  652.         fprintf(fptr,"43f SearchPage\n");
  653.         fprintf(fptr,"83f S_SearchMode\n");
  654.         fprintf(fptr,"03f SearchFWD\n");
  655.         fprintf(fptr,"13f SearchBCK\n");
  656.         fprintf(fptr,"23f Replace\n");
  657.         fprintf(fptr,"862 MarkUp\n");
  658.         fprintf(fptr,"868 MarkDown\n");
  659.         fprintf(fptr,"c62 MarkTUp\n");
  660.         fprintf(fptr,"c68 MarkTDown\n");
  661.         fprintf(fptr,"962 MarkPUp\n");
  662.         fprintf(fptr,"968 MarkPDown\n");
  663.         fprintf(fptr,"047 MarkSaveB\n");
  664.         fprintf(fptr,"048 MarkRestB\n");
  665.         fprintf(fptr,"016 BS\n");
  666.         fprintf(fptr,"116 R_BS\n");
  667.         fprintf(fptr,"056 KillWord\n");
  668.         fprintf(fptr,"156 KillEnd\n");
  669.         fprintf(fptr,"456 KillBeg\n");
  670.         fprintf(fptr,"049 Macro\n");
  671.         fprintf(fptr,"149 MacroRec\n");
  672.                 fprintf(fptr,"\n");
  673.         fprintf(fptr,"80a S_ACode1\n");   // CAPS+1 switch to QQ keyboard as alt
  674.         fprintf(fptr,"80b S_ACode2\n");   // CAPS+2 switch to QJ keyboard as alt
  675.         fprintf(fptr,"80c S_ACode3\n");   // CAPS+3 switch to ┼╬ keyboard as alt
  676.         fprintf(fptr,"041 Space\n");
  677.         fprintf(fptr,"141 Space\n");
  678.         fprintf(fptr,"241 Space\n");
  679.         fprintf(fptr,"341 Space\n");
  680.                 fprintf(fptr,"\n");
  681.         fprintf(fptr,"00a Ascii0\n");
  682.         fprintf(fptr,"00b Ascii0\n");
  683.         fprintf(fptr,"00c Ascii0\n");
  684.         fprintf(fptr,"00d Ascii0\n");
  685.         fprintf(fptr,"00e Ascii0\n");
  686.         fprintf(fptr,"00f Ascii0\n");
  687.         fprintf(fptr,"010 Ascii0\n");
  688.         fprintf(fptr,"011 Ascii0\n");
  689.         fprintf(fptr,"012 Ascii0\n");
  690.         fprintf(fptr,"013 Ascii0\n");
  691.         fprintf(fptr,"10a Ascii0\n");
  692.         fprintf(fptr,"10b Ascii0\n");
  693.         fprintf(fptr,"10c Ascii0\n");
  694.         fprintf(fptr,"10d Ascii0\n");
  695.         fprintf(fptr,"10e Ascii0\n");
  696.         fprintf(fptr,"10f Ascii0\n");
  697.         fprintf(fptr,"110 Ascii0\n");
  698.         fprintf(fptr,"111 Ascii0\n");
  699.         fprintf(fptr,"112 Ascii0\n");
  700.         fprintf(fptr,"113 Ascii0\n");
  701.         fprintf(fptr,"20a Ascii0\n");
  702.         fprintf(fptr,"20b Ascii0\n");
  703.         fprintf(fptr,"20c Ascii0\n");
  704.         fprintf(fptr,"20d Ascii0\n");
  705.         fprintf(fptr,"20e Ascii0\n");
  706.         fprintf(fptr,"20f Ascii0\n");
  707.         fprintf(fptr,"210 Ascii0\n");
  708.         fprintf(fptr,"211 Ascii0\n");
  709.         fprintf(fptr,"212 Ascii0\n");
  710.         fprintf(fptr,"213 Ascii0\n");
  711.         fprintf(fptr,"30a Ascii0\n");
  712.         fprintf(fptr,"30b Ascii0\n");
  713.         fprintf(fptr,"30c Ascii0\n");
  714.         fprintf(fptr,"30d Ascii0\n");
  715.         fprintf(fptr,"30e Ascii0\n");
  716.         fprintf(fptr,"30f Ascii0\n");
  717.         fprintf(fptr,"310 Ascii0\n");
  718.         fprintf(fptr,"311 Ascii0\n");
  719.         fprintf(fptr,"312 Ascii0\n");
  720.         fprintf(fptr,"313 Ascii0\n");
  721.                 fprintf(fptr,"\n");
  722.         fprintf(fptr,"018 Ascii1\n");
  723.         fprintf(fptr,"019 Ascii1\n");
  724.         fprintf(fptr,"01a Ascii1\n");
  725.         fprintf(fptr,"01b Ascii1\n");
  726.         fprintf(fptr,"01c Ascii1\n");
  727.         fprintf(fptr,"01d Ascii1\n");
  728.         fprintf(fptr,"01e Ascii1\n");
  729.         fprintf(fptr,"01f Ascii1\n");
  730.         fprintf(fptr,"020 Ascii1\n");
  731.         fprintf(fptr,"021 Ascii1\n");
  732.         fprintf(fptr,"022 Ascii1\n");
  733.         fprintf(fptr,"023 Ascii1\n");
  734.         fprintf(fptr,"026 Ascii1\n");
  735.         fprintf(fptr,"027 Ascii1\n");
  736.         fprintf(fptr,"028 Ascii1\n");
  737.         fprintf(fptr,"029 Ascii1\n");
  738.         fprintf(fptr,"02a Ascii1\n");
  739.         fprintf(fptr,"02b Ascii1\n");
  740.         fprintf(fptr,"02c Ascii1\n");
  741.         fprintf(fptr,"02d Ascii1\n");
  742.         fprintf(fptr,"02e Ascii1\n");
  743.         fprintf(fptr,"02f Ascii1\n");
  744.         fprintf(fptr,"030 Ascii1\n");
  745.         fprintf(fptr,"034 Ascii1\n");
  746.         fprintf(fptr,"035 Ascii1\n");
  747.         fprintf(fptr,"036 Ascii1\n");
  748.         fprintf(fptr,"037 Ascii1\n");
  749.         fprintf(fptr,"038 Ascii1\n");
  750.         fprintf(fptr,"039 Ascii1\n");
  751.         fprintf(fptr,"03a Ascii1\n");
  752.         fprintf(fptr,"03b Ascii1\n");
  753.         fprintf(fptr,"03c Ascii1\n");
  754.         fprintf(fptr,"118 Ascii1\n");
  755.         fprintf(fptr,"119 Ascii1\n");
  756.         fprintf(fptr,"11a Ascii1\n");
  757.         fprintf(fptr,"11b Ascii1\n");
  758.         fprintf(fptr,"11c Ascii1\n");
  759.         fprintf(fptr,"11d Ascii1\n");
  760.         fprintf(fptr,"11e Ascii1\n");
  761.         fprintf(fptr,"11f Ascii1\n");
  762.         fprintf(fptr,"120 Ascii1\n");
  763.         fprintf(fptr,"121 Ascii1\n");
  764.         fprintf(fptr,"122 Ascii1\n");
  765.         fprintf(fptr,"123 Ascii1\n");
  766.         fprintf(fptr,"126 Ascii1\n");
  767.         fprintf(fptr,"127 Ascii1\n");
  768.         fprintf(fptr,"128 Ascii1\n");
  769.         fprintf(fptr,"129 Ascii1\n");
  770.         fprintf(fptr,"12a Ascii1\n");
  771.         fprintf(fptr,"12b Ascii1\n");
  772.         fprintf(fptr,"12c Ascii1\n");
  773.         fprintf(fptr,"12d Ascii1\n");
  774.         fprintf(fptr,"12e Ascii1\n");
  775.         fprintf(fptr,"12f Ascii1\n");
  776.         fprintf(fptr,"130 Ascii1\n");
  777.         fprintf(fptr,"134 Ascii1\n");
  778.         fprintf(fptr,"135 Ascii1\n");
  779.         fprintf(fptr,"136 Ascii1\n");
  780.         fprintf(fptr,"137 Ascii1\n");
  781.         fprintf(fptr,"138 Ascii1\n");
  782.         fprintf(fptr,"139 Ascii1\n");
  783.         fprintf(fptr,"13a Ascii1\n");
  784.         fprintf(fptr,"13b Ascii1\n");
  785.         fprintf(fptr,"13c Ascii1\n");
  786.         fprintf(fptr,"218 Ascii1\n");
  787.         fprintf(fptr,"219 Ascii1\n");
  788.         fprintf(fptr,"21a Ascii1\n");
  789.         fprintf(fptr,"21b Ascii1\n");
  790.         fprintf(fptr,"21c Ascii1\n");
  791.         fprintf(fptr,"21d Ascii1\n");
  792.         fprintf(fptr,"21e Ascii1\n");
  793.         fprintf(fptr,"21f Ascii1\n");
  794.         fprintf(fptr,"220 Ascii1\n");
  795.         fprintf(fptr,"221 Ascii1\n");
  796.         fprintf(fptr,"222 Ascii1\n");
  797.         fprintf(fptr,"223 Ascii1\n");
  798.         fprintf(fptr,"226 Ascii1\n");
  799.         fprintf(fptr,"227 Ascii1\n");
  800.         fprintf(fptr,"228 Ascii1\n");
  801.         fprintf(fptr,"229 Ascii1\n");
  802.         fprintf(fptr,"22a Ascii1\n");
  803.         fprintf(fptr,"22b Ascii1\n");
  804.         fprintf(fptr,"22c Ascii1\n");
  805.         fprintf(fptr,"22d Ascii1\n");
  806.         fprintf(fptr,"22e Ascii1\n");
  807.         fprintf(fptr,"22f Ascii1\n");
  808.         fprintf(fptr,"230 Ascii1\n");
  809.         fprintf(fptr,"234 Ascii1\n");
  810.         fprintf(fptr,"235 Ascii1\n");
  811.         fprintf(fptr,"236 Ascii1\n");
  812.         fprintf(fptr,"237 Ascii1\n");
  813.         fprintf(fptr,"238 Ascii1\n");
  814.         fprintf(fptr,"239 Ascii1\n");
  815.         fprintf(fptr,"23a Ascii1\n");
  816.         fprintf(fptr,"23b Ascii1\n");
  817.         fprintf(fptr,"23c Ascii1\n");
  818.         fprintf(fptr,"318 Ascii1\n");
  819.         fprintf(fptr,"319 Ascii1\n");
  820.         fprintf(fptr,"31a Ascii1\n");
  821.         fprintf(fptr,"31b Ascii1\n");
  822.         fprintf(fptr,"31c Ascii1\n");
  823.         fprintf(fptr,"31d Ascii1\n");
  824.         fprintf(fptr,"31e Ascii1\n");
  825.         fprintf(fptr,"31f Ascii1\n");
  826.         fprintf(fptr,"320 Ascii1\n");
  827.         fprintf(fptr,"321 Ascii1\n");
  828.         fprintf(fptr,"322 Ascii1\n");
  829.         fprintf(fptr,"323 Ascii1\n");
  830.         fprintf(fptr,"326 Ascii1\n");
  831.         fprintf(fptr,"327 Ascii1\n");
  832.         fprintf(fptr,"328 Ascii1\n");
  833.         fprintf(fptr,"329 Ascii1\n");
  834.         fprintf(fptr,"32a Ascii1\n");
  835.         fprintf(fptr,"32b Ascii1\n");
  836.         fprintf(fptr,"32c Ascii1\n");
  837.         fprintf(fptr,"32d Ascii1\n");
  838.         fprintf(fptr,"32e Ascii1\n");
  839.         fprintf(fptr,"32f Ascii1\n");
  840.         fprintf(fptr,"330 Ascii1\n");
  841.         fprintf(fptr,"334 Ascii1\n");
  842.         fprintf(fptr,"335 Ascii1\n");
  843.         fprintf(fptr,"336 Ascii1\n");
  844.         fprintf(fptr,"337 Ascii1\n");
  845.         fprintf(fptr,"338 Ascii1\n");
  846.         fprintf(fptr,"339 Ascii1\n");
  847.         fprintf(fptr,"33a Ascii1\n");
  848.         fprintf(fptr,"33b Ascii1\n");
  849.         fprintf(fptr,"33c Ascii1\n");
  850.         fprintf(fptr,"\n");
  851.         fprintf(fptr,"014 Ascii2\n");
  852.         fprintf(fptr,"015 Ascii2\n");
  853.         fprintf(fptr,"031 Ascii2\n");
  854.         fprintf(fptr,"033 Ascii2\n");
  855.         fprintf(fptr,"03d Ascii2\n");
  856.         fprintf(fptr,"114 Ascii2\n");
  857.         fprintf(fptr,"115 Ascii2\n");
  858.         fprintf(fptr,"131 Ascii2\n");
  859.         fprintf(fptr,"133 Ascii2\n");
  860.         fprintf(fptr,"13d Ascii2\n");
  861.         fprintf(fptr,"214 Ascii2\n");
  862.         fprintf(fptr,"215 Ascii2\n");
  863.         fprintf(fptr,"231 Ascii2\n");
  864.         fprintf(fptr,"233 Ascii2\n");
  865.         fprintf(fptr,"23d Ascii2\n");
  866.         fprintf(fptr,"314 Ascii2\n");
  867.         fprintf(fptr,"315 Ascii2\n");
  868.         fprintf(fptr,"331 Ascii2\n");
  869.         fprintf(fptr,"333 Ascii2\n");
  870.         fprintf(fptr,"33d Ascii2\n");
  871.         }
  872. //&>>&48 0 9 19
  873.     fprintf(fptr,"&>>&0 0 0 0\n");
  874.     }
  875. //&>>&C 0 C 1A
  876. //&<<&void putMacro(FILE *fptr);
  877. void putMacro(FILE *fptr){
  878.     fprintf(fptr,"&<<&*MACRO*\n");
  879.  
  880. //&<<&    fprintf(fptr,"&<<&Arithmetics & ...\n");
  881.     fprintf(fptr,"&<<&Arithmetics & ...\n");
  882.     fprintf(fptr,"proc add %03x mathop endp\n",MATHOP_ADD);
  883.     fprintf(fptr,"proc sub %03x mathop endp\n",MATHOP_SUB);
  884.     fprintf(fptr,"proc mul %03x mathop endp\n",MATHOP_MUL);
  885.     fprintf(fptr,"proc div %03x mathop endp\n",MATHOP_DIV);
  886.     fprintf(fptr,"proc mod %03x mathop endp\n",MATHOP_MOD);
  887.     fprintf(fptr,"proc and %03x mathop endp\n",MATHOP_AND);
  888.     fprintf(fptr,"proc or  %03x mathop endp\n",MATHOP_OR );
  889.     fprintf(fptr,"proc xor %03x mathop endp\n",MATHOP_XOR);
  890.     fprintf(fptr,"proc eq  %03x predicate endp\n",PREDICATE_EQ);
  891.     fprintf(fptr,"proc ne  %03x predicate endp\n",PREDICATE_NE);
  892.     fprintf(fptr,"proc lt  %03x predicate endp\n",PREDICATE_LT);
  893.     fprintf(fptr,"proc gt  %03x predicate endp\n",PREDICATE_GT);
  894.     fprintf(fptr,"&>>&0 0 0 0\n");
  895. //&>>&C 0 C 1F
  896. //&<<&    fprintf(fptr,"&<<&Definitions...\n");
  897.     fprintf(fptr,"&<<&Definitions...\n");
  898.  
  899.     fprintf(fptr,"proc pushf   %03x push endp\n",PUSH_FLAG);
  900.     fprintf(fptr,"proc pushl   %03x push endp\n",PUSH_CLINE_L);
  901.     fprintf(fptr,"proc pushls  %03x push endp\n",PUSH_CLINE_S);
  902.     fprintf(fptr,"proc pushc   %03x push endp\n",PUSH_CHAR);
  903.     fprintf(fptr,"proc pushlcb %03x push endp\n",PUSH_LCB);
  904.     fprintf(fptr,"proc pushccb %03x push endp\n",PUSH_CCB);
  905.  
  906.     fprintf(fptr,"proc cvtI2SH %03x convert endp\n", CONVERT_I2SH);
  907.     fprintf(fptr,"proc cvtI2SD %03x convert endp\n", CONVERT_I2SD);
  908.     fprintf(fptr,"proc cvtS2IH %03x convert endp\n", CONVERT_S2IH);
  909.     fprintf(fptr,"proc cvtS2ID %03x convert endp\n", CONVERT_S2ID);
  910.     fprintf(fptr,"proc cvtS2L  %03x convert endp\n", CONVERT_S2L );
  911.     fprintf(fptr,"proc cvtL2S  %03x convert endp\n", CONVERT_L2S );
  912.     fprintf(fptr,"proc cvtI2C  %03x convert endp\n", CONVERT_I2C );
  913.     fprintf(fptr,"proc cvtC2I  %03x convert endp\n", CONVERT_C2I );
  914.  
  915.  
  916.     fprintf(fptr,"&>>&0 0 0 0\n");
  917. //&>>&4 0 4 0
  918. //&<<&    fprintf(fptr,"&<<&Movement...\n");
  919.     fprintf(fptr,"&<<&Movement...\n");
  920. //&<<&    fprintf(fptr,"proc PRight\n");
  921.     fprintf(fptr,"&<<&proc PRight\n");
  922.     fprintf(fptr,"proc PRight\n");
  923.     fprintf(fptr,"    pushc \' \' gt\n");
  924.     fprintf(fptr,"    do\n");
  925.     fprintf(fptr,"        Right\n");
  926.     fprintf(fptr,"        pushc \' \' gt\n");
  927.     fprintf(fptr,"    enddo\n");
  928.     fprintf(fptr,"    pushc \' \' eq\n");
  929.     fprintf(fptr,"    do\n");
  930.     fprintf(fptr,"        Right\n");
  931.     fprintf(fptr,"        pushc \' \' eq\n");
  932.     fprintf(fptr,"    enddo\n");
  933.     fprintf(fptr,"endp\n");
  934.     fprintf(fptr,"&>>&0 0 0 0\n");
  935. //&>>&0 0 0 0
  936. //&<<&    fprintf(fptr,"proc PLeft\n");
  937.     fprintf(fptr,"&<<&proc PLeft\n");
  938.     fprintf(fptr,"proc PLeft\n");
  939.     fprintf(fptr,"    pushc \' \' ne\n");
  940.     fprintf(fptr,"    do\n");
  941.     fprintf(fptr,"        Left\n");
  942.     fprintf(fptr,"        pushc \' \' ne pushf\n");
  943.     fprintf(fptr,"        %03x ioctl 0 gt pushf\n",IOCTL_CX);
  944.     fprintf(fptr,"        and pop\n");
  945.     fprintf(fptr,"    enddo\n");
  946.     fprintf(fptr,"    pushc \' \' eq\n");
  947.     fprintf(fptr,"    do\n");
  948.     fprintf(fptr,"        Left\n");
  949.     fprintf(fptr,"        pushc \' \' eq pushf\n");
  950.     fprintf(fptr,"        %03x ioctl 0 gt pushf\n",IOCTL_CX);
  951.     fprintf(fptr,"        and pop\n");
  952.     fprintf(fptr,"    enddo\n");
  953.     fprintf(fptr,"endp\n");
  954.     fprintf(fptr,"&>>&0 0 0 0\n");
  955. //&>>&12 0 12 1
  956.     fprintf(fptr,"&>>&0 0 0 0\n");
  957. //&>>&2 0 2 1A
  958. //&<<&    fprintf(fptr,"&<<&Editing,killing...\n");
  959.     fprintf(fptr,"&<<&Editing,killing...\n");
  960. //&<<&    fprintf(fptr,"proc KillWord\n");
  961.     fprintf(fptr,"&<<&proc KillWord\n");
  962.     fprintf(fptr,"proc KillWord\n");
  963.     fprintf(fptr,"    %03x ioctl if ret endif\n",IOCTL_ISMARKED);
  964.     fprintf(fptr,"    BWord\n");
  965.     fprintf(fptr,"    pushc \' \' gt\n");
  966.     fprintf(fptr,"    do\n");
  967.     fprintf(fptr,"        DelCh\n");
  968.     fprintf(fptr,"        pushc \' \' gt\n");
  969.     fprintf(fptr,"    enddo\n");
  970.     fprintf(fptr,"    pushc \' \' eq\n");
  971.     fprintf(fptr,"    do\n");
  972.     fprintf(fptr,"        DelCh\n");
  973.     fprintf(fptr,"        pushc \' \' eq\n");
  974.     fprintf(fptr,"    enddo\n");
  975.     fprintf(fptr,"endp\n");
  976.     fprintf(fptr,"&>>&0 0 0 0\n");
  977. //&>>&E 0 E 0
  978. //&<<&    fprintf(fptr,"proc InsCh\n");
  979.     fprintf(fptr,"&<<&proc InsCh\n");
  980.     fprintf(fptr,"proc InsCh\n");
  981.     fprintf(fptr,"    \"_InsCh\"\n");
  982.     fprintf(fptr,"    %03x ioctl if 1 endif\n",IOCTL_ISMARKED);
  983.     fprintf(fptr,"    eval\n");
  984.     fprintf(fptr,"endp\n");
  985.     fprintf(fptr,"&>>&0 0 0 0\n");
  986. //&>>&2 0 2 0
  987. //&<<&    fprintf(fptr,"proc DelCh\n");
  988.     fprintf(fptr,"&<<&proc DelCh\n");
  989.     fprintf(fptr,"proc DelCh\n");
  990.     fprintf(fptr,"    \"_DelCh\"\n");
  991.     fprintf(fptr,"    %03x ioctl if 1 endif\n",IOCTL_ISMARKED);
  992.     fprintf(fptr,"    eval\n");
  993.     fprintf(fptr,"endp\n");
  994.     fprintf(fptr,"&>>&0 0 0 0\n");
  995. //&>>&2 0 2 0
  996. //&<<&    fprintf(fptr,"proc BS\n");
  997.     fprintf(fptr,"&<<&proc BS\n");
  998.     fprintf(fptr,"proc BS\n");
  999.     fprintf(fptr,"    \"_BS\"\n");
  1000.     fprintf(fptr,"    %03x ioctl if 1 endif\n",IOCTL_ISMARKED);
  1001.     fprintf(fptr,"    eval\n");
  1002.     fprintf(fptr,"endp\n");
  1003.     fprintf(fptr,"&>>&0 0 0 0\n");
  1004. //&>>&0 0 0 0
  1005. //&<<&    fprintf(fptr,"proc KillEnd\n");
  1006.     fprintf(fptr,"&<<&proc KillEnd\n");
  1007.     fprintf(fptr,"proc KillEnd\n");
  1008.     fprintf(fptr,"    \"_KillEnd\"\n");
  1009.     fprintf(fptr,"    %03x ioctl if 1 endif\n",IOCTL_ISMARKED);
  1010.     fprintf(fptr,"    eval\n");
  1011.     fprintf(fptr,"endp\n");
  1012.     fprintf(fptr,"&>>&0 0 0 0\n");
  1013. //&>>&6 0 6 0
  1014. //&<<&    fprintf(fptr,"proc KillBeg\n");
  1015.     fprintf(fptr,"&<<&proc KillBeg\n");
  1016.     fprintf(fptr,"proc KillBeg\n");
  1017.     fprintf(fptr,"    \"_KillBeg\"\n");
  1018.     fprintf(fptr,"    %03x ioctl if 1 endif\n",IOCTL_ISMARKED);
  1019.     fprintf(fptr,"    eval\n");
  1020.     fprintf(fptr,"endp\n");
  1021.     fprintf(fptr,"&>>&0 0 0 0\n");
  1022. //&>>&7 0 7 0
  1023. //&<<&    fprintf(fptr,"proc R_BS\n");
  1024.     fprintf(fptr,"&<<&proc R_BS\n");
  1025.     fprintf(fptr,"proc R_BS\n");
  1026.     fprintf(fptr,"    %03x ioctl if ret endif\n",IOCTL_ISMARKED);
  1027.     fprintf(fptr,"    %03x ioctl if ret endif\n",IOCTL_ISFOLD);
  1028.     fprintf(fptr,"    %03x ioctl 0 eq if ret endif\n",IOCTL_SY);
  1029.     fprintf(fptr,"    KillBeg\n");
  1030.     fprintf(fptr,"    pushls\n");
  1031.     fprintf(fptr,"    DelLine\n");
  1032.     fprintf(fptr,"    Up\n");
  1033.     fprintf(fptr,"    TRight\n");
  1034.     fprintf(fptr,"    %03x ioctl\n",IOCTL_CX);
  1035.     fprintf(fptr,"    swp\n");
  1036.     fprintf(fptr,"    pop\n");
  1037.     fprintf(fptr,"    dup %03x ioctl lt\n",IOCTL_CX);
  1038.     fprintf(fptr,"    do\n");
  1039.     fprintf(fptr,"        Left\n");
  1040.     fprintf(fptr,"        dup %03x ioctl lt\n",IOCTL_CX);
  1041.     fprintf(fptr,"    enddo\n");
  1042.     fprintf(fptr,"endp\n");
  1043.     fprintf(fptr,"&>>&0 0 0 0\n");
  1044. //&>>&7 0 7 1C
  1045. //&<<&    fprintf(fptr,"proc REnter\n");
  1046.     fprintf(fptr,"&<<&proc REnter\n");
  1047.     fprintf(fptr,"proc REnter\n");
  1048.     fprintf(fptr,"    007 ioctl if ret endif\n");
  1049.     fprintf(fptr,"    pushls\n");
  1050.     fprintf(fptr,"    KillEnd\n");
  1051.     fprintf(fptr,"    Down\n");
  1052.     fprintf(fptr,"    cvtS2L\n");
  1053.     fprintf(fptr,"    pop\n");
  1054.     fprintf(fptr,"    KillBeg\n");
  1055.     fprintf(fptr,"endp\n");
  1056.     fprintf(fptr,"&>>&0 0 0 0\n");
  1057. //&>>&B 0 B 0
  1058.     fprintf(fptr,"&>>&0 0 0 0\n");
  1059. //&>>&3 0 3 20
  1060.  
  1061.     fprintf(fptr,"proc HelloWorld\n");
  1062.     fprintf(fptr,"    InsLine\n");
  1063.     fprintf(fptr,"    TLeft\n");
  1064.     fprintf(fptr,"    Tab Tab Tab Tab\n");
  1065.     fprintf(fptr,"    \"Hello World! \"\n");
  1066.     fprintf(fptr,"    pop\n");
  1067.     fprintf(fptr,"endp\n");
  1068.  
  1069.     fprintf(fptr,"&>>&0 0 0 0\n");
  1070.     }
  1071. //&>>&6 0 6 24
  1072.  
  1073. //&<<&void main(){          
  1074. int main(int argc,char **argv){
  1075.     FILE *fptr;
  1076.     if(argc>1) {
  1077.          printf("Editing file <%s>\n",argv[1]);
  1078.          fptr=fopen(argv[1],"w");
  1079.          }
  1080. //&<<&    else {
  1081.     else {
  1082.         char *env_home,*env_mmm;
  1083.         env_home=getenv("HOME");
  1084.         env_mmm=getenv("MMM");
  1085.         char *RunDir=new char[0x100]; if(RunDir==0)exit(1);
  1086.         strcpy(RunDir,env_home!=0?env_home:
  1087.                       env_mmm!=0 ?env_mmm :
  1088. #ifdef __linux__
  1089.                       "./");
  1090.         if(RunDir[strlen(RunDir)-1]!='/') strcat(RunDir,"/");
  1091. #else
  1092.                       ".\\");
  1093.         if(RunDir[strlen(RunDir)-1]!='\\') strcat(RunDir,"\\");
  1094. #endif
  1095.         strcat(RunDir,"mmm_base.cfg");
  1096.         printf("Editing file <%s>\n",RunDir);
  1097.         fptr=fopen(RunDir,"w");
  1098.         }
  1099. //&>>&10 0 10 C
  1100.  
  1101.     if(fptr==0) {
  1102.         printf("Cannot open output file\n");
  1103.         exit(-1);
  1104.         }
  1105.  
  1106.     putExtensions(fptr);
  1107.     putKeyboardLayouts(fptr);
  1108.     putSetup(fptr);
  1109.     putCommand(fptr);
  1110.     putMacro(fptr);
  1111.     return 0;
  1112.     }
  1113. //&>>&3 0 3 0
  1114. #if 0
  1115. //&<<&*MACRO*
  1116. //&<<&Arithmetics & ...
  1117. proc add 0 mathop endp
  1118. proc sub 1 mathop endp
  1119. proc mul 2 mathop endp
  1120. proc div 3 mathop endp
  1121. proc mod 4 mathop endp
  1122. proc and 5 mathop endp
  1123. proc or  6 mathop endp
  1124. proc xor 7 mathop endp
  1125.  
  1126. proc eq  0 predicate endp
  1127. proc ne  1 predicate endp
  1128. proc lt  2 predicate endp
  1129. proc gt  3 predicate endp
  1130. //&>>&C 0 C 15
  1131. //&<<&proc PrintString
  1132. proc PrintString
  1133.     4 convert Enter pop
  1134. endp
  1135. //&>>&1 0 1 9
  1136. //&<<&proc PrintInt
  1137. proc PrintInt
  1138.     dup
  1139.     0 convert
  1140. %    pop
  1141.     PrintString
  1142. endp
  1143. //&>>&2 0 2 5
  1144. //&<<&proc TestQuery
  1145. proc TestQuery
  1146.     query
  1147.     0 convert
  1148.     "type is:" pop
  1149.     pop
  1150.     "." pop
  1151. endp
  1152. //&>>&7 0 7 0
  1153. //&<<&proc TestSgetSput
  1154. proc TestSgetSput
  1155.     "push5"
  1156.     "push4"
  1157.     "push3"
  1158.     "push2"
  1159.     "push1"
  1160.  
  1161.     " !StrangeValue(for3)! " 3 sput
  1162.     1 sget pop
  1163.     2 sget pop
  1164.     3 sget pop
  1165.     4 sget pop
  1166.     5 sget pop
  1167.     %del del del del del
  1168.     pop pop pop pop pop
  1169. endp
  1170. //&>>&E 0 E 1
  1171. //&<<&proc TestIf
  1172. proc TestIf
  1173.     10 20 eq
  1174.     if
  1175.         "a = b" pop
  1176.     else
  1177.         "a != b" pop
  1178.     endif
  1179.  
  1180.     10 20 gt
  1181.     if
  1182.         "a > b" pop
  1183.     else
  1184.         "a < b" pop
  1185.     endif
  1186. endp
  1187. //&>>&8 0 8 0
  1188. //&<<&proc Test2Z
  1189. proc Test2Z
  1190.     dup 0 eq
  1191.     if
  1192.         "==0 " pop
  1193.     else
  1194.         dup 0 gt
  1195.         if
  1196.             ">0 " pop
  1197.         else
  1198.             "<0 " pop
  1199.         endif
  1200.     endif
  1201. endp
  1202. //&>>&3 0 3 0
  1203. //&<<&proc TestDo
  1204. proc TestDo
  1205. 'a'
  1206. dup 'z' lt
  1207. do
  1208.     Down TLeft
  1209.     dup 6 convert pop % enumerate lines by letters a-z
  1210.     1 add
  1211.     dup 'z' lt
  1212. enddo
  1213.  
  1214. endp
  1215. //&>>&5 0 5 0
  1216. //&<<&proc TestIoctl
  1217. proc TestIoctl
  1218.     "typing mode :" pop  1 ioctl if "Ins" else "Ovr" endif          pop Enter
  1219.     "search :" pop  3 ioctl if "sensetive" else "insensetive" endif pop Enter
  1220.     "In Search Page :" pop  0a ioctl if "yes" else "no" endif       pop Enter
  1221.     "In Temp Page :" pop  0b ioctl if "yes" else "no" endif         pop Enter
  1222.     "Number Of lines:" pop 0c  ioctl 1 convert                      pop Enter
  1223.     "Number Of col-s:" pop 0d  ioctl 1 convert                      pop Enter
  1224.     "Line Number    :" pop 012 ioctl 1 convert                      pop Enter
  1225.     "cx=" pop     0e  ioctl  1 convert                              pop Enter
  1226.     "sx=" pop     0f  ioctl  1 convert                              pop Enter
  1227.     "sy=" pop     011 ioctl  1 convert                              pop Enter
  1228. endp
  1229. //&>>&2 0 2 0
  1230. //&<<&proc nPRight
  1231. proc nPRight
  1232.     4 push 20 gt
  1233.     do
  1234.         Right
  1235.         4 push 20 gt
  1236.     enddo
  1237.  
  1238.     4 push 20 eq
  1239.     do
  1240.         Right
  1241.         4 push
  1242.         4 push 20 eq
  1243.     enddo
  1244. endp
  1245. //&>>&0 0 0 0
  1246.  
  1247. proc HelloWorld
  1248.     nPRight
  1249. endp
  1250. //&>>&A 0 A 7
  1251. #endif
  1252. ///// mmm_cfg.err mmm_cfg.err mmm_cfg.err mmm_cfg.err mmm_cfg.err
  1253. ///// -a mmm.cfg mmm.cfg mmm.cfg mmm.cfg mmm.cfg
  1254. ///// -a ../../mmm_base.cfg ../mmm.cfg ../mmm.cfg ../mmm.cfg ../mmm.cfg
  1255. //&>>&B 0 8 0
  1256.