summaryrefslogtreecommitdiffstats
path: root/gbdk/gbdk-lib/include/stdio.h
diff options
context:
space:
mode:
authorLouis Burda <quent.burda@gmail.com>2022-06-02 15:28:40 +0200
committerLouis Burda <quent.burda@gmail.com>2022-06-02 15:28:40 +0200
commit5bc16063c29aa4d3d287ebd163ccdbcbf54c4f9f (patch)
treec131f947a37b3af2d14d41e9eda098bdec2d061c /gbdk/gbdk-lib/include/stdio.h
parent78a5f810b22f0d8cafa05f638b0cb2e889824859 (diff)
downloadcscg2022-gearboy-master.tar.gz
cscg2022-gearboy-master.zip
Added submodule filesHEADmaster
Diffstat (limited to 'gbdk/gbdk-lib/include/stdio.h')
-rw-r--r--gbdk/gbdk-lib/include/stdio.h70
1 files changed, 70 insertions, 0 deletions
diff --git a/gbdk/gbdk-lib/include/stdio.h b/gbdk/gbdk-lib/include/stdio.h
new file mode 100644
index 00000000..894c3f03
--- /dev/null
+++ b/gbdk/gbdk-lib/include/stdio.h
@@ -0,0 +1,70 @@
+/** @file stdio.h
+ Basic file/console input output functions.
+
+ Including stdio.h will use a large number of the
+ background tiles for font characters. If stdio.h
+ is not included then that space will be available
+ for use with other tiles instead.
+ */
+#ifndef STDIO_INCLUDE
+#define STDIO_INCLUDE
+
+#include <types.h>
+
+/** Print char to stdout.
+ @param c Character to print
+ */
+
+void putchar(char c) OLDCALL;
+
+/** Print the string and arguments given by format to stdout.
+
+ @param format The format string as per printf
+
+ Does not return the number of characters printed.
+
+ Currently supported:
+ \li \%hx (char as hex)
+ \li \%hu (unsigned char)
+ \li \%hd (signed char)
+ \li \%c (character)
+ \li \%u (unsigned int)
+ \li \%d (signed int)
+ \li \%x (unsigned int as hex)
+ \li \%s (string)
+
+ Warning: to correctly pass chars for printing as chars, they *must*
+ be explicitly re-cast as such when calling the function.
+ See @ref docs_chars_varargs for more details.
+ */
+void printf(const char *format, ...) OLDCALL;
+
+/** Print the string and arguments given by format to a buffer.
+
+ @param str The buffer to print into
+ @param format The format string as per @ref printf
+
+ Does not return the number of characters printed.
+ */
+void sprintf(char *str, const char *format, ...) OLDCALL;
+
+/** puts() writes the string __s__ and a trailing newline to stdout.
+*/
+void puts(const char *s);
+
+/** gets() Reads a line from stdin into a buffer pointed to by __s__.
+
+ @param s Buffer to store string in
+
+ Reads until either a terminating newline or an EOF, which it replaces with '\0'. No
+ check for buffer overrun is performed.
+
+ Returns: Buffer pointed to by __s__
+*/
+char *gets(char *s) OLDCALL;
+
+/** getchar() Reads and returns a single character from stdin.
+ */
+char getchar() OLDCALL;
+
+#endif