Changeset e87d40 in git


Ignore:
Timestamp:
Dec 11, 2012, 2:50:20 PM (11 years ago)
Author:
Alexander Dreyer <adreyer@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
bd8204a951e445d6081f81d1727da65972ead678
Parents:
7b9d49ecf5884d5163955044b27dd3eca2dc6b04
Message:
Introducing system("pyobject") to ensure pyobject functionality
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • Singular/extra.cc

    r7b9d49 re87d40  
    9494#include "walk.h"
    9595#include <Singular/newstruct.h>
    96 
     96#include <Singular/pyobject_setup.h>
    9797
    9898
     
    29472947       else
    29482948
     2949  /*==== pyobject (or pyobject*, like pyobject.so) force loading python ===*/
     2950       if (strncmp(sys_cmd, "pyobject", 8) == 0)
     2951       {
     2952         res->rtyp = NONE;
     2953         return pyobject_ensure();
     2954       }
     2955       else
    29492956
    29502957  /*==================== DLL =================*/
  • Singular/pyobject_setup.cc

    r7b9d49 re87d40  
    4949void* pyobject_autoload(blackbox* bbx)
    5050{
    51   if (pyobject_load()) return NULL;
    52   return bbx->blackbox_Init(bbx);
     51  assume(bbx != NULL);
     52  return (pyobject_load()? NULL: bbx->blackbox_Init(bbx));
    5353}
    5454
     
    6767}
    6868
     69/// Explicitely load, if not loaded already
     70BOOLEAN pyobject_ensure() {
     71
     72  int tok = -1;
     73  blackbox* bbx = (blackboxIsCmd("pyobject", tok) == ROOT_DECL?
     74                   getBlackboxStuff(tok): (blackbox*)NULL);
     75  if (bbx == NULL) return TRUE;
     76  return (bbx->blackbox_Init == pyobject_autoload?  pyobject_load(): FALSE); 
     77}
     78
     79
     80
  • Singular/pyobject_setup.h

    r7b9d49 re87d40  
    1717#define SINGULAR_PYOBJECT_SETUP_H
    1818
     19/// initialize blackbox support for @c pyobject; functionilty os autoloaded on demand
    1920void pyobject_setup();
    2021
     22/// force leading of pyobject functionality
     23BOOLEAN pyobject_ensure();
     24
    2125#endif
Note: See TracChangeset for help on using the changeset viewer.