by msofer » December 6th, 2011, 2:49 pm
This is the implementation of a Tcl-command 'isActivated':
static int
TAtcl_isActivated(
ClientData clientData, /* unused */
Tcl_Interp *interp, /* Current interpreter */
int objc, /* Number of arguments */
Tcl_Obj *const objv[] /* Argument strings */
)
{
int ok;
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
return TCL_ERROR;
}
TAtcl_GUID(interp); /* just checks that the GUID has been stored in a global */
ok = IsActivated(GUID);
Tcl_SetObjResult(interp, Tcl_NewIntObj(ok == TA_OK));
fprintf(stdout, "Result was %i\n", ok);
return TCL_OK;
}
When I run this with an activated license and no net, I see:
mig@mtp:~/activation$ tclsh
% source initLime.tcl
lime(guid) = xxx
lime(key) = xxx
/home/mig/activation/limeLM_data/TurboActivate.dat
% isActivated
Result was 1 << TA_FAIL
0
% # turn on networking here!
% isActivated
Result was 0 << TA_OK
1
This is the implementation of a Tcl-command 'isActivated':
static int
TAtcl_isActivated(
ClientData clientData, /* unused */
Tcl_Interp *interp, /* Current interpreter */
int objc, /* Number of arguments */
Tcl_Obj *const objv[] /* Argument strings */
)
{
int ok;
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
return TCL_ERROR;
}
TAtcl_GUID(interp); /* just checks that the GUID has been stored in a global */
ok = IsActivated(GUID);
Tcl_SetObjResult(interp, Tcl_NewIntObj(ok == TA_OK));
fprintf(stdout, "Result was %i\n", ok);
return TCL_OK;
}
When I run this with an activated license and no net, I see:
mig@mtp:~/activation$ tclsh
% source initLime.tcl
lime(guid) = xxx
lime(key) = xxx
/home/mig/activation/limeLM_data/TurboActivate.dat
% isActivated
Result was 1 << TA_FAIL
0
% # turn on networking here!
% isActivated
Result was 0 << TA_OK
1