TclPKCS11

Diff
Login

Diff

Differences From Artifact [0e48a30252]:

To Artifact [05f498a3e1]:


386
387
388
389
390
391
392


393
394
395
396
397
398
399
400
401
402
403
404
405




406


407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
 * Platform Specific Functions 
 */
static void *tclpkcs11_int_load_module(const char *pathname) {
#ifdef TCL_INCLUDES_LOADFILE
	int tcl_rv;
	Tcl_LoadHandle *new_handle;



	tcl_rv = Tcl_LoadFile(NULL, pathname, NULL, 0, NULL, &new_handle);
	if (tcl_rv != TCL_OK) {
		return(NULL);
	}

	return(new_handle);
#else
	/* XXX: TODO: Replace this with Tcl_Load() in 8.6 or otherwise a system-specific loading mechanism */
	return(dlopen(pathname, RTLD_LAZY | RTLD_LOCAL));
#endif
}
static void tclpkcs11_int_unload_module(void *handle) {
#ifdef TCL_INCLUDES_LOADFILE




	Tcl_FSUnloadFile(NULL, handle);


#else
	/* XXX: TODO: Replace this with Tcl_Unload() in 8.6 or otherwise a system-specific unloading mechanism */
	dlclose(handle);
#endif
	return;
}
static void *tclpkcs11_int_lookup_sym(void *handle, const char *sym) {
#ifdef TCL_INCLUDES_LOADFILE
	Tcl_LoadHandle *tcl_handle;
	void *retval;

	tcl_handle = handle;

	retval = Tcl_FindSymbol(NULL, *tcl_handle, sym);o

	return(retval);
#else
	/* XXX: TODO: Replace this with ... ? in 8.6 or otherwise a system-specific symbol lookup mechanism */
	return(dlsym(handle, sym));
#endif
}







>
>
|












>
>
>
>
|
>
>













|







386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
 * Platform Specific Functions 
 */
static void *tclpkcs11_int_load_module(const char *pathname) {
#ifdef 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);
#else
	/* XXX: TODO: Replace this with Tcl_Load() in 8.6 or otherwise a system-specific loading mechanism */
	return(dlopen(pathname, RTLD_LAZY | RTLD_LOCAL));
#endif
}
static void tclpkcs11_int_unload_module(void *handle) {
#ifdef TCL_INCLUDES_LOADFILE
	Tcl_LoadHandle *tcl_handle;

	tcl_handle = handle;

	Tcl_FSUnloadFile(NULL, *tcl_handle);

	ckfree(handle);
#else
	/* XXX: TODO: Replace this with Tcl_Unload() in 8.6 or otherwise a system-specific unloading mechanism */
	dlclose(handle);
#endif
	return;
}
static void *tclpkcs11_int_lookup_sym(void *handle, const char *sym) {
#ifdef TCL_INCLUDES_LOADFILE
	Tcl_LoadHandle *tcl_handle;
	void *retval;

	tcl_handle = handle;

	retval = Tcl_FindSymbol(NULL, *tcl_handle, sym);

	return(retval);
#else
	/* XXX: TODO: Replace this with ... ? in 8.6 or otherwise a system-specific symbol lookup mechanism */
	return(dlsym(handle, sym));
#endif
}