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

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