void rest_timeout(t_rest *const rest, const t_floatarg f) { if (rest->common.locked) { post("rest object is performing request and locked."); } else { ctw_set_timeout((struct _ctw *)rest, (int)f); } }
static void ctw_init(struct _ctw *common) { curl_global_init(CURL_GLOBAL_DEFAULT); common->base_url_len = 0; common->parameters_len = 0; common->complete_url_len = 0; common->auth_token_len = 0; common->http_headers = NULL; common->out_file_len = 0; common->x_canvas = canvas_getcurrent(); ctw_set_timeout(common, 0); ctw_set_sslcheck(common, 1); }
void *rest_new(t_symbol *const sel, const int argc, t_atom *const argv) { t_rest *const rest = (t_rest *)pd_new(rest_class); (void) sel; ctw_init((struct _ctw *)rest); ctw_set_timeout((struct _ctw *)rest, 0); rest_set_init(rest, 0, argv); rest_set_init(rest, argc, argv); outlet_new(&rest->common.x_ob, NULL); rest->common.status_out = outlet_new(&rest->common.x_ob, NULL); rest->common.locked = 0; #ifdef NEEDS_CERT_PATH ctw_set_cert_path((struct _ctw *)rest, rest_class->c_externdir->s_name); #endif purest_json_lib_info("rest"); return (void *)rest; }