Changeset 188de86 in git for Singular/slInit_Dynamic.cc


Ignore:
Timestamp:
Aug 2, 2012, 4:09:13 PM (11 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'c987db42cd2ec943b97ac5746c99892ceddf909c')
Children:
4f9652847609cefd5ff3b91d14f34611592ab699
Parents:
0419aba8292e7109329604d8ad03b70f8ef6542344a1c2199e33375a631289eaab7a81954c8383e2
Message:
Merge pull request #158 from alexanderdreyer/spielwiese

Transfering newstruct and pyobject fixes to Spielwiese
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/slInit_Dynamic.cc

    r44a1c2 r188de86  
    99 *******************************************************************/
    1010
    11 /***************************************************************
    12  *
    13  * MP link Extension inits
    14  *
    15  ***************************************************************/
    1611#include "config.h"
    1712#include <kernel/mod2.h>
     
    2116
    2217#ifdef HAVE_DL
    23 #ifdef HAVE_MPSR
    24 #include <MP.h>
    25 #include "mpsr_sl.h"
    26 
    27 static void* mpsr_so_handle = NULL;
    28 typedef void (*voidProc)();
    29 
    30 static void* slInitMPSRHandle()
    31 {
    32   if (mpsr_so_handle == NULL)
    33   {
    34     mpsr_so_handle = dynl_open_binary_warn("mpsr");
    35     if (mpsr_so_handle != NULL)
    36     {
    37       voidProc init_proc = (voidProc)
    38         dynl_sym_warn(mpsr_so_handle, "mpsr_Init");
    39       if (init_proc != NULL)
    40         (*init_proc)();
    41       else
    42         mpsr_so_handle = NULL;
    43     }
    44   }
    45   return mpsr_so_handle;
    46 }
    47 
    48 si_link_extension slInitMPFileExtension(si_link_extension s)
    49 {
    50   void* handle = slInitMPSRHandle();
    51 
    52   if (handle == NULL) return NULL;
    53 
    54   s->Open = (slOpenProc) dynl_sym_warn(handle, "slOpenMPFile");
    55   s->Close = (slCloseProc) dynl_sym_warn(handle, "slCloseMP");
    56   s->Kill = (slKillProc) s->Close;
    57   s->Read = (slReadProc) dynl_sym_warn(handle, "slReadMP");
    58   s->Dump = (slDumpProc) dynl_sym_warn(handle, "slDumpMP");
    59   s->GetDump = (slGetDumpProc) dynl_sym_warn(handle, "slGetDumpMP");
    60   s->Write = (slWriteProc) dynl_sym_warn(handle, "slWriteMP");
    61   s->Status = (slStatusProc) dynl_sym_warn(handle, "slStatusMP");
    62   if (s->Open == NULL || s->Close == NULL || s->Kill == NULL ||
    63       s->Read == NULL || s->Dump == NULL || s->GetDump == NULL ||
    64       s->Write == NULL || s->Status == NULL)
    65     return NULL;
    66 
    67   s->type="MPfile";
    68   return s;
    69 }
    70 
    71 si_link_extension slInitMPTcpExtension(si_link_extension s)
    72 {
    73   void* handle = slInitMPSRHandle();
    74 
    75   if (handle == NULL) return NULL;
    76 
    77   s->Open = (slOpenProc) dynl_sym_warn(handle, "slOpenMPTcp");
    78   s->Close = (slCloseProc) dynl_sym_warn(handle, "slCloseMP");
    79   s->Kill = (slKillProc) dynl_sym_warn(handle, "slKillMP");
    80   s->Read = (slReadProc) dynl_sym_warn(handle, "slReadMP");
    81   s->Dump = (slDumpProc) dynl_sym_warn(handle, "slDumpMP");
    82   s->GetDump = (slGetDumpProc) dynl_sym_warn(handle, "slGetDumpMP");
    83   s->Write = (slWriteProc) dynl_sym_warn(handle, "slWriteMP");
    84   s->Status = (slStatusProc) dynl_sym_warn(handle, "slStatusMP");
    85 
    86   if (s->Open == NULL || s->Close == NULL || s->Kill == NULL ||
    87       s->Read == NULL || s->Dump == NULL || s->GetDump == NULL ||
    88       s->Write == NULL || s->Status == NULL)
    89     return NULL;
    90 
    91   s->type="MPtcp";
    92   return s;
    93 }
    94 
    95 BatchDoProc slInitMPBatchDo()
    96 {
    97   void* handle = slInitMPSRHandle();
    98 
    99   if (handle == NULL) return NULL;
    100   return (BatchDoProc) dynl_sym_warn(handle, "Batch_do");
    101 }
    102 #endif
    10318
    10419#ifdef HAVE_DBM
Note: See TracChangeset for help on using the changeset viewer.