Previous | Contents |
command [-db=debug_level] [-q] [-b] [-d mmddyy] filename |
debug level: | one of the values 1, 2, 3. |
-q: | suppress logging (logging is on by default) |
-b: | binary mode. |
-d: | date in numeric form mmddyy. |
filename: | name of file to process. |
command [/DEBUG=level] [/LOG] [/BINARY] [/SINCE=date] filename |
/DEBUG_LEVEL | is one of MINIMUM, DEFAULT, MAXIMUM If no value is specified, assume DEFAULT. |
/LOG | is on by default, and if negated (/NOLOG) corresponds to -q. |
/BINARY | corresponds to -b |
/SINCE | corresponds to -d, but the date argument will be in either VMS or ISO 8601 format |
/HELP | will be an extra qualifier which will invoke a HELP session. |
! CLD Definitions for SAMPLE.C Module VARG_CLD Define Type DEBUG_TYPES Keyword MINIMUM Keyword DEFAULT, default Keyword MAXIMUM Define Verb VARG Parameter P1, Label=FILE Qualifier LOG, Default Qualifier BINARY Qualifier DEBUG, Value (type=DEBUG_TYPES) Qualifier SINCE, Value (type=$datetime) Qualifier HELP |
$ Set Command /object SAMPLE-CLD $ |
Be careful that you choose a name for the .CLD file that will not cause a conflict of names with the .OBJ file. For example, if the main program is called SAMPLE.C, don't call your .CLD file SAMPLE.CLD. If you do, then you will end up with two SAMPLE.OBJ files, one from the C compiler from SAMPLE.C and the other from your .CLD file. |
The order of the various MAP statements in the file is important. The translator looks for the VMS arguments in the order you present them in this file, and replaces them with the equivalent Unix arguments. If some Unix arguments must precede others, then you must provide MAP statements in the order in which the output Unix arguments are to appear. |
! Mapping of VMS qualifiers for SAMPLE.C to the Unix ones supported by the ! program itself. Action Return /Allow_Unix Map HELP /help=SAMPLE /library=SYS$DISK:[]SAMPLE-HLP Map DEBUG "-db=" /vlist=(MINIMUM,DEFAULT,MAXIMUM) /ulist=(1,2,3) /append Map LOG /negative="-q" Map BINARY "-b" Map SINCE "-d" /Date="$N$D$y" Map FILE $ |
$ genvms :== $ddcu:[dirname]GEN-MAPPING $ genvms SAMPLE-MAP |
$ cc SAMPLE-MAP |
Be careful that you choose a name for the .MAP file that will not cause a conflict of names with the .C file. For example, if the main program is called SAMPLE.C, don't call your .MAP file SAMPLE.MAP. If you do, then you will end up with two SAMPLE.OBJ files, one from the GEN-MAPPING program, and the other from the original program source. |
1 Sample This is a sample program. It doesn't do anything useful, only writes out the Unix equivalents of the arguments you entered. 2 Parameters Filename: name of a file to process. 2 Qualifiers /DEBUG /DEBUG /NODEBUG (D) Specifies debug level. Must be one of MINIMUM, DEFAULT or MAXIMUM. If no value is given, DEFAULT is assumed. /LOG /LOG (D) /NOLOG Specifies whether log output is generated. /BINARY /BINARY /NOBINARY (D) Specifies whether binary mode I/O is used. /SINCE /SINCE=VMS Date/Time Specifies an optional date and/or time. Files created before this date are not processed. The date/time is specified in standard VMS format. |
$ Library /help /create SAMPLE-HLP SAMPLE-HLP |
/* Sample C program which simply prints out the arguments that it was given in the argc/argv interface */ #include <stdio.h> #include <stdlib.h> main (int argc, char **argv) { int i; int Parse_VMS_Args (); /* line added */ Parse_VMS_Args (&argc, &argv); /* line added */ printf ("arg count = %d\n", argc); for (i=0; i <= argc-1; i++) printf ("arg [%d] = '%s'\n", i, argv [i]); exit (0); } |
$ CC SAMPLE |
$ Link SAMPLE |
$ Link SAMPLE,SAMPLE-CLD,SAMPLE-MAP,PARSE-VMS |
$ Define VMSARG_DEBUG 1 |
ACTION EXIT /image=SAMPLE.EXE /symbol=SAMPLE_UNIX |
$ cc nullmain $ Set Command /object MYMAP-CLD.CLD $ genvms :== $ddcu:[dirname]GEN-MAPPING $ Genvms mymap-map.map ! creates .C file $ cc mymap-map.c $ Link /notrace /exec=vms-sample nullmain,parse-vms,mymap-map,mymap-cld |
$ sample = "$ddcu:[directory]VMS-SAMPLE" |
Action EXIT /symbol=UNIX_ARGS |
$ cc nullmain $ Set Command /object MYMAP-CLD.CLD $ genvms :== $ddcu:[dirname]GEN-MAPPING $ Genvms mymap-map.map ! creates .C file $ cc mymap-map.c $ Link /notrace /exec=sample-symb nullmain,parse-vms,mymap-map,mymap-cld |
$ sample = "@ddcu:[directory]VMS-SAMPLE" |
$ translate = "$ddcu:[dirname]SAMPLE-SYMB" $ translate /binary /nolog foo.txt $ ! program exits with DCL symbol UNIX_ARGS set to "-b -q foo.txt" $ ... ! additional optional processing $ sample_unix = "$ddcu:[dirname]SAMPLE" ! original unchanged image $ sample_unix 'unix_args' |
Previous | Contents | Contents |