L

Top  Previous  Next

labs

#include <stdlib.h>

long int labs (

   long int val

);

stand-alone

labs returns the absolute value of val. If val is the most negative long int value, LONG_MIN, the result cannot be represented and the value returned is undefined.

ldexp

#include <math.h>

double ldexp (

   double x,

   int    exp

);

stand-alone

ldexp returns the result of x multiplied by the value of two raised to the power exp. If the result is too large, the function returns HUGE_VAL and errno is set to ERANGE.

ldiv

#include <stdlib.h>

ldiv_t ldiv (

   long int dividend,

   long int divisor

);

stand-alone

This function divides dividend by divisor and returns both the quotient and the remainder in a structure of type div_t. This type is defined in stdlib.h and includes the following fields:

 

long int quot; // contains the quotient

long int rem;  // contains the remainder

 

If the division is inexact, the quotient returned is the integer of lesser magnitude which is nearest to the algebraic quotient. If the result cannot be represented, the behaviour of ldiv is undefined.

link_in

#include <link.h>

void link_in (

   size_t  len,

   void   *b,

   int     link_no);

stand-alone

Dragons003This function is deprecated and will be removed in a future version of Diamond as it can disrupt channel communications. Use the chan.h functions and CONNECT statement instead.

 

link_in reads a message of length len octets (eight-bit bytes) from link link_no into the area of memory pointed to by b. The argument link_no should be an integer specifying one of the processor's links. The function blocks if no data are available on the link.

link_in_word

#include <link.h>

void link_in_word (

   int *w,

   int  link_no

);

stand-alone

Dragons003link_in_word is deprecated and will be removed in a future version of Diamond as it can disrupt channel communications. Use the chan.h functions and CONNECT statement instead.

 

link_in_word reads a word-length message (four eight-bit bytes) from link link_no, and places the value read in the variable pointed to by w.  The argument link_no should be an integer specifying one of the processor's links. The function blocks if no data are available on the link.

link_out

#include <link.h>

void link_out (

   size_t  len,

   void   *b,

   int     link_no);

stand-alone

Dragons003link_out is deprecated and will be removed in a future version of Diamond as it can disrupt channel communications. Use the chan.h functions and CONNECT statement instead.

 

This function sends a message of length len octets (eight-bit bytes) from the area of memory pointed to by b to link link_no. The argument link_no should be an integer specifying one of the processor's

links. The function blocks until the link is able to accept the data.

link_out_word

#include <link.h>

void link_out_word (

   int w,

   int link_no

);

stand-alone

Dragons003link_out_word is deprecated and will be removed in a future version of Diamond as it can disrupt channel communications. Use the chan.h functions and CONNECT statement instead.

 

This function sends a word-length message (four eight-bit bytes) consisting of the value w to link link_no. The argument link_no should be an integer specifying one of the processor's links. The function blocks until the link is able to accept the data.

localeconv

#include <locale.h>

struct lconv *localeconv(void);

stand-alone

localeconv returns a pointer to an object of type struct lconv. The format of this structure is described in section 4.4 of the ANSI standard, and the type is defined in <locale.h> . The fields of this structure contain information about the way in which numeric values, including monetary values, are output by the run-time library with the current locale.

 

As the current version of Diamond supports only locales "C" and "", as laid down by the standard, and as both of these have the same characteristics, the values returned for the various members of the lconv structure are always those laid down in 4.4 of the standard.

log

#include <math.h>

double log (

   double x

);

stand-alone

log returns the natural logarithm of x.

 

If x is negative, log returns HUGE_VAL, and errno is set to the value of EDOM. If x is zero, it returns HUGE_VAL and sets errno to ERANGE.

log10

#include <math.h>

double log10 (

   double x

);

stand-alone

log10 returns the logarithm of x to base 10.

 

If x is negative, log10 returns HUGE_VAL, and errno is set to the value of EDOM. If x is zero, it returns HUGE_VAL and sets errno to ERANGE.

longjmp

#include <setjmp.h>

void longjmp (

   jmp_buf env,

   int     val

);

stand-alone

This function, together with setjmp, is useful for dealing with errors encountered in a low-level subroutine of the program. longjmp restores the stack environment saved in its env argument by an earlier call on setjmp. This has the effect of resuming execution immediately after that setjmp call. setjmp's caller can distinguish between the original return from setjmp and the second return caused by longjmp by examining setjmp's return value. This is always 0 for the initial return, and the value of longjmp's val argument for subsequent returns. If val is set to 0, longjmp changes it to 1 to preserve this condition.

 

The function that originally called setjmp must not itself have returned before the call to longjmp. All accessible data still have their values as of the time longjmp was called.