[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]
Base Operating System and Extensions Technical Reference, Volume 2

sgetl or sputl Subroutine

Purpose

Accesses long numeric data in a machine-independent fashion.

Library

Object File Access Routine Library (libld.a)

Syntax

long sgetl (Buffer)
char *Buffer;
void sputl (Value, Buffer)
long Value;
char *Buffer;

Description

The sgetl subroutine retrieves four bytes from memory starting at the location pointed to by the Buffer parameter. It then returns the bytes as a long Value with the byte ordering of the host machine.

The sputl subroutine stores the four bytes of the Value parameter into memory starting at the location pointed to by the Buffer parameter. The order of the bytes is the same across all machines.

Using the sputl and sgetl subroutines together provides a machine-independent way of storing long numeric data in an ASCII file. For example, the numeric data stored in the portable archive file format can be accessed with the sputl and sgetl subroutines.

Parameters

Value Specifies a 4-byte value to store into memory.
Buffer Points to a location in memory.

Implementation Specifics

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

Related Information

The ar command, dump command.

The ar file format, a.out file format.

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


[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]