[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, Volume 1


ldclose or ldaclose Subroutine

Purpose

Closes a common object file.

Library

Object File Access Routine Library (libld.a)

Syntax


#include <stdio.h>
#include <ldfcn.h>


int ldclose( ldPointer)
LDFILE *ldPointer;


int ldaclose(ldPointer)
LDFILE *ldPointer;

Description

The ldopen and ldclose subroutines provide uniform access to both simple object files and object files that are members of archive files. Thus, an archive of common object files can be processed as if it were a series of simple common object files.

If the ldfcn.h file TYPE(ldPointer) macro is the magic number of an archive file, and if there are any more files in the archive, the ldclose subroutine reinitializes the ldfcn.h file OFFSET(ldPointer) macro to the file address of the next archive member and returns a failure value. The ldfile structure is prepared for a subsequent ldopen.

If the TYPE(ldPointer) macro does not represent an archive file, the ldclose subroutine closes the file and frees the memory allocated to the ldfile structure associated with ldPointer.

The ldaclose subroutine closes the file and frees the memory allocated to the ldfile structure associated with the ldPointer parameter regardless of the value of the TYPE(ldPointer) macro.

Parameters


ldPointer Pointer to the LDFILE structure that was returned as the result of a successful call to ldopen or ldaopen.

Return Values

The ldclose subroutine returns a SUCCESS or FAILURE value.

The ldaclose subroutine always returns a SUCCESS value and is often used in conjunction with the ldaopen subroutine.

Error Codes

The ldclose subroutine returns a failure value if there are more files to archive.

Implementation Specifics

These subroutines are part of Base Operating System (BOS) Runtime.

Related Information

The ldaopen or ldopen (ldopen or ldaopen Subroutine) subroutine.

Subroutines Overview in AIX 5L Version 5.1 General Programming Concepts: Writing and Debugging Programs.


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]