g32_close Function

Purpose

Detaches from a session.

Libraries

HCON Library
C (libg3270.a)
Pascal (libg3270p.a)
FORTRAN (libg3270f.a)

C Syntax

#include <g32_api.h>

g32_close ( as)

struct g32_api *as;

Pascal Syntax

function g32clse (var  as : g32_api) : integer; external;

FORTRAN Syntax

EXTERNAL G32CLOSE

INTEGER  AS(9), G32CLOSE

RC = G32CLOSE(AS)

Description

The g32_close function disconnects from a 3270 session. If the g32_open or g32_openx function created a session, the g32_close function logs off from the host and terminates the session. A session must be terminated (using the g32_dealloc function) before issuing the g32_close function.

HCON application programs using the Pascal language interface must include and link both the C and Pascal libraries. Application programs using the FORTRAN language for the HCON API must include and link both the C and FORTRAN libraries.

The g32_close function is part of the Host Connection Program (HCON).

The g32_close function requires one or more adapters used to connect to a host.

C Parameters

Item Description
as Specifies a pointer to a g32_api structure. Status is returned in this structure.

Pascal Parameters

Item Description
as Specifies a g32_api structure.

FORTRAN Parameters

Item Description
AS Specifies the g32_api equivalent structure as an array of integers.

Return Values

Item Description
0 Indicates successful completion.
-1 Indicates an error has occurred.
  • The errcode field in the g32_api structure is set to an error code identifying the error.
  • The xerrinfo field can be set to give more information about the error.

Examples

The following example fragment illustrates the use of the g32_close function in C language:

#include <g32_api.h>      /* API include file */
main()
{
struct g32_api *as;      /* g32 structure */
int return;
.
.
.
return = g32_close(as);
.
.
.