From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,6e786046dbb1c958 X-Google-Attributes: gid1164f8,public From: hoffman@xdelta.enet.dec.nospam (Hoff Hoffman) Subject: Re: VMS Programming question Date: 1998/11/06 Message-ID: <7200u7$a41@usenet.pa.dec.com>#1/1 X-Deja-AN: 409197324 Distribution: world References: <363F65C7.4050@nswc.navy.mil> Organization: Compaq Computer Corporation Reply-To: hoffman@xdelta.zko.dec.nospam Newsgroups: comp.sys.dec In article <363F65C7.4050@nswc.navy.mil>, "David W. Fisher" writes: :I'm writing a c program and need to determine what the user typed-in on :the command line. The c routine currently uses argc and argv to pickup :the input to main, but the tricky part is: the c program is being call :as a verb from a ".CLD" file. Consequently, argv[0] is not what the :user typed, but the image set-up in the ".CLD". The question is: how :do I get the information the user typed (i.e., the verb)? There are two mechanisms of retrieving user input when an image is activiated -- via the foreign command mechanism and such calls as lib$get_foreign and its derivatives such as the C argc/argv mechanism, and via the system command definition tables (or via per-process SET COMMAND operations) and the OpenVMS CLI interface callback routines. In this case, you will likely want to avail yourself of the CLI routines, as documented in the utility routines reference manual. One wrinkle: the CLI routines use OpenVMS signals -- which are different from C signals, though they are the underpinnings of how C signals are implemented on OpenVMS -- which means you will likely need to establish a signal handler when working with the CLI calls, an example of establishing a signal hander would be a call to the routine VAXC$ESTABLISH( lib$sig_to_ret ); -- this sets up a routine that turns the signal into a return status value. You'll also have to learn about using string descriptors in C, if you have not already done so. Please see "PROG13. What is a descriptor?" in the OpenVMS Frequently Asked Questions (FAQ) for details on descriptors -- if you are not already familiar with them, of course... -- ps: comp.os.vms is a better spot for most OpenVMS questions. -------------------------- pure personal opinion --------------------------- Hoff (Stephen) Hoffman OpenVMS Engineering hoffman@xdelta.ZZenet.dec.com note to those folks not contributing spam -- there is no ZZ in my address