#!/usr/bin/env awk
#
# Return the logical negation of a query 'q'.
# This function must be used to keep the header when negating a query.
#
# Parameters:
#   - q : the query to negate
#
# Examples:
#   - tawk 'not(privip($dstIP))' file.txt      # This will print the header
#   - tawk '!privip($dstIP) || hdr()' file.txt # This will print the header
#   - tawk '!privip($dstIP)' file.txt          # This will NOT print the header

@include "hdr"

function not(q) {
    if (hdr()) return __PRIHDR__
    else return !q
}
