416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
|
return(CKR_OK);
}
/*
* Platform Specific Functions
*/
MODULE_SCOPE void *tclpkcs11_int_load_module(const char *pathname) {
#if defined(TCL_INCLUDES_LOADFILE)
int tcl_rv;
Tcl_Obj *pathnameObj;
Tcl_LoadHandle *new_handle;
new_handle = (Tcl_LoadHandle *) ckalloc(sizeof(*new_handle));
pathnameObj = Tcl_NewStringObj(pathname, -1);
Tcl_IncrRefCount(pathnameObj);
tcl_rv = Tcl_LoadFile(NULL, pathnameObj, NULL, 0, NULL, new_handle);
Tcl_DecrRefCount(pathnameObj);
if (tcl_rv != TCL_OK) {
return(NULL);
}
|
|
|
|
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
|
return(CKR_OK);
}
/*
* Platform Specific Functions
*/
MODULE_SCOPE void *tclpkcs11_int_load_module(const char *pathname, Tcl_Interp *interp) {
#if defined(TCL_INCLUDES_LOADFILE)
int tcl_rv;
Tcl_Obj *pathnameObj;
Tcl_LoadHandle *new_handle;
new_handle = (Tcl_LoadHandle *) ckalloc(sizeof(*new_handle));
pathnameObj = Tcl_NewStringObj(pathname, -1);
Tcl_IncrRefCount(pathnameObj);
tcl_rv = Tcl_LoadFile(interp, pathnameObj, NULL, 0, NULL, new_handle);
Tcl_DecrRefCount(pathnameObj);
if (tcl_rv != TCL_OK) {
return(NULL);
}
|
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
|
pathname = Tcl_GetString(objv[1]);
if (!pathname) {
Tcl_SetObjResult(interp, Tcl_NewStringObj("invalid pathname", -1));
return(TCL_ERROR);
}
handle = tclpkcs11_int_load_module(pathname);
if (!handle) {
Tcl_SetObjResult(interp, Tcl_NewStringObj("unable to load", -1));
return(TCL_ERROR);
}
getFuncList = tclpkcs11_int_lookup_sym(handle, "C_GetFunctionList");
|
|
|
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
|
pathname = Tcl_GetString(objv[1]);
if (!pathname) {
Tcl_SetObjResult(interp, Tcl_NewStringObj("invalid pathname", -1));
return(TCL_ERROR);
}
handle = tclpkcs11_int_load_module(pathname, interp);
if (!handle) {
Tcl_SetObjResult(interp, Tcl_NewStringObj("unable to load", -1));
return(TCL_ERROR);
}
getFuncList = tclpkcs11_int_lookup_sym(handle, "C_GetFunctionList");
|