RosettaCodeData/Task/Call-a-function-in-a-shared-library/SNOBOL4/call-a-function-in-a-shared-library.sno

13 lines
284 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
-INCLUDE 'ffi.sno'
ffi_m = FFI_DLOPEN('/usr/lib/x86_64-linux-gnu/libm.so')
ffi_m_hypot = FFI_DLSYM(ffi_m, 'hypot')
DEFINE_FFI('hypot(double,double)double', ffi_m_hypot)
OUTPUT = hypot(1,2)
OUTPUT = hypot(2,3)
OUTPUT = hypot(3,4)
OUTPUT = hypot(4,5)
END