nitc :: c $ MExplicitCall
A prossible call from C, declared explictly after theimport
keyword
nitc :: c $ MExplicitCall
A prossible call from C, declared explictly after theimport
keyword
Serializable::inspect
to show more useful information
nitc :: modelbuilder
more_collections :: more_collections
Highly specific, but useful, collections-related classes.serialization :: serialization_core
Abstract services to serialize Nit objects to different formatsnitc :: toolcontext
Common command-line tool infrastructure than handle options and error messagescore :: union_find
union–find algorithm using an efficient disjoint-set data structurecflags
and ldflags
to specify
extra_java_files
to compile extra java files
nitc :: light_only
Compiler support for the light FFI only, detects unsupported usage of callbacksnitc
.
nitc :: separate_erasure_compiler
Separate compilation of a Nit program with generic type erasureclone
method of the astbuilder tool
# Support for nesting C code within a Nit program using its FFI
module c
import ffi_base
import light_c
redef class CLanguage
redef fun compile_callback(callback, mmodule, mainmodule, ecc)
do
callback.compile_callback_to_c(mainmodule, ecc)
end
end
redef class NitniCallback
fun compile_callback_to_c(mmodule: MModule, ffi_ccu: CCompilationUnit) do end
end
redef class MExplicitCall
redef fun compile_callback_to_c(mmodule, ffi_ccu)
do
var mproperty = mproperty.as(MMethod)
var full_cname = mproperty.build_cname(recv_mtype, mmodule, null, long_signature)
var friendly_cname = mproperty.build_cname(recv_mtype, mmodule, null, short_signature)
ffi_ccu.body_decl.add("#define {friendly_cname} {full_cname}\n")
end
end
src/ffi/c.nit:17,1--43,3