[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 Base Operating System and Extensions Technical Reference, 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 <filehdr.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 subroutine.

Subroutines Overview in AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs.


[ Previous | Next | Contents | Glossary | Home | Search ]