Returning an Integer from a Foreign Function
     Prolog:  -integer
     C:       long int *x;
              *x = ...
     Pascal:  var x: integer
              x := ...
     FORTRAN: integer x
              x = ...
     

A pointer to a long integer is passed to the function. It is assumed that the function will overwrite this integer with its result. When the foreign function returns, the integer being pointed to is converted to a Prolog integer and unified with the corresponding argument of the Prolog call. The argument can be of any type; if it cannot be unified with the returned integer, the call fails. If the foreign function does not overwrite the integer, the result is undefined.