#ifndef __TCPIP_FNMAP_LOADED #define __TCPIP_FNMAP_LOADED 1 /* ** Copyright 2015, 2024 VMS Software, Inc. and Hewlett Packard ** Enterprise Development L.P. ** ** VMS SOFTWARE, INC. CONFIDENTIAL. This software is confidential ** proprietary software licensed by VMS Software, Inc., and is not ** authorized to be used, duplicated or disclosed to anyone without ** the prior written permission of VMS Software, Inc. ** Copyright 2015, 2024 VMS Software, Inc. ** ** HPE CONFIDENTIAL. This software is confidential proprietary software ** licensed by Hewlett Packard Enterprise Development, LP, and is not ** authorized to be used, duplicated or disclosed to anyone without the ** prior written permission of HPE. ** Copyright 2015, 2024 Hewlett Packard Enterprise Development, LP ** */ /* ** TCP/IP VMS/NFS File name mapping. Object TCPIP$FNMAP is found in ** TCPIP$LIBRARY:TCPIP$LIB.OLB. */ #ifdef __cplusplus extern "C" { #endif #include /* ** Maximum Files-11 ODS2 filename size is: ** ** 39 maximum characters for file name, ** 1 character for file name/type separator, ** 39 maximum characters of file type, ** 1 character for version separator, ** 5 maximum characters for version, ** 85 total maximum. ** ** VSI recommends using the symbolic definition below for ODS2 ** filename buffer allocation, or if null termination is desired ** in the case of an exact fit of 85 returned characters, the caller ** should allocate an additional byte. */ #define TCPIP$FNMAP_ODS2_FULLFILE_MAXLEN 85 /* ** Definition(s) for flag argument */ #define TCPIP$M_FLAG_DIRECTORY 0x1 /* specified file is directory */ #define tcpip$fnmap_vms_to_nfs TCPIP$FNMAP_VMS_TO_NFS #define tcpip$fnmap_nfs_to_vms TCPIP$FNMAP_NFS_TO_VMS /* ** Routine: tcpip$fnmap_vms_to_nfs ** ** This routine is called to convert a VMS file specification into ** a NFS file specification. The conversion process handles: ** - unmapping special sequences into NFS characters, ** - removing ".DIR;1" if a directory, ** - removing a trailing "." if no extension provided. ** ** Inputs: ** - vname: pointer to null terminated VMS file specification. ** - uname: pointer to start of buffer where translated file ** specifcation will be stored. ** - uname_size: specifies size of uname buffer. ** - flags: see flag definition(s) above. ** - separator: if supplied, preferred separator for version; ** optional, defaults to ";". ** ** Outputs: ** - uname: pointer to the NFS file specification. ** ** Return value: ** - Number of characters placed into uname buffer, not ** counting null terminator. If supplied buffer is exact ** fit for number of characters output, no null terminator ** will be included. If a null terminatation needs to ** be assured, caller should allocate an additional byte ** after the supplied buffer and initialize it with 0. ** If characters do not fit in supplied buffer, -1 is ** returned and a null will be placed in the first ** element of uname. */ ssize_t tcpip$fnmap_vms_to_nfs( unsigned char *vname, /* in - VMS file name */ unsigned char *uname, /* out - nfs file name */ size_t uname_size, /* out - nfs file name */ unsigned int flags, /* in - see flag definition(s) above */ unsigned char separator); /* in - preferred separator character */ /* ** Routine: tcpip$fnmap_nfs_to_vms ** ** This routine is called to convert a NFS file specification into ** a VMS file specification. The conversion process handles: ** - mapping non-VMS filename characters to special ** sequences, ** - adding ".DIR;1" if a directory, ** - adding a trailing "." if no extension provided. ** ** Inputs: ** - uname: pointer to null terminated NFS file specification. ** - vname: pointer to where to store VMS file specification ** - vname_size: size of vname buffer ** - flags: see flag definition(s) above. ** ** Outputs: ** - vname: pointer to the VMS file specification ** ** Return value: ** - Number of characters placed into vname buffer, not ** counting null terminator. If supplied buffer is exact ** fit for number of characters output, no null terminator ** will be included. If a null terminatation needs to ** be assured, caller should allocate an additional byte ** after the supplied buffer and initialize it with 0. ** If characters do not fit in supplied buffer, -1 is ** returned and a null will be placed in the first ** element of vname. */ ssize_t tcpip$fnmap_nfs_to_vms( unsigned char *uname, /* in - nfs file name */ unsigned char *vname, /* out - VMS file name */ size_t vname_size, /* out - space in uname */ unsigned int flags); /* in - see flag definition(s) above */ #ifdef __cplusplus } #endif #endif