Lines Matching defs:lcfg

50 #define VALID_CONFIG(lcfg)	ISC_MAGIC_VALID(lcfg, LCFG_MAGIC)
228 assignchannel(isc_logconfig_t *lcfg, unsigned int category_id,
232 sync_channellist(isc_logconfig_t *lcfg);
270 isc_logconfig_t *lcfg = NULL;
305 result = isc_logconfig_create(lctx, &lcfg);
311 result = sync_channellist(lcfg);
314 lctx->logconfig = lcfg;
318 *lcfgp = lcfg;
321 if (lcfg != NULL)
322 isc_logconfig_destroy(&lcfg);
332 isc_logconfig_t *lcfg;
340 lcfg = isc_mem_get(lctx->mctx, sizeof(*lcfg));
342 if (lcfg != NULL) {
343 lcfg->lctx = lctx;
344 lcfg->channellists = NULL;
345 lcfg->channellist_count = 0;
346 lcfg->duplicate_interval = 0;
347 lcfg->highest_level = level;
348 lcfg->tag = NULL;
349 lcfg->dynamic = ISC_FALSE;
351 ISC_LIST_INIT(lcfg->channels);
356 * config. If the channel creation fails, the lcfg is not
359 lcfg->magic = LCFG_MAGIC;
370 result = isc_log_createchannel(lcfg, "default_syslog",
380 result = isc_log_createchannel(lcfg, "default_stderr",
393 default_channel.channel = ISC_LIST_HEAD(lcfg->channels);
399 result = isc_log_createchannel(lcfg, "default_debug",
407 result = isc_log_createchannel(lcfg, "null",
413 *lcfgp = lcfg;
416 if (lcfg != NULL)
417 isc_logconfig_destroy(&lcfg);
432 isc_logconfig_use(isc_log_t *lctx, isc_logconfig_t *lcfg) {
437 REQUIRE(VALID_CONFIG(lcfg));
438 REQUIRE(lcfg->lctx == lctx);
441 * Ensure that lcfg->channellist_count == lctx->category_count.
445 result = sync_channellist(lcfg);
452 lctx->logconfig = lcfg;
464 isc_logconfig_t *lcfg;
474 lcfg = lctx->logconfig;
476 isc_logconfig_destroy(&lcfg);
504 isc_logconfig_t *lcfg;
513 lcfg = *lcfgp;
519 REQUIRE(lcfg->lctx != NULL && lcfg->lctx->logconfig != lcfg);
521 mctx = lcfg->lctx->mctx;
523 while ((channel = ISC_LIST_HEAD(lcfg->channels)) != NULL) {
524 ISC_LIST_UNLINK(lcfg->channels, channel, link);
544 for (i = 0; i < lcfg->channellist_count; i++)
545 while ((item = ISC_LIST_HEAD(lcfg->channellists[i])) != NULL) {
546 ISC_LIST_UNLINK(lcfg->channellists[i], item, link);
550 if (lcfg->channellist_count > 0)
551 isc_mem_put(mctx, lcfg->channellists,
552 lcfg->channellist_count *
555 lcfg->dynamic = ISC_FALSE;
556 if (lcfg->tag != NULL)
557 isc_mem_free(lcfg->lctx->mctx, lcfg->tag);
558 lcfg->tag = NULL;
559 lcfg->highest_level = 0;
560 lcfg->duplicate_interval = 0;
561 lcfg->magic = 0;
563 isc_mem_put(mctx, lcfg, sizeof(*lcfg));
703 isc_log_createchannel(isc_logconfig_t *lcfg, const char *name,
711 REQUIRE(VALID_CONFIG(lcfg));
722 mctx = lcfg->lctx->mctx;
775 ISC_LIST_PREPEND(lcfg->channels, channel, link);
788 isc_log_usechannel(isc_logconfig_t *lcfg, const char *name,
797 REQUIRE(VALID_CONFIG(lcfg));
800 lctx = lcfg->lctx;
805 for (channel = ISC_LIST_HEAD(lcfg->channels); channel != NULL;
814 result = assignchannel(lcfg, category->id, module, channel);
822 result = assignchannel(lcfg, i, module, channel);
986 isc_log_setduplicateinterval(isc_logconfig_t *lcfg, unsigned int interval) {
987 REQUIRE(VALID_CONFIG(lcfg));
989 lcfg->duplicate_interval = interval;
993 isc_log_getduplicateinterval(isc_logconfig_t *lcfg) {
994 REQUIRE(VALID_CONTEXT(lcfg));
996 return (lcfg->duplicate_interval);
1000 isc_log_settag(isc_logconfig_t *lcfg, const char *tag) {
1001 REQUIRE(VALID_CONFIG(lcfg));
1004 if (lcfg->tag != NULL)
1005 isc_mem_free(lcfg->lctx->mctx, lcfg->tag);
1006 lcfg->tag = isc_mem_strdup(lcfg->lctx->mctx, tag);
1007 if (lcfg->tag == NULL)
1011 if (lcfg->tag != NULL)
1012 isc_mem_free(lcfg->lctx->mctx, lcfg->tag);
1013 lcfg->tag = NULL;
1020 isc_log_gettag(isc_logconfig_t *lcfg) {
1021 REQUIRE(VALID_CONFIG(lcfg));
1023 return (lcfg->tag);
1056 assignchannel(isc_logconfig_t *lcfg, unsigned int category_id,
1063 REQUIRE(VALID_CONFIG(lcfg));
1065 lctx = lcfg->lctx;
1072 * Ensure lcfg->channellist_count == lctx->category_count.
1074 result = sync_channellist(lcfg);
1084 ISC_LIST_INITANDPREPEND(lcfg->channellists[category_id],
1093 if (lcfg->highest_level < channel->level)
1094 lcfg->highest_level = channel->level;
1096 lcfg->dynamic = ISC_TRUE;
1107 sync_channellist(isc_logconfig_t *lcfg) {
1112 REQUIRE(VALID_CONFIG(lcfg));
1114 lctx = lcfg->lctx;
1118 if (lctx->category_count == lcfg->channellist_count)
1130 if (lcfg->channellist_count != 0) {
1131 bytes = lcfg->channellist_count *
1133 memcpy(lists, lcfg->channellists, bytes);
1134 isc_mem_put(lctx->mctx, lcfg->channellists, bytes);
1137 lcfg->channellists = lists;
1138 lcfg->channellist_count = lctx->category_count;
1419 isc_logconfig_t *lcfg;
1456 lcfg = lctx->logconfig;
1458 category_channels = ISC_LIST_HEAD(lcfg->channellists[category->id]);
1473 category_channels != ISC_LIST_HEAD(lcfg->channellists[0]))
1479 ISC_LIST_HEAD(lcfg->channellists[0]);
1555 lcfg->duplicate_interval, 0);
1648 != 0 && lcfg->tag != NULL);
1704 printtag ? lcfg->tag : "",
1747 printtag ? lcfg->tag : "",