The aftp_load_ini_file call reads the AFTP initialization file into memory. This file includes information required to map file names on the current platform. When the AFTP initialization file is stored in memory, AFTP automatically consults the data it contains before proceeding with any operations. It is not necessary to create an AFTP connection object before issuing this call.
The name of the initialization file varies by operating system:
AFTP_ENTRY aftp_load_ini_file(
IN unsigned char AFTP_PTR filename,
IN AFTP_LENGTH_TYPE filename_size,
IN unsigned char AFTP_PTR program_path,
IN AFTP_LENGTH_TYPE path_size,
OUT unsigned char AFTP_PTR error_string,
IN AFTP_LENGTH_TYPE error_string_size,
OUT AFTP_LENGTH_TYPE AFTP_PTR returned_length,
OUT AFTP_RETURN_CODE_TYPE AFTP_PTR return_code
);
For MVS or VM where this information is not available, provide a zero-length string (not a null string) for this parameter.
Use the AFTP_INI_MESSAGE_SIZE constant to define the length of this buffer. Add 1 to the size if you want to be able to add a null terminator to the text in the buffer.
{
AFTP_RETURN_CODE_TYPE aftp_rc;
static unsigned char AFTP_PTR init_file_name = "DD:APPFTPI";
static unsigned char AFTP_PTR program_name = ""
unsigned char error_string[AFTP_INI_MESSAGE_SIZE+1];
AFTP_LENGTH_TYPE returned_length;
/*
* There are no prerequisite calls for this call.
*/
/*
* Load the AFTP initialization file into memory.
*/
aftp_load_ini_file(
init_file_name,
(AFTP_LENGTH_TYPE)strlen(init_file_name),
program_name,
(AFTP_LENGTH_TYPE)strlen(program_name),
error_string,
(AFTP_LENGTH_TYPE)sizeof(error_string),
&returned_length,
&aftp_rc);
if (aftp_rc != AFTP_RC_OK {
error_string[returned_length]='\0';
printf(stderr, error_string);
}
}
None.