Lines Matching refs:lcfg
40 #define VALID_CONFIG(lcfg) ISC_MAGIC_VALID(lcfg, LCFG_MAGIC)
219 assignchannel(isc_logconfig_t *lcfg, unsigned int category_id,
223 sync_channellist(isc_logconfig_t *lcfg);
258 isc_logconfig_t *lcfg = NULL;
294 result = isc_logconfig_create(lctx, &lcfg);
300 result = sync_channellist(lcfg);
303 lctx->logconfig = lcfg;
307 *lcfgp = lcfg;
310 if (lcfg != NULL)
311 isc_logconfig_destroy(&lcfg);
321 isc_logconfig_t *lcfg;
329 lcfg = isc_mem_get(lctx->mctx, sizeof(*lcfg));
331 if (lcfg != NULL) {
332 lcfg->lctx = lctx;
333 lcfg->channellists = NULL;
334 lcfg->channellist_count = 0;
335 lcfg->duplicate_interval = 0;
336 lcfg->highest_level = level;
337 lcfg->tag = NULL;
338 lcfg->dynamic = ISC_FALSE;
340 ISC_LIST_INIT(lcfg->channels);
345 * config. If the channel creation fails, the lcfg is not
348 lcfg->magic = LCFG_MAGIC;
359 result = isc_log_createchannel(lcfg, "default_syslog",
369 result = isc_log_createchannel(lcfg, "default_stderr",
382 default_channel.channel = ISC_LIST_HEAD(lcfg->channels);
388 result = isc_log_createchannel(lcfg, "default_debug",
396 result = isc_log_createchannel(lcfg, "null",
402 *lcfgp = lcfg;
405 if (lcfg != NULL)
406 isc_logconfig_destroy(&lcfg);
421 isc_logconfig_use(isc_log_t *lctx, isc_logconfig_t *lcfg) {
426 REQUIRE(VALID_CONFIG(lcfg));
427 REQUIRE(lcfg->lctx == lctx);
430 * Ensure that lcfg->channellist_count == lctx->category_count.
434 result = sync_channellist(lcfg);
441 lctx->logconfig = lcfg;
453 isc_logconfig_t *lcfg;
463 lcfg = lctx->logconfig;
465 isc_logconfig_destroy(&lcfg);
493 isc_logconfig_t *lcfg;
502 lcfg = *lcfgp;
508 REQUIRE(lcfg->lctx != NULL && lcfg->lctx->logconfig != lcfg);
510 mctx = lcfg->lctx->mctx;
512 while ((channel = ISC_LIST_HEAD(lcfg->channels)) != NULL) {
513 ISC_LIST_UNLINK(lcfg->channels, channel, link);
533 for (i = 0; i < lcfg->channellist_count; i++)
534 while ((item = ISC_LIST_HEAD(lcfg->channellists[i])) != NULL) {
535 ISC_LIST_UNLINK(lcfg->channellists[i], item, link);
539 if (lcfg->channellist_count > 0)
540 isc_mem_put(mctx, lcfg->channellists,
541 lcfg->channellist_count *
544 lcfg->dynamic = ISC_FALSE;
545 if (lcfg->tag != NULL)
546 isc_mem_free(lcfg->lctx->mctx, lcfg->tag);
547 lcfg->tag = NULL;
548 lcfg->highest_level = 0;
549 lcfg->duplicate_interval = 0;
550 lcfg->magic = 0;
552 isc_mem_put(mctx, lcfg, sizeof(*lcfg));
692 isc_log_createchannel(isc_logconfig_t *lcfg, const char *name,
702 REQUIRE(VALID_CONFIG(lcfg));
712 mctx = lcfg->lctx->mctx;
765 ISC_LIST_PREPEND(lcfg->channels, channel, link);
778 isc_log_usechannel(isc_logconfig_t *lcfg, const char *name,
787 REQUIRE(VALID_CONFIG(lcfg));
790 lctx = lcfg->lctx;
795 for (channel = ISC_LIST_HEAD(lcfg->channels); channel != NULL;
804 result = assignchannel(lcfg, category->id, module, channel);
812 result = assignchannel(lcfg, i, module, channel);
976 isc_log_setduplicateinterval(isc_logconfig_t *lcfg, unsigned int interval) {
977 REQUIRE(VALID_CONFIG(lcfg));
979 lcfg->duplicate_interval = interval;
983 isc_log_getduplicateinterval(isc_logconfig_t *lcfg) {
984 REQUIRE(VALID_CONTEXT(lcfg));
986 return (lcfg->duplicate_interval);
990 isc_log_settag(isc_logconfig_t *lcfg, const char *tag) {
991 REQUIRE(VALID_CONFIG(lcfg));
994 if (lcfg->tag != NULL)
995 isc_mem_free(lcfg->lctx->mctx, lcfg->tag);
996 lcfg->tag = isc_mem_strdup(lcfg->lctx->mctx, tag);
997 if (lcfg->tag == NULL)
1001 if (lcfg->tag != NULL)
1002 isc_mem_free(lcfg->lctx->mctx, lcfg->tag);
1003 lcfg->tag = NULL;
1010 isc_log_gettag(isc_logconfig_t *lcfg) {
1011 REQUIRE(VALID_CONFIG(lcfg));
1013 return (lcfg->tag);
1046 assignchannel(isc_logconfig_t *lcfg, unsigned int category_id,
1053 REQUIRE(VALID_CONFIG(lcfg));
1055 lctx = lcfg->lctx;
1062 * Ensure lcfg->channellist_count == lctx->category_count.
1064 result = sync_channellist(lcfg);
1074 ISC_LIST_INITANDPREPEND(lcfg->channellists[category_id],
1083 if (lcfg->highest_level < channel->level)
1084 lcfg->highest_level = channel->level;
1086 lcfg->dynamic = ISC_TRUE;
1097 sync_channellist(isc_logconfig_t *lcfg) {
1102 REQUIRE(VALID_CONFIG(lcfg));
1104 lctx = lcfg->lctx;
1108 if (lctx->category_count == lcfg->channellist_count)
1120 if (lcfg->channellist_count != 0) {
1121 bytes = lcfg->channellist_count *
1123 memmove(lists, lcfg->channellists, bytes);
1124 isc_mem_put(lctx->mctx, lcfg->channellists, bytes);
1127 lcfg->channellists = lists;
1128 lcfg->channellist_count = lctx->category_count;
1402 isc_logconfig_t *lcfg;
1439 lcfg = lctx->logconfig;
1441 category_channels = ISC_LIST_HEAD(lcfg->channellists[category->id]);
1456 category_channels != ISC_LIST_HEAD(lcfg->channellists[0]))
1462 ISC_LIST_HEAD(lcfg->channellists[0]);
1538 lcfg->duplicate_interval, 0);
1635 != 0 && lcfg->tag != NULL);
1637 != 0 && lcfg->tag != NULL);
1696 printtag ? lcfg->tag : "",
1740 printtag ? lcfg->tag : "",