llvm/llvm/lib/BinaryFormat/Magic.cpp

//===- llvm/BinaryFormat/Magic.cpp - File magic identification --*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "llvm/BinaryFormat/Magic.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Twine.h"
#include "llvm/BinaryFormat/COFF.h"
#include "llvm/BinaryFormat/MachO.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/MemoryBuffer.h"

#if !defined(_MSC_VER) && !defined(__MINGW32__)
#include <unistd.h>
#else
#include <io.h>
#endif

usingnamespacellvm;
usingnamespacellvm::support::endian;
usingnamespacellvm::sys::fs;

template <size_t N>
static bool startswith(StringRef Magic, const char (&S)[N]) {}

/// Identify the magic in magic.
file_magic llvm::identify_magic(StringRef Magic) {}

std::error_code llvm::identify_magic(const Twine &Path, file_magic &Result) {}