Lines Matching refs:lc

172 log_close_debug_channels(log_context lc) {  in log_close_debug_channels()  argument
176 for (i = 0; i < lc->num_categories; i++) in log_close_debug_channels()
177 for (lcl = lc->categories[i]; lcl != NULL; lcl = lcl->next) in log_close_debug_channels()
203 log_check_channel(log_context lc, int level, log_channel chan) { in log_check_channel() argument
206 REQUIRE(lc != NULL); in log_check_channel()
208 debugging = ((lc->flags & LOG_OPTION_DEBUG) != 0); in log_check_channel()
225 chan_level = lc->level; in log_check_channel()
236 log_check(log_context lc, int category, int level) { in log_check() argument
240 REQUIRE(lc != NULL); in log_check()
242 debugging = ((lc->flags & LOG_OPTION_DEBUG) != 0); in log_check()
250 if (category < 0 || category > lc->num_categories) in log_check()
252 lcl = lc->categories[category]; in log_check()
255 lcl = lc->categories[0]; in log_check()
259 if (log_check_channel(lc, level, lcl->channel)) in log_check()
266 log_vwrite(log_context lc, int category, int level, const char *format, in log_vwrite() argument
284 REQUIRE(lc != NULL); in log_vwrite()
286 debugging = (lc->flags & LOG_OPTION_DEBUG); in log_vwrite()
294 if (category < 0 || category > lc->num_categories) in log_vwrite()
297 lcl = lc->categories[category]; in log_vwrite()
300 lcl = lc->categories[0]; in log_vwrite()
329 if (lc->category_names != NULL && in log_vwrite()
330 lc->category_names[original_category] != NULL) in log_vwrite()
331 category_name = lc->category_names[original_category]; in log_vwrite()
352 if (!log_check_channel(lc, level, chan)) in log_vwrite()
356 (void)vsprintf(lc->buffer, format, args); in log_vwrite()
357 if (strlen(lc->buffer) > (size_t)LOG_BUFFER_SIZE) { in log_vwrite()
378 lc->buffer); in log_vwrite()
413 lc->buffer); in log_vwrite()
426 log_write(log_context lc, int category, int level, const char *format, ...) { in log_write() argument
430 log_vwrite(lc, category, level, format, args); in log_write()
439 log_new_context(int num_categories, char **category_names, log_context *lc) { in log_new_context() argument
459 *lc = nlc; in log_new_context()
464 log_free_context(log_context lc) { in log_free_context() argument
469 REQUIRE(lc != NULL); in log_free_context()
471 for (i = 0; i < lc->num_categories; i++) in log_free_context()
472 for (lcl = lc->categories[i]; lcl != NULL; lcl = lcl_next) { in log_free_context()
478 memput(lc->categories, in log_free_context()
479 lc->num_categories * sizeof (log_channel_list)); in log_free_context()
480 memput(lc, sizeof (struct log_context)); in log_free_context()
484 log_add_channel(log_context lc, int category, log_channel chan) { in log_add_channel() argument
487 if (lc == NULL || category < 0 || category >= lc->num_categories) { in log_add_channel()
498 lcl->next = lc->categories[category]; in log_add_channel()
499 lc->categories[category] = lcl; in log_add_channel()
505 log_remove_channel(log_context lc, int category, log_channel chan) { in log_remove_channel() argument
509 if (lc == NULL || category < 0 || category >= lc->num_categories) { in log_remove_channel()
514 for (prev_lcl = NULL, lcl = lc->categories[category]; in log_remove_channel()
523 lc->categories[category] = next_lcl; in log_remove_channel()
541 log_option(log_context lc, int option, int value) { in log_option() argument
542 if (lc == NULL) { in log_option()
549 lc->flags |= option; in log_option()
551 lc->flags &= ~option; in log_option()
554 lc->level = value; in log_option()
564 log_category_is_active(log_context lc, int category) { in log_category_is_active() argument
565 if (lc == NULL) { in log_category_is_active()
569 if (category >= 0 && category < lc->num_categories && in log_category_is_active()
570 lc->categories[category] != NULL) in log_category_is_active()