l64a_r Subroutine

Purpose

Converts base-64 long integers to strings.

Library

Thread-Safe C Library (libc_r.a)

Syntax

#include <stdlib.h>

int l64a_r (Convert, Buffer, Length)
long  Convert;
char * Buffer;
int  Length;

Description

The l64a_r subroutine converts a given long integer into a base-64 string.

Programs using this subroutine must link to the libpthreads.a library.

For base-64 characters, the following ASCII characters are used:

Character Description
. Represents 0.
/ Represents 1.
0 -9 Represents the numbers 2-11.
A-Z Represents the numbers 12-37.
a-z Represents the numbers 38-63.

The l64a_r subroutine places the converted base-64 string in the buffer pointed to by the Buffer parameter.

Parameters

Item Description
Convert Specifies the long integer that is to be converted into a base-64 ASCII string.
Buffer Specifies a working buffer to hold the converted long integer.
Length Specifies the length of the Buffer parameter.

Return Values

Item Description
0 Indicates that the subroutine was successful.
-1 Indicates that the subroutine was not successful. If the l64a_r subroutine is not successful, the errno global variable is set to indicate the error.

Error Codes

If the l64a_r subroutine is not successful, it returns the following error code:

Item Description
EINVAL The Buffer parameter value is invalid or too small to hold the resulting ASCII string.