  | 
≫  | 
 | 
  
 | 
    
      | 
    
    
    
     
HP OpenVMS HP C ランタイム・ライブラリ・リファレンス・マニュアル (下巻)
  
 
  
 OpenVMS ファイル指定を UNIX 形式のファイル指定に変換します。
 
 
形式
#include <unixlib.h>
char *decc$translate_vms (const char *vms_filespec);
 
  
 
引数
 
 vms_filespecOpenVMS ファイル指定形式で名前を格納したヌル区切り文字列のアドレス。
 
 
説明
decc$translate_vms関数は,ファイルが存在するかどうかにかかわらず,指定された OpenVMS ファイル指定を対応する UNIX 形式のファイル指定に変換します。変換された名前文字列はスレッド固有のメモリに格納され,同じスレッドから
decc$translate_vmsを呼び出すたびに,このメモリの内容は上書きされます。
decc$from_vms関数は既存のファイルだけを変換しますが,この関数はファイルが存在するかどうかにかかわらず変換します。
  
 
戻り値
 
| x
 | 
UNIX のファイル指定形式で名前を格納したヌル区切り文字列のアドレス。
 | 
 
| 0
 | 
ファイル名がヌルであるか,または構文が不正であることを示します。
 | 
 
| -1   
 | 
ファイル指定に反復記号 (たとえば [...]a.dat) が含まれているものの,その他の部分は正しいことを示します。OpenVMS の反復記号構文を正しい UNIX 形式のファイル指定に変換することはできません。
 | 
 
 
  
 
例
 
 
/* Demonstrate translation of a "UNIX" name to OpenVMS  */ 
/* form, define a foreign command, and pass the name as */ 
/* the argument.                                        */ 
            
#include <unixlib.h> 
#include <stdio.h> 
 
int main(int argc, char *argv[]) 
{ 
    char *ptr;                      /* translation result */ 
 
    ptr = decc$translate_vms( argv[1] ); 
 
    if ((int) ptr == 0 || (int) ptr == -1) 
 
        printf( "could not translate %s\n", argv[1]); 
    else 
        printf( "%s is translated to %s\n", argv[1], ptr ); 
} 
 |  
 
  
 
 
      |