static bool _sml_load_fll_file(struct sml_engine *engine, const char *filename) { struct sml_fuzzy_engine *fuzzy_engine = (struct sml_fuzzy_engine *)engine; if (!sml_fuzzy_load_file(fuzzy_engine->fuzzy, filename)) return false; sml_observation_controller_clear(fuzzy_engine->observation_controller); sml_terms_manager_clear(&fuzzy_engine->terms_manager); sol_ptr_vector_clear(&fuzzy_engine->inputs_to_be_removed); sol_vector_clear(&fuzzy_engine->terms_to_be_removed); sol_ptr_vector_clear(&fuzzy_engine->outputs_to_be_removed); return true; }
static void close_files(struct runner *r) { struct sol_file_reader *fr; uint16_t i; SOL_PTR_VECTOR_FOREACH_IDX (&r->file_readers, fr, i) sol_file_reader_close(fr); sol_ptr_vector_clear(&r->file_readers); }
static void shutdown(void) { if (the_runner) runner_del(the_runner); if (str_arena) sol_arena_del(str_arena); sol_ptr_vector_clear(&args.fbp_search_paths); }
static void thingspeak_add_close(struct sol_flow_node *node, void *data) { struct thingspeak_add_data *mdata = data; struct sol_http_client_connection *connection; uint16_t i; free_talkback(&mdata->talkback); SOL_PTR_VECTOR_FOREACH_IDX (&mdata->pending_conns, connection, i) sol_http_client_connection_cancel(connection); sol_ptr_vector_clear(&mdata->pending_conns); }
static void servers_free(void) { if (!servers) return; if (sol_ptr_vector_get_len(servers) != 0) return; sol_ptr_vector_clear(servers); free(servers); servers = NULL; }
SOL_API void sol_arena_del(struct sol_arena *arena) { char *s; uint16_t i; SOL_NULL_CHECK(arena); SOL_PTR_VECTOR_FOREACH_IDX (&arena->str_vector, s, i) free(s); sol_ptr_vector_clear(&arena->str_vector); free(arena); }
static void http_composed_client_close(struct sol_flow_node *node, void *data) { struct sol_http_client_connection *connection; struct http_composed_client_data *cdata = data; uint16_t i; for (i = 0; i < cdata->inputs_len; i++) if (cdata->inputs[i]) sol_flow_packet_del(cdata->inputs[i]); SOL_PTR_VECTOR_FOREACH_IDX (&cdata->pending_conns, connection, i) sol_http_client_connection_cancel(connection); sol_ptr_vector_clear(&cdata->pending_conns); free(cdata->url); free(cdata->inputs); }
static void thingspeak_channel_update_close(struct sol_flow_node *node, void *data) { struct thingspeak_channel_update_data *mdata = data; struct sol_http_client_connection *connection; uint16_t i; for (i = 0; i < ARRAY_SIZE(mdata->fields); i++) free(mdata->fields[i]); free(mdata->status); free(mdata->api_key); free(mdata->endpoint); sol_timeout_del(mdata->timeout); SOL_PTR_VECTOR_FOREACH_IDX (&mdata->pending_conns, connection, i) sol_http_client_connection_cancel(connection); sol_ptr_vector_clear(&mdata->pending_conns); }