# Path: ma/core.py
# X86_PATTERNS = ["amd64", "AMD64", "[xX]86", "[xX]86_64", "[iI]386", "[iI]486",
#                 "[iI]686"]
# PPC_PATTERNS = ["PPC", "ppc", "power[pP][cC]", "POWER[pP][cC]"]
# def get_supported_checkers():
# def get_supported_extensions():
# def execute(command):
# def execute_stdout(command):
# def cmdexists(command):
# def get_timestamp():
# def get_files(location, hint=''):
# def get_file_content(file_name, offset, length):
# def get_raw_node(node):
# def get_includes(file_path):
# def get_ifdefs(file_path):
# def get_ifdef_regex(arch, separator):


import re
from ma import core

Licensed under the Apache License, Version 2.0 (the “License”);
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an “AS IS” BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

    Contributors:
        * Roberto Oliveira <rdutra@br.ibm.com>
        * Diego Fernandez-Merjildo <merjildo@br.ibm.com>
"""


LINE_DELIMITER = "$"


def _get_lines(names, file_name):
    """ Get all lines that contain names and return it as a list """
    grep_delimiter = "\\|"
    command = "grep -n '"
    for name in names:
        command += name + grep_delimiter
    command = command[:-len(grep_delimiter)]
    command += "' " + file_name + " | cut -f1 -d:"

# Path: ma/core.py
# X86_PATTERNS = ["amd64", "AMD64", "[xX]86", "[xX]86_64", "[iI]386", "[iI]486",
#                 "[iI]686"]
# PPC_PATTERNS = ["PPC", "ppc", "power[pP][cC]", "POWER[pP][cC]"]
# def get_supported_checkers():
# def get_supported_extensions():
# def execute(command):
# def execute_stdout(command):
# def cmdexists(command):
# def get_timestamp():
# def get_files(location, hint=''):
# def get_file_content(file_name, offset, length):
# def get_raw_node(node):
# def get_includes(file_path):
# def get_ifdefs(file_path):
# def get_ifdef_regex(arch, separator):


# Path: ma/checkers/checker_file_utils.py
import re
from ma import core


Licensed under the Apache License, Version 2.0 (the “License”);
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an “AS IS” BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

    Contributors:
        * Roberto Oliveira <rdutra@br.ibm.com>
        * Diego Fernandez-Merjildo <merjildo@br.ibm.com>
"""


LINE_DELIMITER = "$"


def _get_lines(names, file_name):
    """ Get all lines that contain names and return it as a list """
    grep_delimiter = "\\|"
    command = "grep -n '"
    for name in names:
        command += name + grep_delimiter
    command = command[:-len(grep_delimiter)]
    command += "' " + file_name + " | cut -f1 -d:"

    lines = core.execute_stdout(command)[1]