MCPcopy Create free account
hub / github.com/DreamSourceLab/DSView / srd_decoder_unload

Function srd_decoder_unload

libsigrokdecode4DSL/decoder.c:989–1017  ·  view source on GitHub ↗

* Unload the specified protocol decoder. * * @param dec The struct srd_decoder to be unloaded. * * @return SRD_OK upon success, a (negative) error code otherwise. * * @since 0.1.0 */

Source from the content-addressed store, hash-verified

987 * @since 0.1.0
988 */
989SRD_API int srd_decoder_unload(struct srd_decoder *dec)
990{
991 struct srd_session *sess;
992 GSList *l;
993
994 if (!srd_check_init())
995 return SRD_ERR;
996
997 if (!dec)
998 return SRD_ERR_ARG;
999
1000 /*
1001 * Since any instances of this decoder need to be released as well,
1002 * but they could be anywhere in the stack, just free the entire
1003 * stack. A frontend reloading a decoder thus has to restart all
1004 * instances, and rebuild the stack.
1005 */
1006 for (l = sessions; l; l = l->next) {
1007 sess = l->data;
1008 srd_inst_free_all(sess);
1009 }
1010
1011 /* Remove the PD from the list of loaded decoders. */
1012 pd_list = g_slist_remove(pd_list, dec);
1013
1014 decoder_free(dec);
1015
1016 return SRD_OK;
1017}
1018
1019static void srd_decoder_load_all_zip_path(char *zip_path)
1020{

Callers 1

srd_decoder_unload_cbFunction · 0.85

Calls 3

srd_check_initFunction · 0.85
srd_inst_free_allFunction · 0.85
decoder_freeFunction · 0.85

Tested by

no test coverage detected