aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/assert.h2
-rw-r--r--include/bits/types.h3
-rw-r--r--include/inttypes.h61
-rw-r--r--include/iso646.h50
-rw-r--r--include/memory.h10
5 files changed, 126 insertions, 0 deletions
diff --git a/include/assert.h b/include/assert.h
index 9f964e0..12b20eb 100644
--- a/include/assert.h
+++ b/include/assert.h
@@ -72,6 +72,8 @@
+/* The definitions above shall be redefined at any time this header file
+ * is included. The definitions below are static, and thus guarded. */
#ifndef _ASSERT_H
#define _ASSERT_H
diff --git a/include/bits/types.h b/include/bits/types.h
index b7d0bd6..8e40b87 100644
--- a/include/bits/types.h
+++ b/include/bits/types.h
@@ -23,6 +23,9 @@
#include <bits/intconf.h>
+/* TODO [u]int(|_least|_fast)$N_t are compiler-dependent and may even
+ * be compiler-flag-dependent. Some CPP-magic is required to
+ * figure there exact underlaying intrinsic type and existence. */
/* Ensure that dependencies for type are defined. */
diff --git a/include/inttypes.h b/include/inttypes.h
index 5272ebc..3bae82a 100644
--- a/include/inttypes.h
+++ b/include/inttypes.h
@@ -63,33 +63,94 @@ intmax_t imaxabs(intmax_t)
/* Printing and scanning code affixes. */
+/**
+ * Length modifier affix for printing an `int8_t` or an `uint8_t`.
+ * For internal use, not libc-portable.
+ */
#define __PRI8 ""
+
+/**
+ * Length modifier affix for scanning an `int8_t` or an `uint8_t`.
+ * For internal use, not libc-portable.
+ */
#define __SCN8 "hh"
+
+/**
+ * Length modifier affix for printing an `int16_t` or an `uint16_t`.
+ * For internal use, not libc-portable.
+ */
#define __PRI16 ""
+
+/**
+ * Length modifier affix for scanning an `int16_t` or an `uint16_t`.
+ * For internal use, not libc-portable.
+ */
#define __SCN16 "h"
+
#if __INT_BIT == 32
+/**
+ * Length modifier affix for printing an `int32_t` or an `uint32_t`.
+ * For internal use, not libc-portable.
+ */
# define __PRI32 ""
+
+/**
+ * Length modifier affix for scanning an `int32_t` or an `uint32_t`.
+ * For internal use, not libc-portable.
+ */
# define __SCN32 ""
#else
# define __PRI32 "l"
# define __SCN32 "l"
#endif
+
#if __LONG_BIT == 64
+/**
+ * Length modifier affix for printing an `int64_t` or an `uint64_t`.
+ * For internal use, not libc-portable.
+ */
# define __PRI64 "l"
+
+/**
+ * Length modifier affix for scanning an `int64_t` or an `uint64_t`.
+ * For internal use, not libc-portable.
+ */
# define __SCN64 "l"
#else
# define __PRI64 "ll"
# define __SCN64 "ll"
#endif
+
+/**
+ * Length modifier affix for printing an `intmax_t` or an `uintmax_t`.
+ * For internal use, not libc-portable.
+ */
#define __PRIMAX "j"
+
+/**
+ * Length modifier affix for scanning an `intmax_t` or an `uintmax_t`.
+ * For internal use, not libc-portable.
+ */
#define __SCNMAX "j"
+
#if __PTR_BIT == 8
+/**
+ * Length modifier affix for printing an `intptr_t`, an `uintptr_t`,
+ * a `ptrdiff_t`, an `uptrdiff_t`, an `ssize_t, or a `size_t`.
+ * For internal use, not libc-portable.
+ */
# define __PRIPTR __PRI8
+
+/**
+ * Length modifier affix for scanning an `intptr_t`, an `uintptr_t`,
+ * a `ptrdiff_t`, an `uptrdiff_t`, an `ssize_t, or a `size_t`.
+ * For internal use, not libc-portable.
+ */
# define __SCNPTR __SCN8
#elif __PTR_BIT == 16
# define __PRIPTR __PRI16
diff --git a/include/iso646.h b/include/iso646.h
index c0c7a51..51edb6a 100644
--- a/include/iso646.h
+++ b/include/iso646.h
@@ -25,17 +25,67 @@
#endif
+/* These defitions were added in C95 to make it easier incase
+ * your keyboard layout does not have these characters.
+ * Interestingly, all other ASCII punctuation was not considered.
+ * Also, if you really need this, using the terminal must be
+ * a pain in the ass for you. */
+
+
+/**
+ * Alias for logical and (&&).
+ */
#define and &&
+
+/**
+ * Alias for bitwise and assignement (&=).
+ */
#define and_eq &=
+
+/**
+ * Alias for bitwise and (&).
+ */
#define bitand &
+
+/**
+ * Alias for bitwise inclusive or (|).
+ */
#define bitor |
+
+/**
+ * Alias for bitwise complement (~).
+ */
#define compl ~
+
+/**
+ * Alias for logical complement (!).
+ */
#define not !
+
+/**
+ * Alias for inequality comparer (!=).
+ */
#define not_eq !=
+
+/**
+ * Alias for logical inclusive (||).
+ */
#define or ||
+
+/**
+ * Alias for bitwise inclusive or assignment (|=).
+ */
#define or_eq |=
+
+/**
+ * Alias for bitwise exclusive or (^).
+ */
#define xor ^
+
+/**
+ * Alias for bitwise exclusive or assignment (^=).
+ */
#define xor_eq ^=
diff --git a/include/memory.h b/include/memory.h
index 795e07e..f0a7f6f 100644
--- a/include/memory.h
+++ b/include/memory.h
@@ -15,5 +15,15 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#ifndef _MEMORY_H
+#define _MEMORY_H
#include <string.h>
+
+#if !defined(_SLIBC_SUPPRESS_WARNINGS)
+# warning "Please include <string.h> instead of <memory.h>."
+#endif
+
+
+#endif
+