Changeset 716b74a in tol


Ignore:
Timestamp:
Jan 19, 2011, 3:04:39 PM (16 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
ee8167a
Parents:
8916937
Message:

Refs #1056
Refs #1066
Cint_not_linked_message specifies the function called
New system constant Cint_IsLinked if true just if libcint is linked.

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@3070 be4846ae-f051-483a-831f-b64e7d08527f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tol/contrib/cint/tolCint.cpp

    r8916937 r716b74a  
    2424#include <contrib/cint/tolCint.h>
    2525
     26#include <tol/tol_bdir.h>
    2627#include <tol/tol_blanguag.h>
    2728#include <tol/tol_bdatgra.h>
    … …  
    117118
    118119//--------------------------------------------------------------------
    119 void Cint_not_linked_message (void)
    120 //--------------------------------------------------------------------
    121 {
    122   Error("Cannot use CINT due to libcint.dll is not linked.");
     120void Cint_not_linked_message (const char* function)
     121//--------------------------------------------------------------------
     122{
     123  Error(BText("Cannot use CINT function ")+function+
     124  " due to libcint.dll is not linked.");
    123125}
    124126
    … …  
    129131  if(!G__scratch_all_ptr)
    130132  {
    131     Cint_not_linked_message();
     133    Cint_not_linked_message("Cint_scratch_all");
    132134    return;
    133135  }
    … …  
    141143  if(!G__lasterror_filename_ptr)
    142144  {
    143     Cint_not_linked_message();
     145    Cint_not_linked_message("Cint_lasterror_filename");
    144146    return(NULL);
    145147  }
    … …  
    153155  if(!G__lasterror_linenum_ptr)
    154156  {
     157    Cint_not_linked_message("Cint_lasterror_linenum");
    155158    return(0);
    156159  }
    … …  
    164167  if(!G__init_cint_ptr)
    165168  {
    166     Cint_not_linked_message();
     169    Cint_not_linked_message("Cint_init_cint");
    167170    return(-1);
    168171  }
    … …  
    176179  if(!G__set_errmsgcallback_ptr)
    177180  {
    178     Cint_not_linked_message();
     181    Cint_not_linked_message("Cint_set_errmsgcallback");
    179182    return;
    180183  }
    … …  
    188191  if(!G__setautoconsole_ptr)
    189192  {
    190     Cint_not_linked_message();
     193    Cint_not_linked_message("Cint_setautoconsole");
    191194    return;
    192195  }
    … …  
    200203  if(!G__SetCINTSYSDIR_ptr)
    201204  {
    202     Cint_not_linked_message();
     205    Cint_not_linked_message("Cint_SetCINTSYSDIR");
    203206    return;
    204207  }
    … …  
    212215  if(!G__loadfile_ptr)
    213216  {
    214     Cint_not_linked_message();
     217    Cint_not_linked_message("Cint_loadfile");
    215218    return(0);
    216219  }
    … …  
    224227  if(!G__unloadfile_ptr)
    225228  {
    226     Cint_not_linked_message();
     229    Cint_not_linked_message("Cint_unloadfile");
    227230    return(0);
    228231  }
    … …  
    237240  if(!G__exec_tempfile_ptr)
    238241  {
    239     Cint_not_linked_message();
     242    Cint_not_linked_message("Cint_exec_tempfile");
    240243    return(gv);
    241244  }
    … …  
    250253  if(!G__exec_text_ptr)
    251254  {
    252     Cint_not_linked_message();
     255    Cint_not_linked_message("Cint_exec_text");
    253256    return(gv);
    254257  }
    … …  
    262265  if(!G__int_ptr)
    263266  {
    264     Cint_not_linked_message();
     267    Cint_not_linked_message("Cint_int");
    265268    return(0);
    266269  }
    … …  
    274277  if(!G__double_ptr)
    275278  {
    276     Cint_not_linked_message();
     279    Cint_not_linked_message("Cint_double");
    277280    return(BDat::Unknown().Value());
    278281  }
    … …  
    287290  if(!G__calc_ptr)
    288291  {
    289     Cint_not_linked_message();
     292    Cint_not_linked_message("Cint_calc");
    290293    return(gv );
    291294  }
    … …  
    299302  if(!G__deletevariable_ptr)
    300303  {
    301     Cint_not_linked_message();
     304    Cint_not_linked_message("Cint_deletevariable");
    302305    return(0);
    303306  }
    … …  
    351354  {
    352355    Cint_is_initialized() = true;
    353     if(!Cint_dynamic_linkage()) { return(false); }
     356    int linked = Cint_dynamic_linkage();
     357    if(!linked) { return(false); }
    354358    BText order = "cint";
    355359    if(filePath.HasName()) { order += BText(" ")+filePath; }
    … …  
    391395
    392396//--------------------------------------------------------------------
     397int Cint_initialize_tol_variables()
     398//--------------------------------------------------------------------
     399{
     400  int linked = Cint_dynamic_linkage();
     401  BSystemDat* linked_ = new BSystemDat("Cint_IsLinked", linked,
     402          I2("Is true if optional libcint library has been linked succesfully.",
     403             "Es cierto si la librería opcional libcint ha sido enlazada correctamente"));
     404  return(linked);
     405}
     406
     407//--------------------------------------------------------------------
    393408  DeclareContensClass(BDat, BDatTemporary, BDatCint_SetCINTSYSDIR);
    394409  DefExtOpr(1, BDatCint_SetCINTSYSDIR, "Cint.SetCINTSYSDIR", 1, 1, "Text",
    … …  
    402417{
    403418  if(CheckNonDeclarativeAction("Cint.SetCINTSYSDIR")) { return; }
    404   BText& filePath = Text(Arg(1));
    405   Cint_SetCINTSYSDIR(filePath);
    406   contens_ = 1;
     419  BText& dirPath = Text(Arg(1));
     420  bool ok = G__SetCINTSYSDIR_ptr!=NULL;
     421
     422  if(!BDir::CheckIsDir(dirPath))
     423  {
     424    Error(BText("[Cint.SetCINTSYSDIR]")+" Not found path "+dirPath);
     425    ok = false;
     426  }
     427  contens_ = ok;
     428  if(ok)
     429  {
     430    Cint_SetCINTSYSDIR(dirPath);
     431  }
    407432}
    408433
Note: See TracChangeset for help on using the changeset viewer.