decoder-uninstantiate
- C
- C++
- CSharp
- Java
- JavaScript
- Swift
- Python
- Go
- PHP
status = mte_mke_dec_uninstantiate(decoder);
if (status != mte_status_success)
{
fprintf(stderr, "Failed to uninstantiate decoder (%s): %s\n",
mte_base_status_name(status),
mte_base_status_description(status));
return status;
}
status = decoder.uninstantiate();
if (status != mte_status_success)
{
std::cerr << "Decoder uninstantiate error ("
<< MteBase::getStatusName(status)
<< "): "
<< MteBase::getStatusDescription(status)
<< std::endl;
return status;
}
// Uninstantiate the Decoder
MteStatus decoderStatus = mkeDecoder.Uninstantiate();
if(decoderStatus != MteStatus.mte_status_success)
{
// MTE was not uninstantiated as desired so handle failure appropriately
// Below is only an example
throw new Exception("Failed to uninstantiate Decoder. Status: "
+ mkeDecoder.GetStatusName(decoderStatus)+ " / "
+ mkeDecoder.GetStatusDescription(decoderStatus));
}
// Uninstantiate the Decoder
MteStatus decoderStatus = mkeDecoder.uninstantiate();
if(decoderStatus != MteStatus.mte_status_success)
{
// MTE was not uninstantiated as desired so handle failure appropriately
// Below is only an example
throw new Exception("Failed to uninstantiate Decoder. Status: "
+ MteBase.getStatusName(decoderStatus)+ " / "
+ MteBase.getStatusDescription(decoderStatus));
}
// Uninstantiate the MKE Decoder
const decoderStatus = mkeDecoder.uninstantiate();
if (decoderStatus !== MteStatus.mte_status_success) {
// MTE cannot continue so handle failure appropriately
// Below is an Example
const status = mteBase.getStatusName(decoderStatus);
const message = mteBase.getStatusDescription(decoderStatus);
throw new Error(`Error uninstantiating MKE Decoder.\n${status}: ${message}`);
}
// Free WASM memory
mkeDecoder.destroy();
// Uninstantiate the Decoder
let status: mte_status = decoder.uninstantiate()
if status != mte_status_success {
// MTE was not uninstantiated as desired so handle failure appropriately
print("Decoder Uninstantiate error: \(MteBase.getStatusName(status))." +
"Description: \(MteBase.getStatusDescription(status))"
}
# Uninstantiate the Decoder.
decoder_status = mke_decoder.uninstantiate()
if decoder_status != MteStatus.mte_status_success:
# MTE was not uninstantiated as desired so handle failure appropriately.
# Below is only an example.
raise Exception("Failed to uninstantiate Decoder. Status: {0} / {1}\n".format(MteBase.get_status_name(decoder_status),
MteBase.get_status_description(decoder_status)))
// Uninstantiate the Decoder
decoderStatus := mkeDecoder.Uninstantiate();
if(decoderStatus != mte.Status_mte_status_success){
// Handle Decoder uninstantiate failure appropriately
// Below is only an example
fmt.Fprintf(os.Stderr, "Decoder uninstantiate error (%v): %v\n",
mte.GetStatusName(decoderStatus), mte.GetStatusDescription(decoderStatus))
return int(decoderStatus)
}
<?php
// Uninstantiate the Decoder
$decoderStatus = $mkeDecoder->uninstantiate();
if (constant($decoderStatus) != mte_status_success) {
//----------------------------------------------------
// Handle Decoder uninstantiate failure appropriately
// Below is only an example
echo "Decoder uninstantiate error: "
.$mkeDecoder->getStatusName(constant($decoderStatus)).":"
.$mkeDecoder->getStatusDescription(constant($decoderStatus));
return $mkeDecoder->getStatusCode(constant($decoderStatus));
}
// Clear out $mkeDecoder variable
unset($mkeDecoder);
?>