summaryrefslogtreecommitdiff
path: root/src/os_vms_mms.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2004-06-13 20:20:40 +0000
committerBram Moolenaar <Bram@vim.org>2004-06-13 20:20:40 +0000
commit071d4279d6ab81b7187b48f3a0fc61e587b6db6c (patch)
tree221cbe3c40e043163c06f61c52a7ba2eb41e12ce /src/os_vms_mms.c
parentb4210b3bc14e2918f153a7307530fbe6eba659e1 (diff)
downloadvim-git-071d4279d6ab81b7187b48f3a0fc61e587b6db6c.tar.gz
updated for version 7.0001v7.0001
Diffstat (limited to 'src/os_vms_mms.c')
-rw-r--r--src/os_vms_mms.c76
1 files changed, 76 insertions, 0 deletions
diff --git a/src/os_vms_mms.c b/src/os_vms_mms.c
new file mode 100644
index 000000000..d653860be
--- /dev/null
+++ b/src/os_vms_mms.c
@@ -0,0 +1,76 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unixio.h>
+#include "vim.h"
+int main(int argc, char *argv[])
+{
+ FILE *fpi, *fpo;
+ char cmd[132], buf[BUFSIZ], *argp, *error_file, target[132], *mms;
+ int err = 0, err_line = 0;
+
+ mms = "mms";
+ argc--;
+ argv++;
+ while (argc-- > 0)
+ {
+ argp = *argv++;
+ if (*argp == '-')
+ {
+ switch (*++argp)
+ {
+ case 'm':
+ mms = ++argp;
+ break;
+ case 'e':
+ if (!*(error_file = ++argp))
+ {
+ error_file = *argv++;
+ argc--;
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ else
+ {
+ if (*target)
+ strcat(target, " ");
+ strcat(target, argp);
+ }
+ }
+ sprintf(cmd, "%s/output=tmp:errors.vim_tmp %s", mms, target);
+ system(cmd);
+ fpi = fopen("tmp:errors.vim_tmp", "r");
+ fpo = fopen(error_file, "w");
+ while (fgets(buf, BUFSIZ, fpi))
+ {
+ if (!memcmp(buf, "%CC-", 4))
+ {
+ err_line++;
+ buf[strlen(buf)-1] = '\0';
+ err++;
+ }
+ else
+ {
+ if (err_line)
+ {
+ if (strstr(buf, _("At line")))
+ {
+ err_line = 0;
+ fprintf(fpo, "@");
+ }
+ else
+ buf[strlen(buf)-1] = '\0';
+ }
+ }
+ fprintf(fpo, "%s", buf);
+ }
+ fclose(fpi);
+ fclose(fpo);
+ while (!delete("tmp:errors.vim_tmp"))
+ /*nop*/;
+ exit(err ? 44 : 1);
+ return(0);
+}