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