Loading...
Searching...
No Matches
pyobject_setup.cc File Reference
`#include "kernel/mod2.h"`
`#include "Singular/blackbox.h"`
`#include "Singular/ipshell.h"`

Go to the source code of this file.

## Functions

static BOOLEAN | pyobject_load ()
void * | pyobject_autoload (blackbox *bbx)
| blackbox support - initialization via autoloading
void | pyobject_default_destroy (blackbox *, void *)
void | pyobject_setup ()
| initialize blackbox support for `pyobject`; functionilty os autoloaded on demand
BOOLEAN | pyobject_ensure ()
| Explicitely load, if not loaded already.

## Detailed Description

Author
  Alexander Dreyer

Date
  2010-12-15

This header file defines the `blackbox` setup operations for the pyobject

Copyright:
  (c) 2010 by The Singular Team, see LICENSE file

Definition in file pyobject_setup.cc.

## Function Documentation

## pyobject_autoload()

void * pyobject_autoload | ( | blackbox * | bbx | ) |

blackbox support - initialization via autoloading

Definition at line 26 of file pyobject_setup.cc.

{
assume(bbx != NULL);
return (pyobject_load() || (bbx->blackbox_Init == pyobject_autoload)?
NULL: bbx->blackbox_Init(bbx));
}
assume
#define assume(x)
Definition mod2.h:389
NULL
#define NULL
Definition omList.c:12
pyobject_load
static BOOLEAN pyobject_load()
Definition pyobject_setup.cc:20
pyobject_autoload
void * pyobject_autoload(blackbox *bbx)
blackbox support - initialization via autoloading
Definition pyobject_setup.cc:26

## pyobject_default_destroy()

void pyobject_default_destroy | ( | blackbox * | ,
|  | void * | )

Definition at line 33 of file pyobject_setup.cc.

{
WerrorS("Python-based functionality not available!");
}
WerrorS
void WerrorS(const char *s)
Definition feFopen.cc:24

## pyobject_ensure()

BOOLEAN pyobject_ensure | ( |  | ) |

Explicitely load, if not loaded already.

force leading of pyobject functionality

Definition at line 48 of file pyobject_setup.cc.

{
int tok = -1;
blackbox* bbx = (blackboxIsCmd("pyobject", tok) == ROOT_DECL?
getBlackboxStuff(tok): (blackbox*)NULL);
if (bbx == NULL) return TRUE;
return (bbx->blackbox_Init == pyobject_autoload? pyobject_load(): FALSE);
}
TRUE
#define TRUE
Definition auxiliary.h:101
FALSE
#define FALSE
Definition auxiliary.h:97
getBlackboxStuff
blackbox * getBlackboxStuff(const int t)
return the structure to the type given by t
Definition blackbox.cc:17
blackboxIsCmd
int blackboxIsCmd(const char *n, int &tok)
used by scanner: returns ROOT_DECL for known types (and the type number in tok)
Definition blackbox.cc:219
ROOT_DECL
@ ROOT_DECL
Definition grammar.cc:320

## pyobject_load()

BOOLEAN pyobject_load | ( |  | ) |

static

Definition at line 20 of file pyobject_setup.cc.

{
return jjLOAD("pyobject.so", TRUE);
}
jjLOAD
BOOLEAN jjLOAD(const char *s, BOOLEAN autoexport)
load lib/module given in v
Definition iparith.cc:5591

## pyobject_setup()

void pyobject_setup | ( |  | ) |

initialize blackbox support for `pyobject`; functionilty os autoloaded on demand

Definition at line 39 of file pyobject_setup.cc.

{
blackbox *bbx = (blackbox*)omAlloc0(sizeof(blackbox));
bbx->blackbox_Init = pyobject_autoload;
bbx->blackbox_destroy = pyobject_default_destroy;
setBlackboxStuff(bbx, "pyobject");
}
setBlackboxStuff
int setBlackboxStuff(blackbox *bb, const char *n)
define a new type
Definition blackbox.cc:143
omAlloc0
#define omAlloc0(size)
Definition omAllocDecl.h:211
pyobject_default_destroy
void pyobject_default_destroy(blackbox *, void *)
Definition pyobject_setup.cc:33