コード例 #1
0
ファイル: tnmInit.c プロジェクト: flightaware/scotty
int
TnmInit(Tcl_Interp *interp, int safe)
{

#ifdef USE_TCL_STUBS
    if (Tcl_InitStubs(interp, "8.4", 0) == NULL) {
	return TCL_ERROR;
    }
#endif
    
    if (Tcl_PkgRequire(interp, "Tcl", TCL_VERSION, 0) == NULL) {
        return TCL_ERROR;
    }

    if (Tcl_PkgProvide(interp, "Tnm", TNM_VERSION) != TCL_OK) {
        return TCL_ERROR;
    }

    Tcl_RegisterObjType(&tnmUnsigned64Type);
    Tcl_RegisterObjType(&tnmUnsigned32Type);
    Tcl_RegisterObjType(&tnmOctetStringType);
    Tcl_RegisterObjType(&tnmIpAddressType);

    InitVars(interp);
    TnmInitDns(interp);
    if (InitCmds(interp, safe) != TCL_OK) {
	return TCL_ERROR;
    }
    if (TnmSmxInit(interp) != TCL_OK) {
	return TCL_ERROR;
    }

    return SourceInitFiles(interp);
}
コード例 #2
0
ファイル: problem.cpp プロジェクト: avokhmin/RPM5
/*************************************************************************
* FUNCTION      :   RPMPRoblem_Obj::MyType::MyType                       *
* ARGUMENTS     :   none                                                 *
* RETURNS       :   none                                                 *
* EXCEPTIONS    :   none                                                 *
* PURPOSE       :   Register type with TCL                               *
*************************************************************************/
RPMPRoblem_Obj::MyType::MyType(void)
{
   name = "RPMProblem";
   freeIntRepProc   = RPMPRoblem_Obj::FreeInternalRep;
   dupIntRepProc    = RPMPRoblem_Obj::DupInternalRep;
   updateStringProc = RPMPRoblem_Obj::UpdateString;
   setFromAnyProc   = RPMPRoblem_Obj::SetFromAny;
   Tcl_RegisterObjType(this);
}
コード例 #3
0
ファイル: json.c プロジェクト: scottg/aolserver
int
Tcljson_Init(Tcl_Interp *interp)
{
    Tcl_RegisterObjType(&tclJsonObjectType);

    Tcl_CreateObjCommand(interp, "json.newObject", TcljsonNewObjectObjCmd, (ClientData) 'o', NULL);
    Tcl_CreateObjCommand(interp, "json.putObject", TcljsonNewObjectObjCmd, (ClientData) 'p', NULL);
    Tcl_CreateObjCommand(interp, "json.newInt", TcljsonNewObjectObjCmd, (ClientData) 'i', NULL);
    Tcl_CreateObjCommand(interp, "json.newString", TcljsonNewObjectObjCmd, (ClientData) 's', NULL);
    Tcl_CreateObjCommand(interp, "json.newDouble", TcljsonNewObjectObjCmd, (ClientData) 'd', NULL);
    Tcl_CreateObjCommand(interp, "json.newBoolean", TcljsonNewObjectObjCmd, (ClientData) 'b', NULL);
    Tcl_CreateObjCommand(interp, "json.newArray", TcljsonNewObjectObjCmd, (ClientData) 'a', NULL);
    Tcl_CreateObjCommand(interp, "json.getObject", TcljsonGetObjectObjCmd, (ClientData) NULL, NULL);
    Tcl_CreateObjCommand(interp, "json.getObjectKeys", TcljsonKeysObjectObjCmd, (ClientData) NULL, NULL);
    Tcl_CreateObjCommand(interp, "json.getArray", TcljsonGetArrayObjCmd, (ClientData) NULL, NULL);
    Tcl_CreateObjCommand(interp, "json.objectAddObject", TcljsonAddObjectObjCmd, (ClientData) 'o', NULL);
    Tcl_CreateObjCommand(interp, "json.arrayAddObject", TcljsonAddObjectObjCmd, (ClientData) 'a', NULL);
    Tcl_CreateObjCommand(interp, "json.objectToString", TcljsonObjectToStringObjCmd, NULL, NULL);
    Tcl_CreateObjCommand(interp, "json.stringToObject", TcljsonStringToObjectObjCmd, NULL, NULL);

    return TCL_OK;
}
コード例 #4
0
ファイル: tkObj.c プロジェクト: Starlink/tk
void
TkRegisterObjTypes(void)
{
    Tcl_RegisterObjType(&tkBorderObjType);
    Tcl_RegisterObjType(&tkBitmapObjType);
    Tcl_RegisterObjType(&tkColorObjType);
    Tcl_RegisterObjType(&tkCursorObjType);
    Tcl_RegisterObjType(&tkFontObjType);
    Tcl_RegisterObjType(&mmObjType);
    Tcl_RegisterObjType(&tkOptionObjType);
    Tcl_RegisterObjType(&pixelObjType);
    Tcl_RegisterObjType(&tkStateKeyObjType);
    Tcl_RegisterObjType(&windowObjType);
    Tcl_RegisterObjType(&tkTextIndexType);
}