@@ -319,14 +319,13 @@ typedef struct {
319
319
uint32_t default_ttl ;
320
320
uint16_t default_class ;
321
321
struct {
322
- /** Message categories to write out. */
323
- /** All categories are printed if no categories are selected and no
324
- custom callback was specified. */
325
- uint32_t categories ;
326
- /** Callback used to write out log messages. */
322
+ /** Priorities NOT to write out. */
323
+ uint32_t mask ;
324
+ /** Callback invoked to write out log messages. */
327
325
zone_log_t callback ;
328
326
} log ;
329
327
struct {
328
+ /** Callback invoked for each RR. */
330
329
zone_accept_t callback ;
331
330
} accept ;
332
331
} zone_options_t ;
@@ -429,13 +428,13 @@ zone_nonnull((1,2,3,4));
429
428
* error message format consistent.
430
429
*
431
430
* @param[in] parser Zone parser
432
- * @param[in] category Log category
431
+ * @param[in] priority Log priority
433
432
* @param[in] format Format string compatible with printf
434
433
* @param[in] ... Variadic arguments corresponding to #format
435
434
*/
436
435
ZONE_EXPORT void zone_log (
437
436
zone_parser_t * parser ,
438
- uint32_t category ,
437
+ uint32_t priority ,
439
438
const char * format ,
440
439
...)
441
440
zone_nonnull ((1 ,3 ))
@@ -445,13 +444,13 @@ zone_format_printf(3,4);
445
444
* @brief Write error message to active log handler.
446
445
*
447
446
* @param[in] parser Zone parser
448
- * @param[in] category Log category
447
+ * @param[in] priority Log priority
449
448
* @param[in] format Format string compatible with printf
450
449
* @param[in] arguments Argument list
451
450
*/
452
451
ZONE_EXPORT void zone_vlog (
453
452
zone_parser_t * parser ,
454
- uint32_t category ,
453
+ uint32_t priority ,
455
454
const char * format ,
456
455
va_list arguments )
457
456
zone_nonnull ((1 ,3 ));
@@ -461,7 +460,7 @@ zone_nonnull((1,2))
461
460
zone_format_printf (2 ,3 )
462
461
zone_error (zone_parser_t * parser , const char * format , ...)
463
462
{
464
- if (!(parser -> options .log .categories & ZONE_ERROR ))
463
+ if (!(ZONE_ERROR & ~ parser -> options .log .mask ))
465
464
return ;
466
465
va_list arguments ;
467
466
va_start (arguments , format );
@@ -474,7 +473,7 @@ zone_nonnull((1,2))
474
473
zone_format_printf (2 ,3 )
475
474
zone_warning (zone_parser_t * parser , const char * format , ...)
476
475
{
477
- if (!(parser -> options .log .categories & ZONE_WARNING ))
476
+ if (!(ZONE_WARNING & ~ parser -> options .log .mask ))
478
477
return ;
479
478
va_list arguments ;
480
479
va_start (arguments , format );
@@ -487,7 +486,7 @@ zone_nonnull((1,2))
487
486
zone_format_printf (2 ,3 )
488
487
zone_info (zone_parser_t * parser , const char * format , ...)
489
488
{
490
- if (!(parser -> options .log .categories & ZONE_INFO ))
489
+ if (!(ZONE_INFO & ~ parser -> options .log .mask ))
491
490
return ;
492
491
va_list arguments ;
493
492
va_start (arguments , format );
0 commit comments