aftp_load_ini_file

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
);

Parameters

filename
The file name of the AFTP initialization file.
filename_size
The length of the filename parameter in bytes.
program_path
For Win32, the fully qualified file specification of the program that is running. The path from the file specification will be used to locate the AFTP initialization file.

For MVS or VM where this information is not available, provide a zero-length string (not a null string) for this parameter.

path_size
The length of the program_path parameter in bytes.
error_string
The buffer into which any error messages will be written during loading of the initialization file.

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.

error_string_size
The size of the buffer into which the error information will be written.
returned_length
The actual size of the error information in bytes.
return_code
The return code issued for this function. See AFTP Return Codes for the list of possible return codes.

Example

{
    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);
    }
}
 

Line Flows

None.