A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://reference.wolfram.com/language/ref/ForeignFunctionLoad.html below:

ForeignFunctionLoad—Wolfram Documentation

WOLFRAM Consulting & Solutions

We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

WolframConsulting.com

ForeignFunctionLoad[lib,fun,{argtype1,argtype2,}rettype]

loads the function fun with the specified argument and output types from the library lib.

ForeignFunctionLoad[ptr,{argtype1,argtype2,}rettype]

creates a foreign function from the function pointer ptr.

Details Examplesopen all close all Basic Examples  (1)

Load a function from a library:

Call the function:

Applications  (2)

Create a foreign function for the RAND_bytes function from OpenSSL:

Create a buffer into which the random bytes can be written:

Generate the random bytes by calling RAND_bytes:

Read the output:

Package into a function:

The foreign function is very efficient:

Implement SHA256 using OpenSSL:

Create a buffer containing the plaintext to hash:

Create a buffer into which to write the hash:

Execute the hash:

Read the results from the ciphertext buffer:

Compare with the built-in function Hash:

Package into a function:

The packaged function is very efficient:

Properties & Relations  (1)

ForeignFunctionLoad can generally create callable links to libraries faster than custom links can be compiled:

However, the custom compiled versions can have less overhead:

Wolfram Research (2023), ForeignFunctionLoad, Wolfram Language function, https://reference.wolfram.com/language/ref/ForeignFunctionLoad.html. Text

Wolfram Research (2023), ForeignFunctionLoad, Wolfram Language function, https://reference.wolfram.com/language/ref/ForeignFunctionLoad.html.

CMS

Wolfram Language. 2023. "ForeignFunctionLoad." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ForeignFunctionLoad.html.

APA

Wolfram Language. (2023). ForeignFunctionLoad. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ForeignFunctionLoad.html

BibTeX

@misc{reference.wolfram_2025_foreignfunctionload, author="Wolfram Research", title="{ForeignFunctionLoad}", year="2023", howpublished="\url{https://reference.wolfram.com/language/ref/ForeignFunctionLoad.html}", note=[Accessed: 17-August-2025]}

BibLaTeX

@online{reference.wolfram_2025_foreignfunctionload, organization={Wolfram Research}, title={ForeignFunctionLoad}, year={2023}, url={https://reference.wolfram.com/language/ref/ForeignFunctionLoad.html}, note=[Accessed: 17-August-2025]}


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4