Ignore:
Timestamp:
Feb 28, 2017, 12:28:39 PM (7 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'e7cc1ebecb61be8b9ca6c18016352af89940b21a')
Children:
ddf313aa15678b49ae4cbd1aa2881b4a49296061
Parents:
5c773a32c223f8f216df09eef7badedc4d0754a6
Message:
dyn_mod: python: setring
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/dyn_modules/python/ring_wrap.cc

    r5c773a rb9502a  
    22#include <boost/python.hpp>
    33#include <kernel/mod2.h>
     4#include <Singular/ipshell.h>
    45#include "ring_wrap.h"
    56#include "poly_wrap.h"
     
    1213  return boost::python::str(out,strlen(out));
    1314}
    14 void ring_set(Ring & r)
     15void ring_set(Ring & R)
    1516{
    16       //FIXME: only a hack, no solution
     17    ring r=R.pimpl.get();
     18    idhdl h=rFindHdl(r,NULL);
     19    if (h==NULL)
     20    {
    1721      char name_buffer[100];
    1822      static int ending=0;
    1923      ending++;
    2024      sprintf(name_buffer, "PYTHON_RING_VAR%d",ending);
    21       idhdl shadow_hdl=enterid(name_buffer,0,RING_CMD,&IDROOT);
    22       r.pimpl.get()->ref++;
    23       shadow_hdl->data.uring=r.pimpl.get();
    24       rChangeCurrRing(r.pimpl.get());
    25       currRingHdl=shadow_hdl;
    26 
     25      h=enterid(omStrDup(name_buffer),0,RING_CMD,&IDROOT);
     26      IDRING(h)=r;
     27      r->ref++;
     28    }
     29    rSetHdl(h);
     30    for(int i=myynest;i>=0;i--) iiLocalRing[i]=r;
    2731}
    2832void export_ring()
Note: See TracChangeset for help on using the changeset viewer.