From: CRDGW2::CRDGW2::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX" 21-JUN-1991 15:06:08.41 To: ARISIA::EVERHART CC: Subj: Re: Undocumented SHELL$nnn_mmm() functions From: RELAY-INFO-VAX@CRVAX.SRI.COM@SMTP@CRDGW2 To: Everhart@Arisia@MRGATE Received: by crdgw1.ge.com (5.57/GE 1.100) id AA19573; Fri, 21 Jun 91 14:45:50 EDT Received: From UCBVAX.BERKELEY.EDU by CRVAX.SRI.COM with TCP; Fri, 21 JUN 91 02:55:33 PDT Received: by ucbvax.Berkeley.EDU (5.63/1.42) id AA26700; Fri, 21 Jun 91 02:43:08 -0700 Received: from USENET by ucbvax.Berkeley.EDU with netnews for info-vax@kl.sri.com (info-vax@kl.sri.com) (contact usenet@ucbvax.Berkeley.EDU if you have questions) Date: 21 Jun 91 08:16:59 GMT From: deccrl!news.crl.dec.com!nntpd.lkg.dec.com!tkou02.enet.dec.com!usenet@decwrl.dec.com (Terence Lee @HKO) Organization: Digital Equipment Corporation, Hong Kong Subject: Re: Undocumented SHELL$nnn_mmm() functions Message-Id: <1991Jun21.081659.23206@tkou02.enet.dec.com> References: <9106201606.AA27978@ucbvax.Berkeley.EDU> Sender: info-vax-request@kl.sri.com To: info-vax@kl.sri.com In article <9106201606.AA27978@ucbvax.Berkeley.EDU>, BDOWNING@FORDMULC.BITNET writes: #From: BDOWNING@FORDMULC.BITNET #Subject: Undocumented SHELL$nnn_mmm() functions #Date: 20 Jun 91 14:15:00 GMT #Organization: The Internet # #Original post from Ed Wilts EdWilts@BCSC02.BITNET # #> #> Quite a while back, someone posted documentation and/or sample code #> for the shell$ run-time library routines (SHELL$TO_VMS, #> SHELL$FROM_VMS, SHELL$MATCH_WILD, SHELL$FIX_TIME) but I no longer have #> them. These are available in the Vax C RTL, but are not documented in #> the C manuals, except to say "don't worry about calling these". I #> have some code that might benefit by calling these directly. I would #> appreciate whatever documentation people have on these routines. # #I've been waiting quite a while now to see any responses to this. I've #been trying to modify a file cd.c posted to the net a while back that #makes use of these functions, but I really need more info. I wrote to #Ed Wilts and he said that he never received any replies to his post. #If ANYONE has ANY code and/or local documentation regarding these functions #could you please post it to the list? # # Set Thanks/In_Advance # Brian Downing VAX User Assistant Fordham University # New York, NY bdowning@fordmulc.bitnet # { standard cute .signature -RMS-E-FNF } # 1 SHELL The VAXC Shell$ run time library routines. 2 SHELL$CLI_NAME Reports your current CLI name. General high-level language format: status = shell$cli_name( cli_name_desc ) VAX C format: # include descrip int shell$cli_name(); struct dsc$descriptor *cli_name_desc; SHELL$CLI_NAME places the string "SHELL" in the user-supplied string descriptor, cli_name_desc, if the current CLI is the DEC/Shell. Otherwise, the string "CLI$NAME" is placed in cli_name_desc. 2 SHELL$FIX_TIME Converts VAX/VMS binary system times to UNIX binary times. General high-level language format: unxtim = shell$fix_time( vmstim ) VAX C format: int quadword[2]; int *vmstim = quadword; int shell$fix_time(); SHELL$FIX_TIME converts a VMS binary time (a 64 bit quadword containing a number of 10 nsec. ticks since 00:00 November 17, 1858) into a UNIX-like time longword containing the number of seconds since 00:00 January 1, 1970. This routine is useful in converting binary times returned by VMS system services and RMS services into the format used by some C routines (such as ctime, localtime). 2 SHELL$FROM_VMS Converts VAX/VMS file specifications to Shell file specifications. General high-level language format: num_files_found = shell$from_vms( vms_filespec, action_routine, wild_flag ) VAX C format: char *vms_filespec; int wild_flag; int action_routine(); int shell$from_vms(); SHELL$FROM_VMS converts the given VMS file specification into the equivalent DEC/Shell file specification. Further, it allows you user to specify VMS wildcards and have them translated into a corresponding list of existing files in DEC/Shell file specification syntax. 3 Arguments vms_filespec The address of a null-terminated string containing a name in VMS file specification syntax. action_routine The address of a routine that takes as its only argument a null-terminated string containing the translation of the given DEC/Shell name syntax to valid VMS filename syntax. Further, if this routine returns false (low bit clear), no further file translation takes place. wild_flag Either a 0 or 1 passed by value. If a 0 is specified, then wildcards found in the shell_filespec are not expanded. Otherwise, such wildcards are expanded and each is passed to the action_routine. Only those expanded filenames that correspond to existing VMS files will be included. 3 Returns num_files_found The number of filenames that result from the given VAX/VMS filespec. 2 SHELL$IS_SHELL Determines whether you are running the DEC/Shell as your current CLI. General high-level Language Format: status = shell$is_shell() VAX C format: int shell$is_shell(); status = shell$is_shell() 2 SHELL$MATCH_WILD Matches a file specification to a pattern. General high-level language format: status = shell$match_wild( string, pattern ) VAX C format: char *string; char *pattern; int shell$match_wild(); 2 SHELL$TO_VMS Converts DEC/Shell file specifications to VAX/VMS file specifications. General high-level language format: num_files_found = shell$to_vms( shell_filespec, action_routine, wild_flag ) VAX C format: char *shell_filespec; int wild_flag; int action_routine(); int shell$to_vms(); SHELL$TO_VMS converts the given DEC/Shell file specification into the equivalent VMS file specification. Further, it allows you to specify DEC/Shell wildcard characters and have them translated into a list of the corresponding existing VMS files. 3 Arguments shell_filespec The address of a null-terminated string containing a name in DEC/Shell file specification syntax. action_routine The address of a routine that takes as its only argument a null-terminated string containing the translation of the given DEC/Shell name syntax to valid VMS filename syntax. Further, if this routine returns false (low bit clear), no further file translation takes place. wild_flag Either a 0 or 1 passed by value. If a 0 is specified, then wildcards found in the shell_filespec are not expanded. Otherwise, such wildcards are expanded and each is passed to the action_routine. Only those expanded filenames that correspond to existing VMS files will be included. 3 Returns num_files_found The number of filenames that result from the given DEC/Shell filespec. 2 SHELL$TRANSLATE_VMS Translates VAX/VMS file specifications to DEC/Shell file specifications. General high-level language format: shell_filespec = shell$translate_vms( vms_filespec ) VAX C format: char *vms_filespec; char *shell$translate_vms(); -- ================================================================================ Terence Lee | terence%hkov04.dec@decwrl.dec.com | root%hkvs04.dec@decwrl.dec.com =====================+========================================================== From Middlesex, UWO | Just forget what I've said. I don't know it neither. ================================================================================