#!/usr/bin/env python3
#
# Copyright (C) 2021 Red Hat, Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library. If not, see
# .
# About:
# When provided with an interface file, this script outputs a new interface
# file, where all original interfaces are enclosed in an ifndef statement
# dependent on their name. All indentation inside the interface file should
# be converted to tabs before running this script.
#
# Known issues:
# - interface already enclosed in an ifndef statement is not ignored
# - "`" and "'" inside comments are not ignored
# - \t is always used for indentation - may result in mixture of spaces and tabs
import sys
import os
import re
if len(sys.argv) < 1:
print(("Usage: {} .if >