Menu

#269 TCLxlib - TCL Xbox library (by Guybrush & darkie)

open
nobody
5
2003-05-06
2003-05-06
No

TCLxlib - TCL Xbox library

TCLxlib - TCL Xbox library by Guybrush & darkie
XBMP development forum thread:
www.xboxmediaplayer.de/cgi-
bin/ib31/ikonboard.cgi?;act=ST;f=3;t=3433

Note! This source code is NOT ready for CVS integrating
yet, the source code is put available to the public here
so other developers (developers not users) can assist
Guybrush & darkie with the development/coding
progress of this library. Developers please post replies in
the above forum thread or PM Guybrush & darkie on
how to contect them via IRC or e-mail if you like to
assist with the development.
Guybrush, darkie and other developer can also upload
source patches for this code to SourceForge
https://sourceforge.net/tracker/?
group_id=64793&atid=508680

------------------------------
Quote from Guybrush (05-4-2003, 21:19):

here's my latest source with most of the fileio stuff fixed:
http://osdn.dl.sourceforge.net/sourceforge/xbplayer/tcl8.4
.2-xbox-5april.rar

there's still alot of my debugtext tho, too lazy too
remove them :D

here's my setup in xbmp to load test.tcl:
Code Sample
interp=Tcl_CreateInterp(); //create the TCL interpreter
Tcl_Init(interp); //initialize some things like the library
path
result=Tcl_EvalFile(interp, "e:\\devkit\\apps\\xbmp23
\\test.tcl"); //run the script

if (result==TCL_OK) {
OutputDebugString("TCL_OK Result: ");
} else {
OutputDebugString("TCL_ERROR Result: ");
}
OutputDebugString(Tcl_GetStringResult(interp));
OutputDebugString("\n");

That way i can just change test.tcl without recompiling
xbmp everytime i need to test a TCL function.

Anyways, Frodo have you taken a look at the sockets?
I want to start working on it again, and darkie told me he
wants to give it a try too, so give us an update

------------------------------
Quote from darkie (03-5-2003, 23:14):

So far most of tcl is done.
I've uploadded two files.

Tcl - Xbox static library:
http://osdn.dl.sourceforge.net/sourceforge/xbplayer/tcl.rar

Tcl Library
http://osdn.dl.sourceforge.net/sourceforge/xbplayer/librar
y.rar
Tcl Library is the rarred default library directory which
contains useful scripts and packages for tcl like HTTP
and FTP and needs to be extracted to the xbmp home
directory.

To install the Tcl xbox library just extract it to your
XBMP dir and import the tcl project in your XBMP
workspace. Then you need to make sure that you
define 'STATIC_BUILD' in your XBMediaPlayer
workspace.

To use tcl you have to include "tclInt.h" in your sourcefile
example:

#include "..\tcl\generic\tclInt.h"

Tcl_Interp *interp;
interp = Tcl_CreateInterp();
Tcl_Init(interp);
Tcl_EvalFile(interp, "Q:\\ftp.tcl");
OutputDebugString("\n****************************\n");
OutputDebugString(interp->result);
OutputDebugString("\n****************************\n");
Tcl_DeleteInterp(interp);
Tcl_Finalize();

in this example Tcl_EvalFile(interp, "Q:\\ftp.tcl") wil load
the ftp.tcl script and executes it.

here are some scripts to check if it works if you want to:
http://osdn.dl.sourceforge.net/sourceforge/xbplayer/tclscr
ipts.zip

------------------------------
Quote from darkie (04-5-2003, 16:28):

added some things to make it easier.

import the tcl project in your XBMP workspace. and
make sure xbmp depends on tcl. No nead for
STATIC_BUILD anymore

and a code example:

Code Sample

#include "tcl\tcl.h"

Tcl *tcl = new Tcl();
tcl->evalFile("Q:\\ftp.tcl");
delete tcl;

or if you want to run a tcl script in it's own thread.

Code Sample

#include "tcl\tcl.h"

TclThread *tTcl = new TclThread();
tTcl->evalFile("Q:\\tvgids.tcl");
}

------------------------------

Discussion

  • Andreas Setterlind

    Logged In: YES
    user_id=630186

    Do not close this patch (until code is in CVS) as it is here to
    keep a record and will be updated by Guybrush & darkie +
    other developers if they whish to contribute/help out

     
  • Andreas Setterlind

    Logged In: YES
    user_id=630186

    Update from darkie (07-5-2003, 17:23)

    --------Start Quote:---------
    Quote:
    Updated some stuff.

    Tcllib-1.3 is now included in the library
    Some small changes in the source code of tcl and the ftp script.

    Tcl.rar
    Tcl - Library.rar
    Tcl Script examples (ftp, echo server, tvguide)
    ---------End Quote:----------

    I zipped the above files into one file and gave it a version number (I based the version number on the Tcllib 1.3
    version since code is from that version) so it will be easier to keep track of updates.

    "TCLxlib - TCL Xbox library v1.302a (Alpha)"
    http://osdn.dl.sourceforge.net/sourceforge/xbplayer/TCLxlib1_302a.ZIP

    @Guybrush/darkie, when you guys update the code and release future updates can you please keep this
    standard/format + update/change the TCLxlib1_3xxa.txt text file in the zip as needed? (if you
    want us to host these updated file/s just upload them to www.xboxmediaplayer.it/upload then let us know they are
    there and we will mirror them on SourceForge)

     

Log in to post a comment.