source: git/Singular/dyn_modules/machinelearning/machinelearning.cc @ 50fb159

fieker-DuValspielwiese
Last change on this file since 50fb159 was 50fb159, checked in by Murray Heymann <heymann.murray@…>, 5 years ago
Add structure for dynamic ml module
  • Property mode set to 100644
File size: 709 bytes
Line 
1#include "kernel/mod2.h" // general settings/macros
2#include "Singular/ipid.h" // for SModulFunctions, leftv
3BOOLEAN hello(leftv result, leftv arg)
4{
5        result->rtyp=NONE; // set the result type
6        PrintS("hello world\n");
7        return FALSE; // return FALSE: no error
8}
9extern "C" int mod_init(SModulFunctions* psModulFunctions)
10{
11        // this is the initialization routine of the module
12        // adding the routine hello:
13        psModulFunctions->iiAddCproc(
14                        (currPack->libname? currPack->libname: ""),
15                        // the library name,
16                        // rely on the loader to set it in currPack->libname
17                        "hello",// the name for the singular interpreter
18                        FALSE, // should enter the global name space
19                        hello); // the C/C++ routine
20        return 1;
21}
Note: See TracBrowser for help on using the repository browser.