29.06.2013 Views

Qshell Interpreter (qsh) - FTP Directory Listing - IBM

Qshell Interpreter (qsh) - FTP Directory Listing - IBM

Qshell Interpreter (qsh) - FTP Directory Listing - IBM

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

128 <strong>Qshell</strong> <strong>Interpreter</strong> (<strong>qsh</strong>)<br />

int c; /* Option letter */<br />

int nflag=0; /* True when -n option is specified */<br />

int port=QSH_PORT; /* Port to connect to on server */<br />

int sd; /* Socket to server */<br />

fd_set read_set; /* For select() */<br />

int rc; /* Return code */<br />

struct sockaddr_in svr_addr; /* AF_INET socket address */<br />

long ip_addr; /* IP address of server system */<br />

struct in_addr host_addr; /* Host address for gethostbyaddr() */<br />

char *hostname; /* Short host name of server system */<br />

size_t len; /* Length of input string */<br />

char *ascii_user; /* Username in ASCII */<br />

char *ebcdic_user; /* Username in EBCDIC */<br />

char *ascii_pwd; /* Password in ASCII */<br />

char *ebcdic_pwd; /* Password in EBCDIC */<br />

struct hostent *host_p; /* Pointer to hostent structure returned by<br />

gethostbyname() */<br />

char *ascii_buf; /* Buffer for ASCII text */<br />

char *ebcdic_buf; /* Buffer for EBCDIC text */<br />

int buf_size; /* Amount of data read from server */<br />

/********************************************************************/<br />

/* Initialization. */<br />

/********************************************************************/<br />

#ifdef USE_ICONV<br />

/* Open the conversion descriptors for converting between ASCII and<br />

EBCDIC. We'll assume the server job on the AS/400 is running in<br />

CCSID 37. This must be changed if the server job is running in a<br />

different CCSID. The input parameters to iconv_open() may need to<br />

be changed depending on the operating system. This ioonv_open() is<br />

coded for AIX. */<br />

if ((acd = iconv_open(“<strong>IBM</strong>-850”, “<strong>IBM</strong>-037”))

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!