23 changes: 23 additions & 0 deletions libc/src/__support/StringUtil/tables/linux_platform_errors.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//===-- Map of error numbers to strings for the Linux platform --*- 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
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_LINUX_PLATFORM_ERRORS_H
#define LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_LINUX_PLATFORM_ERRORS_H

#include "linux_extension_errors.h"
#include "posix_errors.h"
#include "stdc_errors.h"

namespace __llvm_libc {

inline constexpr auto PLATFORM_ERRORS =
STDC_ERRORS + POSIX_ERRORS + LINUX_ERRORS;

} // namespace __llvm_libc

#endif // LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_LINUX_PLATFORM_ERRORS_H
23 changes: 23 additions & 0 deletions libc/src/__support/StringUtil/tables/linux_platform_signals.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//===-- Map of error numbers to strings for the Linux platform --*- 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
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_LINUX_PLATFORM_SIGNALS_H
#define LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_LINUX_PLATFORM_SIGNALS_H

#include "linux_extension_signals.h"
#include "posix_signals.h"
#include "stdc_signals.h"

namespace __llvm_libc {

inline constexpr auto PLATFORM_SIGNALS =
STDC_SIGNALS + POSIX_SIGNALS + LINUX_SIGNALS;

} // namespace __llvm_libc

#endif // LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_LINUX_PLATFORM_SIGNALS_H
20 changes: 20 additions & 0 deletions libc/src/__support/StringUtil/tables/minimal_platform_errors.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//===-- Map of error numbers to strings for a stdc platform -----*- 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
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_MINIMAL_PLATFORM_ERRORS_H
#define LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_MINIMAL_PLATFORM_ERRORS_H

#include "stdc_errors.h"

namespace __llvm_libc {

inline constexpr auto PLATFORM_ERRORS = STDC_ERRORS;

} // namespace __llvm_libc

#endif // LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_MINIMAL_PLATFORM_ERRORS_H
20 changes: 20 additions & 0 deletions libc/src/__support/StringUtil/tables/minimal_platform_signals.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//===-- Map of error numbers to strings for a stdc platform -----*- 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
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_MINIMAL_PLATFORM_SIGNALS_H
#define LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_MINIMAL_PLATFORM_SIGNALS_H

#include "stdc_signals.h"

namespace __llvm_libc {

inline constexpr auto PLATFORM_SIGNALS = STDC_SIGNALS;

} // namespace __llvm_libc

#endif // LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_MINIMAL_PLATFORM_SIGNALS_H
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
//===-- Map from error numbers to strings in posix --------------*- C++ -*-===//
//===-- Map of POSIX error numbers to strings -------------------*- 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
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_POSIX_ERROR_TABLE_H
#define LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_POSIX_ERROR_TABLE_H
#ifndef LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_POSIX_ERRORS_H
#define LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_POSIX_ERRORS_H

#include "src/errno/libc_errno.h" // For error macros

#include "src/__support/CPP/array.h"
#include "src/__support/StringUtil/message_mapper.h"

namespace __llvm_libc::internal {
#include <errno.h> // For error macros

namespace __llvm_libc {

inline constexpr MsgTable<76> POSIX_ERRORS = {
MsgMapping(EPERM, "Operation not permitted"),
Expand Down Expand Up @@ -95,6 +94,6 @@ inline constexpr MsgTable<76> POSIX_ERRORS = {
MsgMapping(ENOTRECOVERABLE, "State not recoverable"),
};

} // namespace __llvm_libc::internal
} // namespace __llvm_libc

#endif // LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_POSIX_ERROR_TABLE_H
#endif // LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_POSIX_ERRORS_H
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
//===-- Map from signal numbers to strings in posix -------------*- C++ -*-===//
//===-- Map of POSIX signal numbers to strings ------------------*- 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
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_POSIX_SIGNAL_TABLE_H
#define LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_POSIX_SIGNAL_TABLE_H

#include <signal.h>
#ifndef LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_POSIX_SIGNALS_H
#define LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_POSIX_SIGNALS_H

#include "src/__support/CPP/array.h"
#include "src/__support/StringUtil/message_mapper.h"

namespace __llvm_libc::internal {
#include <signal.h> // For signal numbers

namespace __llvm_libc {

inline constexpr MsgTable<22> POSIX_SIGNALS = {
MsgMapping(SIGHUP, "Hangup"),
Expand All @@ -41,6 +41,6 @@ inline constexpr MsgTable<22> POSIX_SIGNALS = {
MsgMapping(SIGSYS, "Bad system call"),
};

} // namespace __llvm_libc::internal
} // namespace __llvm_libc

#endif // LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_POSIX_SIGNAL_TABLE_H
#endif // LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_POSIX_SIGNALS_H
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
//===-- Map from error numbers to strings in the c std ----------*- C++ -*-===//
//===-- Map of C standard error numbers to strings --------------*- 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
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_STDC_ERROR_TABLE_H
#define LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_STDC_ERROR_TABLE_H

#include "src/errno/libc_errno.h" // For error macros
#ifndef LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_STDC_ERRORS_H
#define LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_STDC_ERRORS_H

#include "src/__support/StringUtil/message_mapper.h"

namespace __llvm_libc::internal {
#include <errno.h> // For error macros

namespace __llvm_libc {

inline constexpr const MsgTable<4> STDC_ERRORS = {
MsgMapping(0, "Success"),
Expand All @@ -22,6 +22,6 @@ inline constexpr const MsgTable<4> STDC_ERRORS = {
MsgMapping(EILSEQ, "Invalid or incomplete multibyte or wide character"),
};

} // namespace __llvm_libc::internal
} // namespace __llvm_libc

#endif // LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_LINUX_ERROR_TABLE_H
#endif // LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_LINUX_ERRORS_H
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
//===-- Map from signal numbers to strings in the c std ---------*- C++ -*-===//
//===-- Map of C standard signal numbers to strings -------------*- 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
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_STDC_SIGNAL_TABLE_H
#define LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_STDC_SIGNAL_TABLE_H
#ifndef LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_STDC_SIGNALS_H
#define LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_STDC_SIGNALS_H

#include <signal.h>
#include <signal.h> // For signal numbers

#include "src/__support/StringUtil/message_mapper.h"

namespace __llvm_libc::internal {
namespace __llvm_libc {

inline constexpr const MsgTable<6> STDC_SIGNALS = {
MsgMapping(SIGINT, "Interrupt"),
Expand All @@ -24,6 +24,6 @@ inline constexpr const MsgTable<6> STDC_SIGNALS = {
MsgMapping(SIGTERM, "Terminated"),
};

} // namespace __llvm_libc::internal
} // namespace __llvm_libc

#endif // LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_LINUX_SIGNAL_TABLE_H
#endif // LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_LINUX_SIGNALS_H