* Set the log receiver enable to disable. */
| 385 | * Set the log receiver enable to disable. |
| 386 | */ |
| 387 | XLOG_API int xlog_set_receiver_enable(xlog_context* ctx, int index, int bEnable) |
| 388 | { |
| 389 | if (ctx == NULL){ |
| 390 | return -1; |
| 391 | } |
| 392 | |
| 393 | pthread_mutex_lock(&ctx->_mutext); |
| 394 | |
| 395 | if (index < 0 || index >= ctx->_count){ |
| 396 | strcpy(ctx->_error, "index out of range"); |
| 397 | pthread_mutex_unlock(&ctx->_mutext); |
| 398 | return -1; |
| 399 | } |
| 400 | |
| 401 | ctx->_receivers[index]._enable = bEnable > 0 ? 1 : 0; |
| 402 | |
| 403 | pthread_mutex_unlock(&ctx->_mutext); |
| 404 | |
| 405 | return 0; |
| 406 | } |
| 407 | |
| 408 | /** |
| 409 | * clear all receiver,return 0 if success. |
no outgoing calls
no test coverage detected