src/goosebump.c
changeset 0 5f04caa7212d
equal deleted inserted replaced
-1:000000000000 0:5f04caa7212d
       
     1 #include <tcl.h>
       
     2 
       
     3 #define USE_TCL_STUBS
       
     4 
       
     5 static int
       
     6 Hello_Cmd(ClientData data, Tcl_Interp* interp, int objc, Tcl_Obj* const objv[])
       
     7 {
       
     8   Tcl_SetObjResult(interp, Tcl_NewStringObj("Hello, World!", -1));
       
     9   return TCL_OK;
       
    10 }
       
    11 
       
    12 int DLLEXPORT
       
    13 Goosebump_Init(Tcl_Interp* interp)
       
    14 {
       
    15   if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL
       
    16       || Tcl_PkgProvide(interp, "Hello", "1.0") == TCL_ERROR) {
       
    17     return TCL_ERROR;
       
    18   }
       
    19   Tcl_CreateObjCommand(interp, "hello", Hello_Cmd, NULL, NULL);
       
    20   return TCL_OK;
       
    21 }
       
    22