| 400 | } |
| 401 | |
| 402 | static mi_response_t *w_log_level(const mi_params_t *params, |
| 403 | struct mi_handler *async_hdl) |
| 404 | { |
| 405 | mi_response_t *resp; |
| 406 | mi_item_t *resp_obj; |
| 407 | mi_item_t *procs_arr, *proc_item; |
| 408 | int i; |
| 409 | |
| 410 | resp = init_mi_result_object(&resp_obj); |
| 411 | if (!resp) |
| 412 | return 0; |
| 413 | |
| 414 | procs_arr = add_mi_array(resp_obj, MI_SSTR("Processes")); |
| 415 | if (!procs_arr) { |
| 416 | free_mi_response(resp); |
| 417 | return 0; |
| 418 | } |
| 419 | |
| 420 | for (i = 0; i < counted_max_processes; i++) { |
| 421 | if (!is_process_running(i)) |
| 422 | continue; |
| 423 | proc_item = add_mi_object(procs_arr, NULL, 0); |
| 424 | if (!proc_item) |
| 425 | goto error; |
| 426 | |
| 427 | if (add_mi_number(proc_item, MI_SSTR("PID"), pt[i].pid) < 0) |
| 428 | goto error; |
| 429 | |
| 430 | if (add_mi_number(proc_item, MI_SSTR("Log level"), pt[i].log_level) < 0) |
| 431 | goto error; |
| 432 | |
| 433 | if (add_mi_string(proc_item, MI_SSTR("Type"), |
| 434 | pt[i].desc, strlen(pt[i].desc)) < 0) |
| 435 | goto error; |
| 436 | } |
| 437 | |
| 438 | return resp; |
| 439 | |
| 440 | error: |
| 441 | free_mi_response(resp); |
| 442 | return 0; |
| 443 | } |
| 444 | |
| 445 | static mi_response_t *w_log_level_1(const mi_params_t *params, |
| 446 | struct mi_handler *async_hdl) |
nothing calls this directly
no test coverage detected