Posted to tcl by hypnotoad at Thu May 30 15:35:54 GMT 2019view pretty

/*
** This file is generated by the ../sobyk/make.tcl script
** any changes will be overwritten the next time it is run
*/

/* This file was generated by practcl */
    
#include <tcl.h>
#include <tclOO.h>
#include "sobyk.h"
#include "tclInt.h"
#include "tclFileSystem.h"
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
/* BEGIN generate-cfile-header  */
#define ZIPFS_VOLUME "zipfs:/"
#ifndef MODULE_SCOPE
#   define MODULE_SCOPE extern
#endif

/*
** Provide a dummy Tcl_InitStubs if we are using this as a static
** library.
*/
#ifndef USE_TCL_STUBS
# undef  Tcl_InitStubs
# define Tcl_InitStubs(a,b,c) TCL_VERSION
#endif
#define STATIC_BUILD 1
#undef USE_TCL_STUBS

/* Make sure the stubbed variants of those are never used. */
#undef Tcl_ObjSetVar2
#undef Tcl_NewStringObj
#undef Tk_Init
#undef Tk_MainEx
#undef Tk_SafeInit
extern Tcl_PackageInitProc Thread_Init;
extern Tcl_PackageInitProc Sqlite3_Init;
extern Tcl_PackageInitProc Udp_Init;
extern Tcl_PackageInitProc Tdom_Init;
extern Tcl_PackageInitProc Tls_Init;
extern Tcl_PackageInitProc Odielibc_Init;
extern Tcl_PackageInitProc KitCrypt_Init;
extern Tcl_PackageInitProc Dictargs_Init;
/* END generate-cfile-header  */
/* BEGIN generate-cfile-functions  */
/* Tclkit_MainHook */
int Tclkit_MainHook(int *argc, char ***argv){
/*
 * Tclkit_MainHook --
 * Performs the argument munging for the shell
 */
  
  CONST char *archive;
  Tcl_FindExecutable(*argv[0]);
  archive=Tcl_GetNameOfExecutable();
  TclZipfs_Init(NULL);
  if(!TclZipfs_Mount(NULL, "app", archive, NULL)) { 
      Tcl_Obj *vfsinitscript;
      vfsinitscript=Tcl_NewStringObj("zipfs:/app/main.tcl",-1);
      Tcl_IncrRefCount(vfsinitscript);
      if(Tcl_FSAccess(vfsinitscript,F_OK)==0) {
        /* Startup script should be set before calling Tcl_AppInit */
        Tcl_SetStartupScript(vfsinitscript,NULL);
      }
    
    TclSetPreInitScript(
        "\n" \
        "set ::odie(boot_vfs) zipfs:/app\n" \
        "set ::SRCDIR $::odie(boot_vfs)\n" \
        "namespace eval ::starkit {}\n" \
        "set ::starkit::topdir zipfs:/app\n" \
        "if {[file exists [file join zipfs:/app tcl_library init.tcl]]} {\n" \
        "  set ::tcl_library [file join zipfs:/app tcl_library]\n" \
        "  set ::auto_path {}\n" \
        "}\n" \
        "if {[file exists [file join zipfs:/app tk_library tk.tcl]]} {\n" \
        "  set ::tk_library [file join zipfs:/app tk_library]\n" \
        "}\n" \
        "\n" );
  } else {
    TclSetPreInitScript(
        "\n" \
        "foreach path {../tcl} {\n" \
        "  set p  [file join $path library init.tcl]\n" \
        "  if {[file exists [file join $path library init.tcl]]} {\n" \
        "    set ::tcl_library [file normalize [file join $path library]]\n" \
        "    break\n" \
        "  }\n" \
        "}\n" \
        "foreach path {\n" \
        "  ../tk\n" \
        "} {\n" \
        "  if {[file exists [file join $path library tk.tcl]]} {\n" \
        "    set ::tk_library [file normalize [file join $path library]]\n" \
        "    break\n" \
        "  }\n" \
        "}\n" \
        "\n" );
  }
  return TCL_OK;}
/* Tclkit_AppInit */
int Tclkit_AppInit(Tcl_Interp *interp){
  if ((Tcl_Init)(interp) == TCL_ERROR) {
      return TCL_ERROR;
  }

  TclZipfs_Init(interp);
  Tcl_StaticPackage(NULL,"Thread",Thread_Init,NULL);
  if(Sqlite3_Init(interp)) return TCL_ERROR;
  Tcl_StaticPackage(interp,"sqlite3",Sqlite3_Init,NULL);
  Tcl_StaticPackage(NULL,"udp",Udp_Init,NULL);
  Tcl_StaticPackage(NULL,"tdom",Tdom_Init,NULL);
  Tcl_StaticPackage(NULL,"tls",Tls_Init,NULL);
  if(Odielibc_Init(interp)) return TCL_ERROR;
  Tcl_StaticPackage(interp,"odielib",Odielibc_Init,NULL);
  if(KitCrypt_Init(interp)) return TCL_ERROR;
  Tcl_StaticPackage(interp,"kitcrypt",KitCrypt_Init,NULL);
  if(Dictargs_Init(interp)) return TCL_ERROR;
  Tcl_StaticPackage(interp,"dictargs",Dictargs_Init,NULL);
  Tcl_Eval(interp,
        "namespace eval ::starkit {}\n" \
        "set ::starkit::topdir zipfs:/app\n" \
        "set ::starkit::static_packages(Thread) {package ifneeded Thread 2.9a1 {::load {} Thread}}\n" \
        "package ifneeded Thread 2.9a1 {::load {} Thread}\n" \
        "set ::starkit::static_packages(sqlite3) {package ifneeded sqlite3 3.20.1 {::load {} sqlite3}}\n" \
        "set ::starkit::static_packages(udp) {package ifneeded udp 1.0.10 {::load {} udp}}\n" \
        "package ifneeded udp 1.0.10 {::load {} udp}\n" \
        "set ::starkit::static_packages(tdom) {package ifneeded tdom 0.9.2 {::load {} tdom}}\n" \
        "package ifneeded tdom 0.9.2 {::load {} tdom}\n" \
        "set ::starkit::static_packages(tls) {package ifneeded tls 1.8.0 {::load {} tls}}\n" \
        "package ifneeded tls 1.8.0 {::load {} tls}\n" \
        "set ::starkit::static_packages(odielib) {package ifneeded odielib 2.3 {::load {} odielib}}\n" \
        "set ::starkit::static_packages(kitcrypt) {package ifneeded kitcrypt 1.0 {::load {} kitcrypt}}\n" \
        "set ::starkit::static_packages(dictargs) {package ifneeded dictargs 0.1 {::load {} dictargs}}\n" \
        "\n" \
        "if {[file exists [file join $::starkit::topdir pkgIndex.tcl]]} {\n" \
        "  #In a wrapped exe, we don't go out to the environment\n" \
        "  set dir $::starkit::topdir\n" \
        "  source [file join $::starkit::topdir pkgIndex.tcl]\n" \
        "}\n" \
        "set ::starkit::thread_init {namespace eval ::starkit {}\n" \
        "set ::starkit::topdir zipfs:/app\n" \
        "set ::starkit::static_packages(Thread) {package ifneeded Thread 2.9a1 {::load {} Thread}}\n" \
        "package ifneeded Thread 2.9a1 {::load {} Thread}\n" \
        "set ::starkit::static_packages(sqlite3) {package ifneeded sqlite3 3.20.1 {::load {} sqlite3}}\n" \
        "set ::starkit::static_packages(udp) {package ifneeded udp 1.0.10 {::load {} udp}}\n" \
        "package ifneeded udp 1.0.10 {::load {} udp}\n" \
        "set ::starkit::static_packages(tdom) {package ifneeded tdom 0.9.2 {::load {} tdom}}\n" \
        "package ifneeded tdom 0.9.2 {::load {} tdom}\n" \
        "set ::starkit::static_packages(tls) {package ifneeded tls 1.8.0 {::load {} tls}}\n" \
        "package ifneeded tls 1.8.0 {::load {} tls}\n" \
        "set ::starkit::static_packages(odielib) {package ifneeded odielib 2.3 {::load {} odielib}}\n" \
        "set ::starkit::static_packages(kitcrypt) {package ifneeded kitcrypt 1.0 {::load {} kitcrypt}}\n" \
        "set ::starkit::static_packages(dictargs) {package ifneeded dictargs 0.1 {::load {} dictargs}}\n" \
        "\n" \
        "if {[file exists [file join $::starkit::topdir pkgIndex.tcl]]} {\n" \
        "  #In a wrapped exe, we don't go out to the environment\n" \
        "  set dir $::starkit::topdir\n" \
        "  source [file join $::starkit::topdir pkgIndex.tcl]\n" \
        "}}\n" );
  return TCL_OK;}
/* END generate-cfile-functions  */

extern int DLLEXPORT Sobyk_Init( Tcl_Interp *interp ) {
  /* Initialise the stubs tables. */
  #ifdef USE_TCL_STUBS
    if (Tcl_InitStubs(interp, "8.6", 0)==NULL) return TCL_ERROR;
    if (TclOOInitializeStubs(interp, "1.0") == NULL) return TCL_ERROR;
  #endif
  if(interp) {
if(Tcl_Eval(interp,
        "\n" \
        "# BEGIN /Users/seandeelywoods/build/plaidhatter/sobyk/generic/tip479.tcl\n" \
        "namespace eval ::dictargs {}\n" \
        "\n" \
        "###\n" \
        "# Named Procedures as new command\n" \
        "###\n" \
        "proc ::dictargs::proc {name argspec body} {\n" \
        "  set result {}\n" \
        "  append result \"::dictargs::parse \\{$argspec\\} \\$args\" \\;\n" \
        "  append result $body\n" \
        "  uplevel 1 [list ::proc $name [list [list args [list dictargs $argspec]]] $result]\n" \
        "}\n" \
        "\n" \
        "proc ::dictargs::method {name argspec body} {\n" \
        "  set class [lindex [::info level -1] 1]\n" \
        "  set result {}\n" \
        "  append result \"::dictargs::parse \\{$argspec\\} \\$args\" \\;\n" \
        "  append result $body\n" \
        "  oo::define $class method $name args $result\n" \
        "}\n" \
        "# END /Users/seandeelywoods/build/plaidhatter/sobyk/generic/tip479.tcl\n" \
        "\n" )) return TCL_ERROR;
  }
  if(KitCrypt_Init(interp)) return TCL_ERROR;
  if(Dictargs_Init(interp)) return TCL_ERROR;
  return TCL_OK;
}