Lines Matching refs:lc
176 log_close_debug_channels(log_context lc) { in log_close_debug_channels() argument
180 for (i = 0; i < lc->num_categories; i++) in log_close_debug_channels()
181 for (lcl = lc->categories[i]; lcl != NULL; lcl = lcl->next) in log_close_debug_channels()
207 log_check_channel(log_context lc, int level, log_channel chan) { in log_check_channel() argument
210 REQUIRE(lc != NULL); in log_check_channel()
212 debugging = ((lc->flags & LOG_OPTION_DEBUG) != 0); in log_check_channel()
229 chan_level = lc->level; in log_check_channel()
240 log_check(log_context lc, int category, int level) { in log_check() argument
244 REQUIRE(lc != NULL); in log_check()
246 debugging = ((lc->flags & LOG_OPTION_DEBUG) != 0); in log_check()
254 if (category < 0 || category > lc->num_categories) in log_check()
256 lcl = lc->categories[category]; in log_check()
259 lcl = lc->categories[0]; in log_check()
263 if (log_check_channel(lc, level, lcl->channel)) in log_check()
270 log_vwrite(log_context lc, int category, int level, const char *format, in log_vwrite() argument
288 REQUIRE(lc != NULL); in log_vwrite()
290 debugging = (lc->flags & LOG_OPTION_DEBUG); in log_vwrite()
298 if (category < 0 || category > lc->num_categories) in log_vwrite()
301 lcl = lc->categories[category]; in log_vwrite()
304 lcl = lc->categories[0]; in log_vwrite()
333 if (lc->category_names != NULL && in log_vwrite()
334 lc->category_names[original_category] != NULL) in log_vwrite()
335 category_name = lc->category_names[original_category]; in log_vwrite()
356 if (!log_check_channel(lc, level, chan)) in log_vwrite()
360 (void)vsprintf(lc->buffer, format, args); in log_vwrite()
361 if (strlen(lc->buffer) > (size_t)LOG_BUFFER_SIZE) { in log_vwrite()
382 lc->buffer); in log_vwrite()
417 lc->buffer); in log_vwrite()
430 log_write(log_context lc, int category, int level, const char *format, ...) { in log_write() argument
434 log_vwrite(lc, category, level, format, args); in log_write()
443 log_new_context(int num_categories, char **category_names, log_context *lc) { in log_new_context() argument
463 *lc = nlc; in log_new_context()
468 log_free_context(log_context lc) { in log_free_context() argument
473 REQUIRE(lc != NULL); in log_free_context()
475 for (i = 0; i < lc->num_categories; i++) in log_free_context()
476 for (lcl = lc->categories[i]; lcl != NULL; lcl = lcl_next) { in log_free_context()
482 memput(lc->categories, in log_free_context()
483 lc->num_categories * sizeof (log_channel_list)); in log_free_context()
484 memput(lc, sizeof (struct log_context)); in log_free_context()
488 log_add_channel(log_context lc, int category, log_channel chan) { in log_add_channel() argument
491 if (lc == NULL || category < 0 || category >= lc->num_categories) { in log_add_channel()
502 lcl->next = lc->categories[category]; in log_add_channel()
503 lc->categories[category] = lcl; in log_add_channel()
509 log_remove_channel(log_context lc, int category, log_channel chan) { in log_remove_channel() argument
513 if (lc == NULL || category < 0 || category >= lc->num_categories) { in log_remove_channel()
518 for (prev_lcl = NULL, lcl = lc->categories[category]; in log_remove_channel()
527 lc->categories[category] = next_lcl; in log_remove_channel()
545 log_option(log_context lc, int option, int value) { in log_option() argument
546 if (lc == NULL) { in log_option()
553 lc->flags |= option; in log_option()
555 lc->flags &= ~option; in log_option()
558 lc->level = value; in log_option()
568 log_category_is_active(log_context lc, int category) { in log_category_is_active() argument
569 if (lc == NULL) { in log_category_is_active()
573 if (category >= 0 && category < lc->num_categories && in log_category_is_active()
574 lc->categories[category] != NULL) in log_category_is_active()