ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Akira Kakuto" <kakuto@fuk.kindai.ac.jp>
To: <ntg-context@ntg.nl>
Subject: LuaTeX 1.0.3 announcement
Date: Sun, 19 Feb 2017 08:34:23 +0900	[thread overview]
Message-ID: <F4412E69727D4320A3E1E016212FE6DD@CJ3001517A> (raw)

> Luigi has shown me a simple and useful application of ffi:

In the case of lua(jit)tex in W32TeX, which are used in
context, standard C libraries are linked statically.
Thus it is necessary to load a necessary DLL for standard
C functions, like the following meaningless example:

\starttext
$$
j0(1.765)=
\startluacode
ffi=require("ffi")
ffi.cdef[[
double _j0(double x);
]]
-- In the case of lua(jit)tex in W32TeX, C libraries are linked
-- statically. Thus it is necessary to load a necessary DLL.
local msvcrt=ffi.load("msvcrt")
tex.print(msvcrt._j0(1.765))
\stopluacode
$$
\stoptext

It is expected that Windows APIs in the following libs
can be used without loading DLL:

WSOCK32.dll
USER32.dll
ADVAPI32.dll
SHELL32.dll
GDI32.dll
KERNEL32.dll
WS2_32.dll

Best,
Akira

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

             reply	other threads:[~2017-02-18 23:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-18 23:34 Akira Kakuto [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-02-17 19:57 luigi scarso
2017-02-18  8:11 ` Henri Menke
2017-02-18  8:42   ` luigi scarso
2017-02-18 13:27     ` Henri Menke
2017-02-18 13:52       ` Hans Hagen
2017-02-18 13:59       ` luigi scarso
2017-02-18 16:03         ` Alan Braslau
2017-02-18 14:08       ` Hans Hagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F4412E69727D4320A3E1E016212FE6DD@CJ3001517A \
    --to=kakuto@fuk.kindai.ac.jp \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).