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

Technical Reference: Base Operating System and Extensions, 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.

Related Information

The ar command, dump command.

The ar file format, a.out file format.

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

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