Changeset 827eb3c in tol


Ignore:
Timestamp:
Jun 22, 2010, 11:13:17 PM (16 years ago)
Author:
Jorge Pérez <josp.jorge@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
7b0030e
Parents:
227444a
Message:

refs #927, trick to ensure tcl code is evaluated before invoking any Curl API

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

Location:
tol/stdlib/general/system/Curl
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tol/stdlib/general/system/Curl/Curl.tol

    r227444a r827eb3c  
    1313Set _.autodoc.authors = [[ "josp@tol-project.org" ]];
    1414
     15Text _tclCode = {
     16  Text dir = GetAbsolutePath(".") + "/";
     17  Text ReadFile( dir + "TolCurl.tcl" )
     18};
     19
    1520#Embed "CurlFunctions.tol"
    1621]];
    17 
    18 Real {
    19   Text dir = GetAbsolutePath(".") + "/";
    20   Set tclStatus = Tcl_EvalEx( [[ "source", dir + "TolCurl.tcl" ]] );
    21   Real If( Not(tclStatus["status"]), {
    22       Error( "Initializing Curl: " + tclStatus["result"] );
    23       Real 0
    24     } )
    25 };
  • tol/stdlib/general/system/Curl/CurlFunctions.tol

    r227444a r827eb3c  
    44//////////////////////////////////////////////////////////////////////////////
    55
     6Real _tclCodeLoaded = 0;
     7
     8Real _InitTclCode( Real void )
     9{
     10  Real If( _tclCodeLoaded, 1, {
     11      Set tclStatus = Tcl_EvalEx( [[ "eval", _tclCode ]] );
     12      Real If( tclStatus["status"], _tclCodeLoaded:=1, {
     13          Error( "Initializing Curl: " + tclStatus["result"] );
     14          Real 0
     15        } )
     16    } )
     17};
     18
    619Real Get( NameBlock args )
    720{
     21  // Esta inicializacion deberia desaparecer
     22  Real _InitTclCode(?);
     23 
    824  Text url = args::url;
    925  Text file = args::file;
Note: See TracChangeset for help on using the changeset viewer.