home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / mmm_pkg.zip / mmm_cfg.cpp < prev    next >
C/C++ Source or Header  |  1996-12-05  |  38KB  |  917 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 putSearch(FILE *fptr);
  13. void putSearch(FILE *fptr){
  14.     fprintf(fptr,"&<<&*SEARCH*\n");
  15.     fprintf(fptr,"Lines to search to\n");
  16.     fprintf(fptr,"&>>&0 0 0 0\n");
  17.     }
  18. //&>>&3 0 3 0
  19. //&<<&void putTemp(FILE *fptr);
  20. void putTemp(FILE *fptr){
  21.     fprintf(fptr,"&<<&*TEMP*\n");
  22.     fprintf(fptr,"/usr/include/stdio.h\n");
  23.     fprintf(fptr,"/usr/include/signal.h\n");
  24.     fprintf(fptr,"/usr/include/asm/signal.h\n");
  25.     fprintf(fptr,"&>>&0 0 0 0\n");
  26.     }
  27. //&>>&7 0 7 4
  28. //&<<&void putLCB(FILE *fptr);
  29. void putLCB(FILE *fptr){
  30.     fprintf(fptr,"&<<&*LCB*\n");
  31.     fprintf(fptr,"Line Clipboard\n");
  32.     fprintf(fptr,"&>>&0 0 0 0\n");
  33.     }
  34. //&>>&2 0 2 0
  35. //&<<&void putExtensions(FILE *fptr);
  36. void putExtensions(FILE *fptr){
  37.     fprintf(fptr,"&<<&*EXTENSIONS*\n");
  38.     fprintf(fptr,"cpp //\nc //\nhpp //\nh //\n"); // c/c++
  39.     fprintf(fptr,"tex %%\nsty %%\n");               // TeX
  40.     fprintf(fptr,"prg //\nch  //\nrmk #\n");      // Clipper
  41.     fprintf(fptr,"bat @Rem -\nsys rem -\n");      // MSDOS config
  42.     fprintf(fptr,"lsp ;\nasm ;\n");               // Lsp, asm
  43.     fprintf(fptr,"conf #\n");                     // Linux ".conf"
  44.     fprintf(fptr,"mif #\n");                      // makefiles
  45.     fprintf(fptr," #\n");
  46.     fprintf(fptr,"&>>&0 0 0 0\n");
  47.     }
  48. //&>>&A 0 A 0
  49. //&<<&void putKeyboardLayouts(FILE *fptr);
  50. //&<<&void pkl_PrintTable(FILE *fptr, char *keys[]){
  51. void pkl_PrintTable(FILE *fptr, char *keys[]){
  52.     int i;
  53.     for(i=0;i<4;i++) fprintf(fptr,"%s\n",keys[i]);
  54.     }
  55. //&>>&2 0 2 32
  56. void putKeyboardLayouts(FILE *fptr){
  57.     int etype=100;
  58.     while(etype!=0 && etype!=1 && etype!=2 && etype!=3 ){
  59.         printf("encoding type (0-ALT, 1-KOI8, 2-ISO, 3-WIN) :");
  60.         scanf("%d",&etype);
  61.         }
  62.  
  63.     fprintf(fptr,"&<<&*KEYMAP*\n");
  64.     if(etype==0){
  65. //&<<&        Alt enc. (dos, os2)
  66.     char *altCase="aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ"
  67.           "áÇíüóéúâñäÑàªåºç¿ê⌐ë¬è½ï¼î¡ì«Ä»ÅαÉßæΓÆπôΣöσòµûτùΦÿΘÖ∞£δ¢ΩÜφ¥ε₧∩ƒ";
  68.  
  69.     char *keys[]={                   /*  size = 4x108  */
  70.       "....1!2@3#4$5%6^7&8*9(0)-_=+"                    // 0..13
  71.       "....qQwWeErRtTyYuUiIoOpP[{]}"                    // 14..27
  72.       "....aAsSdDfFgGhHjJkKlL;:'\"`~"                   // 28..41
  73.       "..\\|zZxXcCvVbBnNmM,<.>/?",                      // 42..53
  74.  
  75.       "....1!2@3#4$5%6^7&8*9(0)-_=+"                    // 0..13
  76.       "....∩ƒóéÑàαÉΓÆδ¢πô¿ê«Ä»ÅΦÿΘÖ"                    // 14..27
  77.       "....áÇßæñäΣöúâσò⌐ë¬è½ïΩÜφ¥`~"                    // 28..41
  78.       "..\\|ºç∞£µûªåíü¡ì¼îτùε₧/?",                      // 42..53
  79.  
  80.       "....1!2@3#4$5%6^7&8*9(0)-_=+"                    // 0..13
  81.       "....⌐ëµûπô¬èÑà¡ìúâΦÿΘÖºçσòΩÜ"                    // 14..27
  82.       "....Σöδ¢óéáÇ»ÅαɫĽïñäªåφ¥`~"                    // 28..41
  83.       "..\\|∩ƒτùßæ¼î¿êΓÆ∞£íüε₧/?",                      // 42..53
  84.  
  85.       "....≡±≥≤⌠⌡÷≈°∙·√ⁿ²......■■.."                    // 0..13
  86.       "....┌╒┬╤┐╕╓╔╥╦╖╗..▀▀░░▒▒▓▓██"                    // 14..27
  87.       "....├╞┼╪┤╡╟╠╫╬╢╣▌▌▐▐││║║─═.."                    // 28..41
  88.       "....└╘┴╧┘╛╙╚╨╩╜╝▄▄......"                        // 42..53
  89.       };
  90.  
  91. //&>>&0 0 0 0
  92.         fprintf(fptr,"%s\n", altCase);
  93.         pkl_PrintTable(fptr, keys);
  94.         }
  95.     if(etype==1){
  96. //&<<&        KOI8
  97.     char *altCase="aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ"
  98.           "┴ß┬Γ╫≈╟τ─Σ┼σ╓÷┌·╔Θ╩Ω╦δ╠∞═φ╬ε╧∩╨≡╥≥╙≤╘⌠╒⌡╞µ╚Φ├π▐■█√▌²╪°┘∙▀ ▄ⁿ└α╤±";
  99.  
  100.     char *keys[]={      /* size = 4x108 */
  101.       "....1!2@3#4$5%6^7&8*9(0)-_=+"                    //  0..13
  102.       "....qQwWeErRtTyYuUiIoOpP[{]}"                    // 14..27
  103.       "....aAsSdDfFgGhHjJkKlL;:'\"`~"                   // 28..41
  104.       "..\\|zZxXcCvVbBnNmM,<.>/?",                      // 42..53
  105.  
  106.       "....1!2@3#4$5%6^7&8*9(0)-_=+"                    //  0..13
  107.       "....╤±╫≈┼σ╥≥╘⌠┘∙╒⌡╔Θ╧∩╨≡█√▌²"                    // 14..27
  108.       "....┴ß╙≤─Σ╞µ╟τ╩Ω╚Φ╦δ╠∞▀ ▄ⁿ`~"                    // 28..41
  109.       "..\\|┌·╪°╙≤╫≈┬Γ╬ε═φ▐■└α/?",                      // 42..53
  110.  
  111.       "....1!2@3#4$5%6^7&8*9(0)-_=+"                    //  0..13
  112.       "....╩Ω├π╒⌡╦δ┼σ╬ε╟τ█√▌²┌·╚Φ▀ "                    // 14..27
  113.       "....╞µ┘∙╫≈┴ß╨≡╥≥╧∩╠∞─Σ╓÷▄ⁿ`~"                    // 28..41
  114.       "..\\|╤±▐■╙≤═φ╔Θ╘⌠╪°┬Γ└α/?",                      // 42..53
  115.  
  116.       "......Öÿô¢ƒù£...........öö.."                    //  0..13
  117.       "....éóê╢âªñÑ╖╕º¿..ïïÉÉææÆÆìì"                    // 14..27
  118.       "....å»è╝ç▓░▒╜╛┤╡ÄÄÅÅüüííÇá.."                    // 28..41
  119.       "....ä⌐ë╣༬½║╗¡«îî......"                        // 42..53
  120.  
  121.       };
  122. //&>>&0 0 0 8
  123.         fprintf(fptr,"%s\n", altCase);
  124.         pkl_PrintTable(fptr, keys);
  125.         }
  126.     if(etype==2){
  127. //&<<&        ISO
  128.     char *altCase="aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ"
  129.           "╨░╤▒╥▓╙│╘┤╒╡╓╢╫╖╪╕┘╣┌║█╗▄╝▌╜▐╛▀┐α└ß┴Γ┬π├Σ─σ┼µ╞τ╟Φ╚Θ╔∞╠δ╦Ω╩φ═ε╬∩╧";
  130.  
  131.     char *keys[]={      /* size = 4x108 */
  132.       "....1!2@3#4$5%6^7&8*9(0)-_=+"                    //  0..13
  133.       "....qQwWeErRtTyYuUiIoOpP[{]}"                    // 14..27
  134.       "....aAsSdDfFgGhHjJkKlL;:'\"`~"                   // 28..41
  135.       "..\\|zZxXcCvVbBnNmM,<.>/?",                      // 42..53
  136.  
  137.       "....1!2@3#4$5%6^7&8*9(0)-_=+"                    //  0..13
  138.       "....∩╧╥▓╒╡α└Γ┬δ╦π├╪╕▐╛▀┐Φ╚Θ╔"                    // 14..27
  139.       "....╨░ß┴╘┤Σ─╙│σ┼┘╣┌║█╗Ω╩φ═`~"                    // 28..41
  140.       "..\\|╫╖∞╠ß┴╥▓╤▒▌╜▄╝τ╟ε╬/?",                      // 42..53
  141.  
  142.       "....1!2@3#4$5%6^7&8*9(0)-_=+"                    //  0..13
  143.       "....┘╣µ╞π├┌║╒╡▌╜╙│Φ╚Θ╔╫╖σ┼Ω╩"                    // 14..27
  144.       "....Σ─δ╦╥▓╨░▀┐α└▐╛█╗╘┤╓╢φ═`~"                    // 28..41
  145.       "..\\|∩╧τ╟ß┴▄╝╪╕Γ┬∞╠╤▒ε╬/?",                      // 42..53
  146.  
  147.       "............................"                    //  0..13
  148.       "............................"                    // 14..27
  149.       "............................"                    // 28..41
  150.       "........................"                        // 42..53
  151.  
  152.       };
  153. //&>>&17 0 14 0
  154.         fprintf(fptr,"%s\n", altCase);
  155.         pkl_PrintTable(fptr, keys);
  156.         }
  157.     if(etype==3){
  158. //&<<&        WIN    (w95)
  159.     char *altCase="aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ"
  160.           "áÇíüóéúâñäÑàªåºç¿ê⌐ë¬è½ï¼î¡ì«Ä»ÅαÉßæΓÆπôΣöσòµûτùΦÿΘÖ∞£δ¢ΩÜφ¥ε₧∩ƒ";
  161.  
  162.     char *keys[]={      /* size = 4x108 */
  163.       "....1!2@3#4$5%6^7&8*9(0)-_=+"                    // 0..13
  164.       "....qQwWeErRtTyYuUiIoOpP[{]}"                    // 14..27
  165.       "....aAsSdDfFgGhHjJkKlL;:'\"`~"                   // 28..41
  166.       "..\\|zZxXcCvVbBnNmM,<.>/?",                      // 42..53
  167.  
  168.       "....1!2@3#4$5%6^7&8*9(0)-_=+"                    // 0..13
  169.       ".... ▀Γ┬σ┼≡╨≥╥√█≤╙Φ╚ε╬∩╧°╪∙┘"                    // 14..27
  170.       "....α└±╤Σ─⌠╘π├⌡╒Θ╔Ω╩δ╦·┌²▌`~"                    // 28..41
  171.       "..\\|τ╟ⁿ▄÷╓µ╞ß┴φ═∞╠≈╫■▐/?",                      // 42..53
  172.  
  173.       "....1!2@3#4$5%6^7&8*9(0)-_=+"                    // 0..13
  174.       "....Θ╔÷╓≤╙Ω╩σ┼φ═π├°╪∙┘τ╟⌡╒·┌"                    // 14..27
  175.       "....⌠╘√█Γ┬α└∩╧≡╨ε╬δ╦Σ─µ╞²▌`~"                    // 28..41
  176.       "..\\| ▀≈╫±╤∞╠Φ╚≥╥ⁿ▄ß┴■▐/?",                      // 42..53
  177.  
  178.       "....░▒▓│┤╡╢╖╕╣║╗╝╜......╛╛.."                    // 0..13
  179.       "....¬ÑÆíÅêªÖó¢çï..»»ÇÇüüéé½½"                    // 14..27
  180.       "....ôûò¿äàù£º₧åë¡¡««ââèèö¥.."                    // 28..41
  181.       "....Éñæƒ⌐ÄúÿáÜìî¼¼......"                        // 42..53
  182.       };
  183.  
  184. //&>>&9 0 9 0
  185.         fprintf(fptr,"%s\n", altCase);
  186.         pkl_PrintTable(fptr, keys);
  187.         }
  188.     fprintf(fptr,"&>>&0 0 0 0\n");
  189.     }
  190. //&>>&1C 0 14 16
  191. //&<<&void putSetup(FILE *fptr);
  192. void putSetup(FILE *fptr){
  193.     int etype=100;
  194.     while(etype!=0 && etype!=1){
  195.         printf("Color type (0-Dos,os2,win, 1-Linux-color) :");
  196.         scanf("%d",&etype);
  197.         }
  198.  
  199.     fprintf(fptr,"&<<&*SETUP*\n");
  200.     switch(etype){
  201. //&<<&        case 0:
  202.         case 0:
  203.             fprintf(fptr,"Attrs=7 70 a 60 17 6f 1a 31\n");
  204.             break;
  205. //&>>&1 0 1 32
  206. //&<<&        case 1:
  207.         case 1:
  208.             fprintf(fptr,"Attrs=7 70 a 60 47 6f 4a 60\n");
  209.             break;
  210. //&>>&1 0 1 32
  211.         }
  212.     fprintf(fptr,"Params=1 1 1 0\n");
  213.     fprintf(fptr,"&>>&0 0 0 0\n");
  214.  
  215.     }
  216. //&>>&A 0 A B
  217. //&<<&void putCommand(FILE *fptr);
  218. void putCommand(FILE *fptr) {
  219.     int etype=100;
  220.     while(etype!=0 && etype!=1 && etype!=2 && etype!=3 ){
  221.         printf("Command Table (0-DOS, 1-OS2, 2-Linux, 3-Win95) :");
  222.         scanf("%d",&etype);
  223.         }
  224.     fprintf(fptr,"&<<&*COMMAND*\n");
  225.     fprintf(fptr,"40e HelloWorld\n");
  226. //&<<&    if(etype==0 || etype==2 || etype==3 ){    /// Dos Linux Win95
  227.     if(etype==0 || etype==2 || etype==3 ){    /// Dos Linux Win95
  228. //&<<&        // Movement
  229.     fprintf(fptr, "048 Up\n");
  230.     fprintf(fptr, "068 Up\n");
  231.     fprintf(fptr, "050 Down\n");
  232.     fprintf(fptr, "06d Down\n");
  233.     fprintf(fptr, "04b Left\n");
  234.     fprintf(fptr, "06a Left\n");
  235.     fprintf(fptr, "04d Right\n");
  236.     fprintf(fptr, "06b Right\n");
  237.  
  238.     fprintf(fptr, "448 TUp\n");  // Ctrl + Up
  239.     fprintf(fptr, "468 TUp\n");  // Ctrl + Up
  240.     fprintf(fptr, "450 TDown\n");  // Ctrl + Down
  241.     fprintf(fptr, "46d TDown\n");  // Ctrl + Down
  242.     fprintf(fptr, "44b TLeft\n");  // Ctrl + Left
  243.     fprintf(fptr, "46a TLeft\n");  // Ctrl + Left
  244.     fprintf(fptr, "44d TRight\n");  // Ctrl + Right
  245.     fprintf(fptr, "46b TRight\n");  // Ctrl + Right
  246.  
  247.     fprintf(fptr, "148 PUp\n");  // Shift + Up
  248.     fprintf(fptr, "168 PUp\n");  // Shift + Up
  249.     fprintf(fptr, "150 PDown\n");  // Shift + Down
  250.     fprintf(fptr, "16d PDown\n");  // Shift + Down
  251.     fprintf(fptr, "14b PLeft\n");  // Shift + Left
  252.     fprintf(fptr, "16a PLeft\n");  // Shift + Left
  253.     fprintf(fptr, "14d PRight\n");  // Shift + Right
  254.     fprintf(fptr, "16b PRight\n");  // Shift + Right
  255.  
  256.     fprintf(fptr, "248 FUp\n");  // Alt + Up
  257.     fprintf(fptr, "268 FUp\n");  // Alt + Up
  258.     fprintf(fptr, "250 FDown\n");  // Alt + Down
  259.     fprintf(fptr, "26d FDown\n");  // Alt + Down
  260.     fprintf(fptr, "24b FLeft\n");  // Alt + Left
  261.     fprintf(fptr, "26a FLeft\n");  // Alt + Left
  262.     fprintf(fptr, "24d FRight\n");  // Alt + Right
  263.     fprintf(fptr, "26b FRight\n");  // Alt + Right
  264.  
  265.     fprintf(fptr, "01c Enter\n");  // Enter
  266.     fprintf(fptr, "061 Enter\n");  // Enter
  267.     fprintf(fptr, "11c REnter\n");  // Shift + Enter
  268.     fprintf(fptr, "161 REnter\n");  // Shift + Enter
  269.  
  270.     fprintf(fptr, "00f Tab\n");  // Tab
  271.     fprintf(fptr, "10f LTab\n");  // Shift + Tab
  272.  
  273. //&>>&0 0 0 14
  274. //&<<&        // Insert and delete
  275. // Insert and delete
  276.  
  277.     fprintf(fptr, "052 InsCh\n");  // Ins
  278.     fprintf(fptr, "06f InsCh\n");  // Ins
  279.     fprintf(fptr, "053 DelCh\n");  // Del
  280.     fprintf(fptr, "070 DelCh\n");  // Del
  281.     fprintf(fptr, "152 InsLine\n");  // Shift + Ins
  282.     fprintf(fptr, "16f InsLine\n");  // Shift + Ins
  283.     fprintf(fptr, "252 InsFold\n");  // Alt + Ins
  284.     fprintf(fptr, "26f InsFold\n");  // Alt + Ins
  285.     fprintf(fptr, "153 DelLine\n");  // Shift + Del
  286.     fprintf(fptr, "170 DelLine\n");  // Shift + Del
  287.     fprintf(fptr, "253 DelLine\n");  // Alt + Del
  288.     fprintf(fptr, "270 DelLine\n");  // Alt + Del
  289.     fprintf(fptr, "00E BS\n");  // BS
  290.     fprintf(fptr, "10e R_BS\n");  // Shift + BS
  291.  
  292. //&>>&F 0 F B
  293. //&<<&        // Line Killing
  294. // Line Killing
  295.     fprintf(fptr, "04a KillWord\n" );     // [+]
  296.     fprintf(fptr, "14a KillEnd\n" );     // SHIFT [+]
  297.     fprintf(fptr, "44a KillBeg\n" );     // CTRL [+]
  298.     fprintf(fptr, "04e KillWord\n" );     // [-]
  299.     fprintf(fptr, "14e KillEnd\n" );     // SHIFT [-]
  300.     fprintf(fptr, "44e KillBeg\n" );     // CTRL [-]
  301. //&>>&6 0 6 14
  302. //&<<&        // Copying of chars
  303.     fprintf(fptr,"03b CSave\n"      );  //  F1:            Ch
  304.     fprintf(fptr,"13b CMove\n"      );  //  SHIFT-F1:      Ch
  305.     fprintf(fptr,"23b WSave\n"      );  //  ALT-F1:        Wo
  306.     fprintf(fptr,"33b WMove\n"      );  //  ALT-SHIFT-F1:  Wo
  307.     fprintf(fptr,"63b BWord\n"      );  //  CTRL-ALT-F1
  308.     fprintf(fptr,"73b BWord\n"      );  //  CTRL-SHIFT-ALT-F1
  309.     fprintf(fptr,"43b TSave\n"      );  //  CTRL-F1:       Li
  310.     fprintf(fptr,"53b TMove\n"      );  //  CTRL-SHIFT-F1: Li
  311.     fprintf(fptr,"03c CRest\n"      );  //  F2: Clipboard =>
  312.     fprintf(fptr,"13c CClear\n"     );  //  SHIFT-F2: Clear C
  313. //&>>&6 0 6 1B
  314. //&<<&        // Copying of lines
  315. // Copying of lines
  316.     fprintf(fptr, "03d LSave\n");  // F3:
  317.     fprintf(fptr, "43d LTSave\n");  // CTRL-F3:
  318.     fprintf(fptr, "13d LMove\n");  // SHIFT-F3:
  319.     fprintf(fptr, "53d LTMove\n");  // CTRL-SHIFT-F3
  320.     fprintf(fptr, "03e LRest\n");  // F4:
  321.     fprintf(fptr, "13e LClear\n");  // SHIFT-F4:
  322. //&>>&6 0 6 0
  323. //&<<&        // Various types of exit
  324. // Various types of exit
  325.  
  326.     fprintf(fptr,"001 Escape\n"); // ESC: temporary exit to DOS
  327.     fprintf(fptr,"101 EscapeExec\n"); // SHIFT-ESC: execute current line
  328.     fprintf(fptr,"23e EscapeExecLCB\n"); // ALT-F4: execute ClipBoard
  329. //&>>&4 0 4 1E
  330. //&<<&        // Various switchings  (ins/ovr , alt key , status line .........)
  331.     fprintf(fptr, "21c S_AutoIndent\n");   // ALT-ENTER    (on/off auto-indent)
  332.     fprintf(fptr, "452 S_ModeIns\n");   // CTRL-INS (insert mode)
  333.     fprintf(fptr, "453 S_ModeOvr\n");   // CTRL-DEL (overwrite mode)
  334.     fprintf(fptr, "46f S_ModeIns\n");   // CTRL-INS (insert mode)
  335.     fprintf(fptr, "470 S_ModeOvr\n");   // CTRL-DEL (overwrite mode)
  336.     fprintf(fptr, "802 S_ACode1\n");   // CAPS+1 switch to QQ keyboard as alt
  337.     fprintf(fptr, "803 S_ACode2\n");   // CAPS+2 switch to QJ keyboard as alt
  338.     fprintf(fptr, "804 S_ACode3\n");   // CAPS+3 switch to ┼╬ keyboard as alt
  339.     fprintf(fptr, "41f S_StatusLine\n");   // Ctrl+'S' switch status line ON/OFF
  340.     fprintf(fptr, "837 S_SearchMode\n");   // CAPS + "*\n"  search modes switching
  341. //&>>&5 0 5 16
  342. //&<<&        // Search & replace commands
  343.     fprintf(fptr,"037 SearchFWD\n");       // "*\n" search forward
  344.     fprintf(fptr,"137 SearchBCK\n");       // SHIFT+"*\n" search back
  345.     fprintf(fptr,"237 Replace\n");       // ALT+"*\n" REPLACE
  346.     fprintf(fptr,"437 SearchPage\n");       //  CTRL+"*\n"  switch into SearchPage
  347. //&>>&3 0 3 13
  348.         fprintf(fptr,"852 PageIns\n");    // CAPS+INS insert new page
  349.         fprintf(fptr,"86f PageIns\n");    // CAPS+INS insert new page
  350. //&<<&        // Marked Lines Commands
  351.  
  352.     fprintf(fptr,"848 MarkUp\n");  // CAPS+UP
  353.     fprintf(fptr,"868 MarkUp\n");  // CAPS+UP
  354.     fprintf(fptr,"850 MarkDown\n");  // CAPS+DOWN
  355.     fprintf(fptr,"86d MarkDown\n");  // CAPS+DOWN
  356.     fprintf(fptr,"c48 MarkTUp\n");  // CAPS+CTRL+UP
  357.     fprintf(fptr,"c68 MarkTUp\n");  // CAPS+CTRL+UP
  358.     fprintf(fptr,"c50 MarkTDown\n");  // CAPS+CTRL+DOWN
  359.     fprintf(fptr,"c6d MarkTDown\n");  // CAPS+CTRL+DOWN
  360.     fprintf(fptr,"948 MarkPUp\n");  // CAPS+SHIFT+UP
  361.     fprintf(fptr,"968 MarkPUp\n");  // CAPS+SHIFT+UP
  362.     fprintf(fptr,"950 MarkPDown\n");  // CAPS+SHIFT+DOWN
  363.     fprintf(fptr,"96d MarkPDown\n");  // CAPS+SHIFT+DOWN
  364.  
  365.     fprintf(fptr,"03f MarkSaveB\n");  // F5 - push marked lines to stack
  366.     fprintf(fptr,"040 MarkRestB\n");  // F6 - pop marked lines from stack
  367.  
  368.     fprintf(fptr,"c4b MarkLast\n");     // CAPS-CTRL-LEFT  : LastMarked();
  369.     fprintf(fptr,"c6a MarkLast\n");     // CAPS-CTRL-LEFT  : LastMarked();
  370.     fprintf(fptr,"c4d MarkFirst\n");     // CAPS-CTRL-RIGHT
  371.     fprintf(fptr,"c6b MarkFirst\n");     // CAPS-CTRL-RIGHT
  372.  
  373.     fprintf(fptr,"84b MarkPrev\n");    // CAPS-Left
  374.     fprintf(fptr,"86a MarkPrev\n");    // CAPS-Left
  375.     fprintf(fptr,"84d MarkNext\n");    // CAPS-Right
  376.     fprintf(fptr,"86b MarkNext\n");    // CAPS-Right
  377.  
  378.     fprintf(fptr,"80e MarkBS\n");                   // CAPS-BS
  379.  
  380. //&>>&1B 0 15 13
  381. //&<<&        // Macros
  382.     fprintf(fptr,"041 Macro\n");        // F7
  383.     fprintf(fptr,"141 MacroRec\n");     // SHIFT+F7
  384. //&>>&0 0 0 23
  385.         }
  386. //&>>&5 0 5 1C
  387. //&<<&    if(etype==1){    /// os2
  388.     if(etype==1){    /// os2
  389. //&<<&        // Movement
  390.     fprintf(fptr, "048 Up\n");
  391.     fprintf(fptr, "050 Down\n");
  392.     fprintf(fptr, "04b Left\n");
  393.     fprintf(fptr, "04d Right\n");
  394.  
  395.     fprintf(fptr, "48d TUp\n");  // Ctrl + Up
  396.     fprintf(fptr, "491 TDown\n");  // Ctrl + Down
  397.     fprintf(fptr, "473 TLeft\n");  // Ctrl + Left
  398.     fprintf(fptr, "474 TRight\n");  // Ctrl + Right
  399.  
  400.     fprintf(fptr, "148 PUp\n");  // Shift + Up
  401.     fprintf(fptr, "150 PDown\n");  // Shift + Down
  402.     fprintf(fptr, "14b PLeft\n");  // Shift + Left
  403.     fprintf(fptr, "14d PRight\n");  // Shift + Right
  404.  
  405.     fprintf(fptr, "298 FUp\n");  // Alt + Up
  406.     fprintf(fptr, "2A0 FDown\n");  // Alt + Down
  407.     fprintf(fptr, "29b FLeft\n");  // Alt + Left
  408.     fprintf(fptr, "29d FRight\n");  // Alt + Right
  409.  
  410.     fprintf(fptr, "01c Enter\n");  // Enter
  411.     fprintf(fptr, "11c REnter\n");  // Shift + Enter
  412.  
  413.     fprintf(fptr, "00f Tab\n");  // Tab
  414.     fprintf(fptr, "10f LTab\n");  // Shift + Tab
  415.  
  416. //&>>&0 0 0 14
  417. //&<<&        // Insert and delete
  418. // Insert and delete
  419.  
  420.     fprintf(fptr, "052 InsCh\n");  // Ins
  421.     fprintf(fptr, "053 DelCh\n");  // Del
  422.     fprintf(fptr, "152 InsLine\n");  // Shift + Ins
  423.     fprintf(fptr, "2a2 InsFold\n");  // Alt + Ins
  424.     fprintf(fptr, "153 DelLine\n");  // Shift + Del
  425.     fprintf(fptr, "2a3 DelLine\n");  // Alt + Del
  426.     fprintf(fptr, "00e BS\n");  // BS
  427.     fprintf(fptr, "10e R_BS\n");  // Shift + BS
  428.  
  429. //&>>&7 0 7 0
  430. //&<<&        // Line Killing
  431. // Line Killing
  432.     fprintf(fptr, "04a KillWord\n" );     // [+]
  433.     fprintf(fptr, "14a KillEnd\n" );     // SHIFT [+]
  434.     fprintf(fptr, "490 KillBeg\n" );     // CTRL [+]
  435.     fprintf(fptr, "04e KillWord\n" );     // [-]
  436.     fprintf(fptr, "14e KillEnd\n" );     // SHIFT [-]
  437.     fprintf(fptr, "48e KillBeg\n" );     // CTRL [-]
  438. //&>>&6 0 6 14
  439. //&<<&        // Copying of chars
  440.     fprintf(fptr,"03b CSave\n"      );  //  F1:            Ch
  441.     fprintf(fptr,"154 CMove\n"      );  //  SHIFT-F1:      Ch
  442.     fprintf(fptr,"268 WSave\n"      );  //  ALT-F1:        Wo
  443.     fprintf(fptr,"368 WMove\n"      );  //  ALT-SHIFT-F1:  Wo
  444.     fprintf(fptr,"668 BWord\n"      );  //  CTRL-ALT-F1
  445.     fprintf(fptr,"768 BWord\n"      );  //  CTRL-SHIFT-ALT-F1
  446.     fprintf(fptr,"45e TSave\n"      );  //  CTRL-F1:       Li
  447.     fprintf(fptr,"55e TMove\n"      );  //  CTRL-SHIFT-F1: Li
  448.     fprintf(fptr,"03c CRest\n"      );  //  F2: Clipboard =>
  449.     fprintf(fptr,"155 CClear\n"     );  //  SHIFT-F2: Clear C
  450. //&>>&6 0 6 1B
  451. //&<<&        // Copying of lines
  452. // Copying of lines
  453.     fprintf(fptr, "03d LSave\n");  // F3:
  454.     fprintf(fptr, "460 LTSave\n");  // CTRL-F3:
  455.     fprintf(fptr, "156 LMove\n");  // SHIFT-F3:
  456.     fprintf(fptr, "560 LTMove\n");  // CTRL-SHIFT-F3
  457.     fprintf(fptr, "03e LRest\n");  // F4:
  458.     fprintf(fptr, "157 LClear\n");  // SHIFT-F4:
  459. //&>>&6 0 6 1F
  460. //&<<&        // Various types of exit
  461. // Various types of exit
  462.  
  463.     fprintf(fptr,"001 Escape\n"); // ESC: temporary exit to DOS
  464.     fprintf(fptr,"101 EscapeExec\n"); // SHIFT-ESC: execute current line
  465.     fprintf(fptr,"26b EscapeExecLCB\n"); // ALT-F4: execute ClipBoard
  466. //&>>&2 0 2 13
  467. //&<<&        // Various switchings  (ins/ovr , alt key , status line .........)
  468.     fprintf(fptr, "21c S_AutoIndent\n");   // ALT-ENTER    (on/off auto-indent)
  469.     fprintf(fptr, "492 S_ModeIns\n");   // CTRL-INS (insert mode)
  470.     fprintf(fptr, "493 S_ModeOvr\n");   // CTRL-DEL (overwrite mode)
  471.     fprintf(fptr, "802 S_ACode1\n");   // CAPS+1 switch to QQ keyboard as alt
  472.     fprintf(fptr, "803 S_ACode2\n");   // CAPS+2 switch to QJ keyboard as alt
  473.     fprintf(fptr, "804 S_ACode3\n");   // CAPS+3 switch to ┼╬ keyboard as alt
  474.     fprintf(fptr, "41f S_StatusLine\n");   // Ctrl+'S' switch status line ON/OFF
  475.     fprintf(fptr, "837 S_SearchMode\n");   // CAPS + "*\n"  search modes switching
  476. //&>>&1 0 1 0
  477. //&<<&        // Search & replace commands
  478.     fprintf(fptr,"037 SearchFWD\n");       // "*\n" search forward
  479.     fprintf(fptr,"137 SearchBCK\n");       // SHIFT+"*\n" search back
  480.     fprintf(fptr,"237 Replace\n");       // ALT+"*\n" REPLACE
  481.     fprintf(fptr,"496 SearchPage\n");       //  CTRL+"*\n"  switch into SearchPage
  482. //&>>&3 0 3 13
  483.         fprintf(fptr,"852 PageIns\n");    // CAPS+INS insert new page
  484.         fprintf(fptr,"86f PageIns\n");    // CAPS+INS insert new page
  485. //&<<&        // Marked Lines Commands
  486.  
  487.     fprintf(fptr,"848 MarkUp\n");  // CAPS+UP
  488.     fprintf(fptr,"850 MarkDown\n");  // CAPS+DOWN
  489.     fprintf(fptr,"c8d MarkTUp\n");  // CAPS+CTRL+UP
  490.     fprintf(fptr,"c91 MarkTDown\n");  // CAPS+CTRL+DOWN
  491.     fprintf(fptr,"948 MarkPUp\n");  // CAPS+SHIFT+UP
  492.     fprintf(fptr,"950 MarkPDown\n");  // CAPS+SHIFT+DOWN
  493.  
  494.     fprintf(fptr,"03f MarkSaveB\n");  // F5 - push marked lines to stack
  495.     fprintf(fptr,"040 MarkRestB\n");  // F6 - pop marked lines from stack
  496.  
  497.     fprintf(fptr,"c73 MarkLast\n");     // CAPS-CTRL-LEFT  : LastMarked();
  498.     fprintf(fptr,"c74 MarkFirst\n");     // CAPS-CTRL-RIGHT
  499.  
  500.     fprintf(fptr,"84b MarkPrev\n");    // CAPS-Left
  501.     fprintf(fptr,"84d MarkNext\n");    // CAPS-Right
  502.  
  503.     fprintf(fptr,"80e MarkBS\n");                   // CAPS-BS
  504.  
  505. //&>>&12 0 12 10
  506. //&<<&        // Macros
  507.     fprintf(fptr,"041 Macro\n");     // F7
  508.     fprintf(fptr,"15a MacroRec\n");     // SHIFT+F7
  509. //&>>&1 0 1 0
  510.         }
  511. //&>>&5 0 5 14
  512. //&<<&    digits/Letters/Delimiters
  513.  
  514. fprintf( fptr, " %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n" ,  2  , 0x100+ 2 , 0x200+ 2 , 0x300+ 2  );
  515. fprintf( fptr, " %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n" ,  3  , 0x100+ 3 , 0x200+ 3 , 0x300+ 3  );
  516. fprintf( fptr, " %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n" ,  4  , 0x100+ 4 , 0x200+ 4 , 0x300+ 4  );
  517. fprintf( fptr, " %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n" ,  5  , 0x100+ 5 , 0x200+ 5 , 0x300+ 5  );
  518. fprintf( fptr, " %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n" ,  6  , 0x100+ 6 , 0x200+ 6 , 0x300+ 6  );
  519. fprintf( fptr, " %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n" ,  7  , 0x100+ 7 , 0x200+ 7 , 0x300+ 7  );
  520. fprintf( fptr, " %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n" ,  8  , 0x100+ 8 , 0x200+ 8 , 0x300+ 8  );
  521. fprintf( fptr, " %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n" ,  9  , 0x100+ 9 , 0x200+ 9 , 0x300+ 9  );
  522. fprintf( fptr, " %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n" , 10  , 0x100+10 , 0x200+10 , 0x300+10  );
  523. fprintf( fptr, " %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n" , 11  , 0x100+11 , 0x200+11 , 0x300+11  );
  524. fprintf( fptr, " %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n" , 12  , 0x100+12 , 0x200+12 , 0x300+12  );
  525. fprintf( fptr, " %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n" , 13  , 0x100+13 , 0x200+13 , 0x300+13  );
  526. fprintf( fptr, " %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n" , 41  , 0x100+41 , 0x200+41 , 0x300+41  );
  527. fprintf( fptr, " %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n" , 43  , 0x100+43 , 0x200+43 , 0x300+43  );
  528. fprintf( fptr, " %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n %0004x Ascii0\n" , 53  , 0x100+53 , 0x200+53 , 0x300+53  );
  529.  
  530. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 16  , 0x100+16 , 0x200+16 , 0x300+16  );
  531. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 17  , 0x100+17 , 0x200+17 , 0x300+17  );
  532. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 18  , 0x100+18 , 0x200+18 , 0x300+18  );
  533. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 19  , 0x100+19 , 0x200+19 , 0x300+19  );
  534. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 20  , 0x100+20 , 0x200+20 , 0x300+20  );
  535. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 21  , 0x100+21 , 0x200+21 , 0x300+21  );
  536. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 22  , 0x100+22 , 0x200+22 , 0x300+22  );
  537. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 23  , 0x100+23 , 0x200+23 , 0x300+23  );
  538. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 24  , 0x100+24 , 0x200+24 , 0x300+24  );
  539. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 25  , 0x100+25 , 0x200+25 , 0x300+25  );
  540. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 30  , 0x100+30 , 0x200+30 , 0x300+30  );
  541. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 31  , 0x100+31 , 0x200+31 , 0x300+31  );
  542. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 32  , 0x100+32 , 0x200+32 , 0x300+32  );
  543. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 33  , 0x100+33 , 0x200+33 , 0x300+33  );
  544. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 34  , 0x100+34 , 0x200+34 , 0x300+34  );
  545. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 35  , 0x100+35 , 0x200+35 , 0x300+35  );
  546. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 36  , 0x100+36 , 0x200+36 , 0x300+36  );
  547. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 37  , 0x100+37 , 0x200+37 , 0x300+37  );
  548. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 38  , 0x100+38 , 0x200+38 , 0x300+38  );
  549. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 44  , 0x100+44 , 0x200+44 , 0x300+44  );
  550. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 45  , 0x100+45 , 0x200+45 , 0x300+45  );
  551. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 46  , 0x100+46 , 0x200+46 , 0x300+46  );
  552. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 47  , 0x100+47 , 0x200+47 , 0x300+47  );
  553. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 48  , 0x100+48 , 0x200+48 , 0x300+48  );
  554. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 49  , 0x100+49 , 0x200+49 , 0x300+49  );
  555. fprintf( fptr, " %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n %0004x Ascii1\n" , 50  , 0x100+50 , 0x200+50 , 0x300+50  );
  556.  
  557. fprintf( fptr, " %0004x Ascii2\n %0004x Ascii2\n %0004x Ascii2\n %0004x Ascii2\n" , 26  , 0x100+26 , 0x200+26 , 0x300+26  );
  558. fprintf( fptr, " %0004x Ascii2\n %0004x Ascii2\n %0004x Ascii2\n %0004x Ascii2\n" , 27  , 0x100+27 , 0x200+27 , 0x300+27  );
  559. fprintf( fptr, " %0004x Ascii2\n %0004x Ascii2\n %0004x Ascii2\n %0004x Ascii2\n" , 39  , 0x100+39 , 0x200+39 , 0x300+39  );
  560. fprintf( fptr, " %0004x Ascii2\n %0004x Ascii2\n %0004x Ascii2\n %0004x Ascii2\n" , 40  , 0x100+40 , 0x200+40 , 0x300+40  );
  561. fprintf( fptr, " %0004x Ascii2\n %0004x Ascii2\n %0004x Ascii2\n %0004x Ascii2\n" , 51  , 0x100+51 , 0x200+51 , 0x300+51  );
  562. fprintf( fptr, " %0004x Ascii2\n %0004x Ascii2\n %0004x Ascii2\n %0004x Ascii2\n" , 52  , 0x100+52 , 0x200+52 , 0x300+52  );
  563.  
  564. fprintf( fptr, " %0004x Space \n %0004x Space \n %0004x Space \n %0004x Space \n" , 57  , 0x100+57 , 0x200+57 , 0x300+57  );
  565.  
  566. //&>>&31 0 13 0
  567. //&<<&    if(etype==2){    //// Linux Console
  568.     if(etype==2){    //// Linux Console
  569.         fprintf(fptr, " 702 Console\n");
  570.         fprintf(fptr, " 703 Console\n");
  571.         fprintf(fptr, " 704 Console\n");
  572.         fprintf(fptr, " 705 Console\n");
  573.         fprintf(fptr, " 706 Console\n");
  574.         fprintf(fptr, " 707 Console\n");
  575.         fprintf(fptr, " 708 Console\n");
  576.         fprintf(fptr, " 709 Console\n");
  577.         }
  578. //&>>&1 0 1 1E
  579.     fprintf(fptr,"&>>&0 0 0 0\n");
  580.     }
  581. //&>>&7 0 7 0
  582. //&<<&void putMacro(FILE *fptr);
  583. void putMacro(FILE *fptr){
  584.     fprintf(fptr,"&<<&*MACRO*\n");
  585.  
  586. //&<<&    fprintf(fptr,"&<<&Arithmetics & ...\n");
  587.     fprintf(fptr,"&<<&Arithmetics & ...\n");
  588.     fprintf(fptr,"proc add %03x mathop endp\n",MATHOP_ADD);
  589.     fprintf(fptr,"proc sub %03x mathop endp\n",MATHOP_SUB);
  590.     fprintf(fptr,"proc mul %03x mathop endp\n",MATHOP_MUL);
  591.     fprintf(fptr,"proc div %03x mathop endp\n",MATHOP_DIV);
  592.     fprintf(fptr,"proc mod %03x mathop endp\n",MATHOP_MOD);
  593.     fprintf(fptr,"proc and %03x mathop endp\n",MATHOP_AND);
  594.     fprintf(fptr,"proc or  %03x mathop endp\n",MATHOP_OR );
  595.     fprintf(fptr,"proc xor %03x mathop endp\n",MATHOP_XOR);
  596.     fprintf(fptr,"proc eq  %03x predicate endp\n",PREDICATE_EQ);
  597.     fprintf(fptr,"proc ne  %03x predicate endp\n",PREDICATE_NE);
  598.     fprintf(fptr,"proc lt  %03x predicate endp\n",PREDICATE_LT);
  599.     fprintf(fptr,"proc gt  %03x predicate endp\n",PREDICATE_GT);
  600.     fprintf(fptr,"&>>&0 0 0 0\n");
  601. //&>>&C 0 C 1F
  602. //&<<&    fprintf(fptr,"&<<&Definitions...\n");
  603.     fprintf(fptr,"&<<&Definitions...\n");
  604.  
  605.     fprintf(fptr,"proc pushf   %03x push endp\n",PUSH_FLAG);
  606.     fprintf(fptr,"proc pushl   %03x push endp\n",PUSH_CLINE_L);
  607.     fprintf(fptr,"proc pushls  %03x push endp\n",PUSH_CLINE_S);
  608.     fprintf(fptr,"proc pushc   %03x push endp\n",PUSH_CHAR);
  609.     fprintf(fptr,"proc pushlcb %03x push endp\n",PUSH_LCB);
  610.     fprintf(fptr,"proc pushccb %03x push endp\n",PUSH_CCB);
  611.  
  612.     fprintf(fptr,"proc cvtI2SH %03x convert endp\n", CONVERT_I2SH);
  613.     fprintf(fptr,"proc cvtI2SD %03x convert endp\n", CONVERT_I2SD);
  614.     fprintf(fptr,"proc cvtS2IH %03x convert endp\n", CONVERT_S2IH);
  615.     fprintf(fptr,"proc cvtS2ID %03x convert endp\n", CONVERT_S2ID);
  616.     fprintf(fptr,"proc cvtS2L  %03x convert endp\n", CONVERT_S2L );
  617.     fprintf(fptr,"proc cvtL2S  %03x convert endp\n", CONVERT_L2S );
  618.     fprintf(fptr,"proc cvtI2C  %03x convert endp\n", CONVERT_I2C );
  619.     fprintf(fptr,"proc cvtC2I  %03x convert endp\n", CONVERT_C2I );
  620.  
  621.  
  622.     fprintf(fptr,"&>>&0 0 0 0\n");
  623. //&>>&4 0 4 0
  624. //&<<&    fprintf(fptr,"&<<&Movement...\n");
  625.     fprintf(fptr,"&<<&Movement...\n");
  626. //&<<&    fprintf(fptr,"proc PRight\n");
  627.     fprintf(fptr,"&<<&proc PRight\n");
  628.     fprintf(fptr,"proc PRight\n");
  629.     fprintf(fptr,"    pushc \' \' gt\n");
  630.     fprintf(fptr,"    do\n");
  631.     fprintf(fptr,"        Right\n");
  632.     fprintf(fptr,"        pushc \' \' gt\n");
  633.     fprintf(fptr,"    enddo\n");
  634.     fprintf(fptr,"    pushc \' \' eq\n");
  635.     fprintf(fptr,"    do\n");
  636.     fprintf(fptr,"        Right\n");
  637.     fprintf(fptr,"        pushc \' \' eq\n");
  638.     fprintf(fptr,"    enddo\n");
  639.     fprintf(fptr,"endp\n");
  640.     fprintf(fptr,"&>>&0 0 0 0\n");
  641. //&>>&0 0 0 0
  642. //&<<&    fprintf(fptr,"proc PLeft\n");
  643.     fprintf(fptr,"&<<&proc PLeft\n");
  644.     fprintf(fptr,"proc PLeft\n");
  645.     fprintf(fptr,"    pushc \' \' ne\n");
  646.     fprintf(fptr,"    do\n");
  647.     fprintf(fptr,"        Left\n");
  648.     fprintf(fptr,"        pushc \' \' ne pushf\n");
  649.     fprintf(fptr,"        %03x ioctl 0 gt pushf\n",IOCTL_CX);
  650.     fprintf(fptr,"        and pop\n");
  651.     fprintf(fptr,"    enddo\n");
  652.     fprintf(fptr,"    pushc \' \' eq\n");
  653.     fprintf(fptr,"    do\n");
  654.     fprintf(fptr,"        Left\n");
  655.     fprintf(fptr,"        pushc \' \' eq pushf\n");
  656.     fprintf(fptr,"        %03x ioctl 0 gt pushf\n",IOCTL_CX);
  657.     fprintf(fptr,"        and pop\n");
  658.     fprintf(fptr,"    enddo\n");
  659.     fprintf(fptr,"endp\n");
  660.     fprintf(fptr,"&>>&0 0 0 0\n");
  661. //&>>&12 0 12 1
  662.     fprintf(fptr,"&>>&0 0 0 0\n");
  663. //&>>&2 0 2 1A
  664. //&<<&    fprintf(fptr,"&<<&Editing,killing...\n");
  665.     fprintf(fptr,"&<<&Editing,killing...\n");
  666. //&<<&    fprintf(fptr,"proc KillWord\n");
  667.     fprintf(fptr,"&<<&proc KillWord\n");
  668.     fprintf(fptr,"proc KillWord\n");
  669.     fprintf(fptr,"    %03x ioctl if ret endif\n",IOCTL_ISMARKED);
  670.     fprintf(fptr,"    BWord\n");
  671.     fprintf(fptr,"    pushc \' \' gt\n");
  672.     fprintf(fptr,"    do\n");
  673.     fprintf(fptr,"        DelCh\n");
  674.     fprintf(fptr,"        pushc \' \' gt\n");
  675.     fprintf(fptr,"    enddo\n");
  676.     fprintf(fptr,"    pushc \' \' eq\n");
  677.     fprintf(fptr,"    do\n");
  678.     fprintf(fptr,"        DelCh\n");
  679.     fprintf(fptr,"        pushc \' \' eq\n");
  680.     fprintf(fptr,"    enddo\n");
  681.     fprintf(fptr,"endp\n");
  682.     fprintf(fptr,"&>>&0 0 0 0\n");
  683. //&>>&E 0 E 0
  684. //&<<&    fprintf(fptr,"proc R_BS\n");
  685.     fprintf(fptr,"&<<&proc R_BS\n");
  686.     fprintf(fptr,"proc R_BS\n");
  687.     fprintf(fptr,"    %03x ioctl if ret endif\n",IOCTL_ISMARKED);
  688.     fprintf(fptr,"    %03x ioctl if ret endif\n",IOCTL_ISFOLD);
  689.     fprintf(fptr,"    %03x ioctl 0 eq if ret endif\n",IOCTL_SY);
  690.     fprintf(fptr,"    KillBeg\n");
  691.     fprintf(fptr,"    pushls\n");
  692.     fprintf(fptr,"    DelLine\n");
  693.     fprintf(fptr,"    Up\n");
  694.     fprintf(fptr,"    TRight\n");
  695.     fprintf(fptr,"    %03x ioctl\n",IOCTL_CX);
  696.     fprintf(fptr,"    swp\n");
  697.     fprintf(fptr,"    pop\n");
  698.     fprintf(fptr,"    dup %03x ioctl lt\n",IOCTL_CX);
  699.     fprintf(fptr,"    do\n");
  700.     fprintf(fptr,"        Left\n");
  701.     fprintf(fptr,"        dup %03x ioctl lt\n",IOCTL_CX);
  702.     fprintf(fptr,"    enddo\n");
  703.     fprintf(fptr,"endp\n");
  704.     fprintf(fptr,"&>>&0 0 0 0\n");
  705. //&>>&7 0 7 1C
  706. //&<<&    fprintf(fptr,"proc REnter\n");
  707.     fprintf(fptr,"&<<&proc REnter\n");
  708.     fprintf(fptr,"proc REnter\n");
  709.     fprintf(fptr,"    007 ioctl if ret endif\n");
  710.     fprintf(fptr,"    pushls\n");
  711.     fprintf(fptr,"    KillEnd\n");
  712.     fprintf(fptr,"    Down\n");
  713.     fprintf(fptr,"    cvtS2L\n");
  714.     fprintf(fptr,"    pop\n");
  715.     fprintf(fptr,"    KillBeg\n");
  716.     fprintf(fptr,"endp\n");
  717.     fprintf(fptr,"&>>&0 0 0 0\n");
  718. //&>>&B 0 B 0
  719.     fprintf(fptr,"&>>&0 0 0 0\n");
  720. //&>>&2 0 2 2A
  721.  
  722.     fprintf(fptr,"proc HelloWorld\n");
  723.     fprintf(fptr,"    InsLine\n");
  724.     fprintf(fptr,"    TLeft\n");
  725.     fprintf(fptr,"    Tab Tab Tab Tab\n");
  726.     fprintf(fptr,"    \"Hello World! \"\n");
  727.     fprintf(fptr,"    pop\n");
  728.     fprintf(fptr,"endp\n");
  729.  
  730.     fprintf(fptr,"&>>&0 0 0 0\n");
  731.     }
  732. //&>>&4 0 4 1
  733.  
  734. //&<<&void main(){
  735. int main(int argc,char **argv){
  736.     FILE *fptr;
  737.     if(argc>1) fptr=fopen(argv[1],"w");
  738. //&<<&    else {
  739.     else {
  740.         char *env_home,*env_mmm;
  741.         env_home=getenv("HOME");
  742.         env_mmm=getenv("MMM");
  743.         char *RunDir=new char[0x100]; if(RunDir==0)exit(1);
  744.         strcpy(RunDir,env_home!=0?env_home:
  745.                       env_mmm!=0 ?env_mmm :
  746. #ifdef __linux__
  747.                       "./");
  748.         if(RunDir[strlen(RunDir)-1]!='/') strcat(RunDir,"/");
  749. #else
  750.                       ".\\");
  751.         if(RunDir[strlen(RunDir)-1]!='\\') strcat(RunDir,"\\");
  752. #endif
  753.         strcat(RunDir,"mmm_base.cfg");
  754.         printf("Editing file <%s>\n",RunDir);
  755.         fptr=fopen(RunDir,"w");
  756.         }
  757. //&>>&E 0 E 1F
  758.  
  759.     if(fptr==0) {
  760.         printf("Cannot open output file\n");
  761.         exit(-1);
  762.         }
  763.  
  764. ////    putSearch(fptr);
  765. ////    putTemp(fptr);
  766. ////    putLCB(fptr);
  767.     putExtensions(fptr);
  768.     putKeyboardLayouts(fptr);
  769.     putSetup(fptr);
  770.     putCommand(fptr);
  771.     putMacro(fptr);
  772.     return 0;
  773.     }
  774. //&>>&11 0 11 0
  775. #if 0
  776. //&<<&*MACRO*
  777. //&<<&Arithmetics & ...
  778. proc add 0 mathop endp
  779. proc sub 1 mathop endp
  780. proc mul 2 mathop endp
  781. proc div 3 mathop endp
  782. proc mod 4 mathop endp
  783. proc and 5 mathop endp
  784. proc or  6 mathop endp
  785. proc xor 7 mathop endp
  786.  
  787. proc eq  0 predicate endp
  788. proc ne  1 predicate endp
  789. proc lt  2 predicate endp
  790. proc gt  3 predicate endp
  791. //&>>&C 0 C 15
  792. //&<<&proc PrintString
  793. proc PrintString
  794.     4 convert Enter pop
  795. endp
  796. //&>>&1 0 1 9
  797. //&<<&proc PrintInt
  798. proc PrintInt
  799.     dup
  800.     0 convert
  801. %    pop
  802.     PrintString
  803. endp
  804. //&>>&2 0 2 5
  805. //&<<&proc TestQuery
  806. proc TestQuery
  807.     query
  808.     0 convert
  809.     "type is:" pop
  810.     pop
  811.     "." pop
  812. endp
  813. //&>>&7 0 7 0
  814. //&<<&proc TestSgetSput
  815. proc TestSgetSput
  816.     "push5"
  817.     "push4"
  818.     "push3"
  819.     "push2"
  820.     "push1"
  821.  
  822.     " !StrangeValue(for3)! " 3 sput
  823.     1 sget pop
  824.     2 sget pop
  825.     3 sget pop
  826.     4 sget pop
  827.     5 sget pop
  828.     %del del del del del
  829.     pop pop pop pop pop
  830. endp
  831. //&>>&E 0 E 1
  832. //&<<&proc TestIf
  833. proc TestIf
  834.     10 20 eq
  835.     if
  836.         "a = b" pop
  837.     else
  838.         "a != b" pop
  839.     endif
  840.  
  841.     10 20 gt
  842.     if
  843.         "a > b" pop
  844.     else
  845.         "a < b" pop
  846.     endif
  847. endp
  848. //&>>&8 0 8 0
  849. //&<<&proc Test2Z
  850. proc Test2Z
  851.     dup 0 eq
  852.     if
  853.         "==0 " pop
  854.     else
  855.         dup 0 gt
  856.         if
  857.             ">0 " pop
  858.         else
  859.             "<0 " pop
  860.         endif
  861.     endif
  862. endp
  863. //&>>&3 0 3 0
  864. //&<<&proc TestDo
  865. proc TestDo
  866. 'a'
  867. dup 'z' lt
  868. do
  869.     Down TLeft
  870.     dup 6 convert pop % enumerate lines by letters a-z
  871.     1 add
  872.     dup 'z' lt
  873. enddo
  874.  
  875. endp
  876. //&>>&5 0 5 0
  877. //&<<&proc TestIoctl
  878. proc TestIoctl
  879.     "typing mode :" pop  1 ioctl if "Ins" else "Ovr" endif          pop Enter
  880.     "search :" pop  3 ioctl if "sensetive" else "insensetive" endif pop Enter
  881.     "In Search Page :" pop  0a ioctl if "yes" else "no" endif       pop Enter
  882.     "In Temp Page :" pop  0b ioctl if "yes" else "no" endif         pop Enter
  883.     "Number Of lines:" pop 0c  ioctl 1 convert                      pop Enter
  884.     "Number Of col-s:" pop 0d  ioctl 1 convert                      pop Enter
  885.     "Line Number    :" pop 012 ioctl 1 convert                      pop Enter
  886.     "cx=" pop     0e  ioctl  1 convert                              pop Enter
  887.     "sx=" pop     0f  ioctl  1 convert                              pop Enter
  888.     "sy=" pop     011 ioctl  1 convert                              pop Enter
  889. endp
  890. //&>>&2 0 2 0
  891. //&<<&proc nPRight
  892. proc nPRight
  893.     4 push 20 gt
  894.     do
  895.         Right
  896.         4 push 20 gt
  897.     enddo
  898.  
  899.     4 push 20 eq
  900.     do
  901.         Right
  902.         4 push
  903.         4 push 20 eq
  904.     enddo
  905. endp
  906. //&>>&0 0 0 0
  907.  
  908. proc HelloWorld
  909.     nPRight
  910. endp
  911. //&>>&A 0 A 7
  912. #endif
  913. ///// mmm_cfg.err mmm_cfg.err mmm_cfg.err mmm_cfg.err mmm_cfg.err
  914. ///// -a mmm.cfg mmm.cfg mmm.cfg mmm.cfg mmm.cfg
  915. ///// -a ../../mmm_base.cfg ../mmm.cfg ../mmm.cfg ../mmm.cfg ../mmm.cfg
  916. //&>>&C 0 C 8
  917.