Job Management Partner 1/File Transmission Server/FTP Description, Reference and Operator's Guide

[Contents][Index][Back][Next]


How to use the library

You use the JP1/FTP API library when you use the file transmission function of JP1/FTP from a user program.

The JP1/FTP API library enables you to do the following:

Languages

The following languages are supported for user programs:

Setting up an environment

Setting /etc/services

Set the JP1/FTP client's service name as ftsc. For details, see 2.3.3 Setting the port numbers.

Setting /etc/hosts

Set the host name and IP address of the host on which the client's JP1/FTP daemon is running. Specify this host name in the first argument of fts_ftp_open() and the transmission information structure.

Add the following line to /etc/hosts:

 
xxx.xxx.xxx.xxx      yyyyyy
 

Legend:
xxx.xxx.xxx.xxx: IP address
yyyyyy: Host name

Coding

Specifying the transmission information

To register a file transmission request, you set the registered transmission card name and the address of the transmission information structure in the arguments of fts_ftp_syn_request_ex() and fts_ftp_asyn_request_ex().

Note
Make sure that a char-type variable value ends with \0.

Obtaining transmission-end information

You can obtain the termination information for transmission requests registered by fts_ftp_syn_request_ex() and fts_ftp_asyn_request_ex().

typedef struct _FTS_FTP_API_RETDATA_EX {
  /* Data when transmission was successful */
  int trans_status;             /* Transmission end status: 
                                   success (TRANS_SUCCESS) */
                                /* Transmission end status:
                                   failure (TRANS_FAILURE) */
  char cardname[20+1];          /* Card name */
  unsigned long trno;           /* Transmission number */
  unsigned long trcno;          /* Connection number */
 
  /* Data when transmission was successful */
  unsigned long trans_size;       /* Transmitted data size */
 
  /* Data when transmission (compressed) was successful */
  unsigned long trans_size_comp;  /* Transmitted data size 
                                     after compression */
 
  /* Data when transmission failed */
  int ab_kind;                  /* System call error 
                                   (FTS_ERR_SYSTEM) */
                                /* Logical error
                                   (FTS_ERR_LOGIC) */
                                /* Protocol error
                                   (FTS_ERR_PROTOCOL) */
                                /* Forced termination error
                                   (FTS_ERR_FORCE) */
  char ab_place[8];             /* Location of error */
  char ab_func[32];             /* Name of module resulting
                                   in error */
  char ab_system[32];           /* System call name */
  unsigned long ab_errno;       /* Error number */
  char ab_promes[256];          /* Protocol message
                                   (error) */
 
  char full_trans_size[8];      /* Transmitted data size */
  char full_trans_size_comp[8]; /* Transmitted data size
                                     after compression */
 
  char reserve[1672];           /* Reserved area */
} FTS_FTP_API_RETDATA_EX;

Compiling and linking

Notes about using libraries

Notes about using libraries for multi-thread programs

[Contents][Back][Next]


[Trademarks]

All Rights Reserved. Copyright (C) 2010, Hitachi, Ltd.