Lines Matching refs:lcfg

52 #define VALID_CONFIG(lcfg)	ISC_MAGIC_VALID(lcfg, LCFG_MAGIC)
230 assignchannel(isc_logconfig_t *lcfg, unsigned int category_id,
234 sync_channellist(isc_logconfig_t *lcfg);
272 isc_logconfig_t *lcfg = NULL;
307 result = isc_logconfig_create(lctx, &lcfg);
313 result = sync_channellist(lcfg);
316 lctx->logconfig = lcfg;
320 *lcfgp = lcfg;
323 if (lcfg != NULL)
324 isc_logconfig_destroy(&lcfg);
334 isc_logconfig_t *lcfg;
342 lcfg = isc_mem_get(lctx->mctx, sizeof(*lcfg));
344 if (lcfg != NULL) {
345 lcfg->lctx = lctx;
346 lcfg->channellists = NULL;
347 lcfg->channellist_count = 0;
348 lcfg->duplicate_interval = 0;
349 lcfg->highest_level = level;
350 lcfg->tag = NULL;
351 lcfg->dynamic = ISC_FALSE;
353 ISC_LIST_INIT(lcfg->channels);
358 * config. If the channel creation fails, the lcfg is not
361 lcfg->magic = LCFG_MAGIC;
372 result = isc_log_createchannel(lcfg, "default_syslog",
382 result = isc_log_createchannel(lcfg, "default_stderr",
395 default_channel.channel = ISC_LIST_HEAD(lcfg->channels);
401 result = isc_log_createchannel(lcfg, "default_debug",
409 result = isc_log_createchannel(lcfg, "null",
415 *lcfgp = lcfg;
418 if (lcfg != NULL)
419 isc_logconfig_destroy(&lcfg);
434 isc_logconfig_use(isc_log_t *lctx, isc_logconfig_t *lcfg) {
439 REQUIRE(VALID_CONFIG(lcfg));
440 REQUIRE(lcfg->lctx == lctx);
443 * Ensure that lcfg->channellist_count == lctx->category_count.
447 result = sync_channellist(lcfg);
454 lctx->logconfig = lcfg;
466 isc_logconfig_t *lcfg;
476 lcfg = lctx->logconfig;
478 isc_logconfig_destroy(&lcfg);
506 isc_logconfig_t *lcfg;
515 lcfg = *lcfgp;
521 REQUIRE(lcfg->lctx != NULL && lcfg->lctx->logconfig != lcfg);
523 mctx = lcfg->lctx->mctx;
525 while ((channel = ISC_LIST_HEAD(lcfg->channels)) != NULL) {
526 ISC_LIST_UNLINK(lcfg->channels, channel, link);
546 for (i = 0; i < lcfg->channellist_count; i++)
547 while ((item = ISC_LIST_HEAD(lcfg->channellists[i])) != NULL) {
548 ISC_LIST_UNLINK(lcfg->channellists[i], item, link);
552 if (lcfg->channellist_count > 0)
553 isc_mem_put(mctx, lcfg->channellists,
554 lcfg->channellist_count *
557 lcfg->dynamic = ISC_FALSE;
558 if (lcfg->tag != NULL)
559 isc_mem_free(lcfg->lctx->mctx, lcfg->tag);
560 lcfg->tag = NULL;
561 lcfg->highest_level = 0;
562 lcfg->duplicate_interval = 0;
563 lcfg->magic = 0;
565 isc_mem_put(mctx, lcfg, sizeof(*lcfg));
705 isc_log_createchannel(isc_logconfig_t *lcfg, const char *name,
713 REQUIRE(VALID_CONFIG(lcfg));
724 mctx = lcfg->lctx->mctx;
777 ISC_LIST_PREPEND(lcfg->channels, channel, link);
790 isc_log_usechannel(isc_logconfig_t *lcfg, const char *name,
799 REQUIRE(VALID_CONFIG(lcfg));
802 lctx = lcfg->lctx;
807 for (channel = ISC_LIST_HEAD(lcfg->channels); channel != NULL;
816 result = assignchannel(lcfg, category->id, module, channel);
824 result = assignchannel(lcfg, i, module, channel);
988 isc_log_setduplicateinterval(isc_logconfig_t *lcfg, unsigned int interval) {
989 REQUIRE(VALID_CONFIG(lcfg));
991 lcfg->duplicate_interval = interval;
995 isc_log_getduplicateinterval(isc_logconfig_t *lcfg) {
996 REQUIRE(VALID_CONTEXT(lcfg));
998 return (lcfg->duplicate_interval);
1002 isc_log_settag(isc_logconfig_t *lcfg, const char *tag) {
1003 REQUIRE(VALID_CONFIG(lcfg));
1006 if (lcfg->tag != NULL)
1007 isc_mem_free(lcfg->lctx->mctx, lcfg->tag);
1008 lcfg->tag = isc_mem_strdup(lcfg->lctx->mctx, tag);
1009 if (lcfg->tag == NULL)
1013 if (lcfg->tag != NULL)
1014 isc_mem_free(lcfg->lctx->mctx, lcfg->tag);
1015 lcfg->tag = NULL;
1022 isc_log_gettag(isc_logconfig_t *lcfg) {
1023 REQUIRE(VALID_CONFIG(lcfg));
1025 return (lcfg->tag);
1058 assignchannel(isc_logconfig_t *lcfg, unsigned int category_id,
1065 REQUIRE(VALID_CONFIG(lcfg));
1067 lctx = lcfg->lctx;
1074 * Ensure lcfg->channellist_count == lctx->category_count.
1076 result = sync_channellist(lcfg);
1086 ISC_LIST_INITANDPREPEND(lcfg->channellists[category_id],
1095 if (lcfg->highest_level < channel->level)
1096 lcfg->highest_level = channel->level;
1098 lcfg->dynamic = ISC_TRUE;
1109 sync_channellist(isc_logconfig_t *lcfg) {
1114 REQUIRE(VALID_CONFIG(lcfg));
1116 lctx = lcfg->lctx;
1120 if (lctx->category_count == lcfg->channellist_count)
1132 if (lcfg->channellist_count != 0) {
1133 bytes = lcfg->channellist_count *
1135 memcpy(lists, lcfg->channellists, bytes);
1136 isc_mem_put(lctx->mctx, lcfg->channellists, bytes);
1139 lcfg->channellists = lists;
1140 lcfg->channellist_count = lctx->category_count;
1421 isc_logconfig_t *lcfg;
1458 lcfg = lctx->logconfig;
1460 category_channels = ISC_LIST_HEAD(lcfg->channellists[category->id]);
1475 category_channels != ISC_LIST_HEAD(lcfg->channellists[0]))
1481 ISC_LIST_HEAD(lcfg->channellists[0]);
1557 lcfg->duplicate_interval, 0);
1650 != 0 && lcfg->tag != NULL);
1706 printtag ? lcfg->tag : "",
1749 printtag ? lcfg->tag : "",