419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
|
/*
* Platform Specific Functions
*/
MODULE_SCOPE void *tclpkcs11_int_load_module(const char *pathname) {
#if defined(TCL_INCLUDES_LOADFILE)
int tcl_rv;
Tcl_LoadHandle *new_handle;
new_handle = (Tcl_LoadHandle *) ckalloc(sizeof(*new_handle));
tcl_rv = Tcl_LoadFile(NULL, Tcl_NewStringObj(pathname, -1), NULL, 0, NULL, new_handle);
if (tcl_rv != TCL_OK) {
return(NULL);
}
return(new_handle);
#elif defined(HAVE_DLOPEN)
return(dlopen(pathname, RTLD_NOW | RTLD_GLOBAL));
|
>
|
>
>
>
>
>
>
>
|
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
|
/*
* 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);
}
return(new_handle);
#elif defined(HAVE_DLOPEN)
return(dlopen(pathname, RTLD_NOW | RTLD_GLOBAL));
|