git.y1.nz

gbdk-2020

GameBoy Development Kit
download: https://git.y1.nz/archives/gbdk.tar.gz
README | Files | Log | Refs | LICENSE

gbdk-lib/include/stdio.h

      1 /** @file stdio.h
      2     Basic file/console input output functions.
      3 
      4     Including stdio.h will use a large number of the
      5     background tiles for font characters. If stdio.h
      6     is not included then that space will be available
      7     for use with other tiles instead.
      8  */
      9 #ifndef STDIO_INCLUDE
     10 #define STDIO_INCLUDE
     11 
     12 #include <types.h>
     13 
     14 /** Print char to stdout.
     15     @param c            Character to print
     16  */
     17 
     18 void putchar(char c) OLDCALL REENTRANT;
     19 
     20 /** Print the string and arguments given by format to stdout.
     21 
     22     @param format   The format string as per printf
     23 
     24     Does not return the number of characters printed.
     25 
     26     Currently supported:
     27     \li \%hx (char as hex)
     28     \li \%hu (unsigned char)
     29     \li \%hd (signed char)
     30     \li \%c (character)
     31     \li \%u (unsigned int)
     32     \li \%d (signed int)
     33     \li \%x (unsigned int as hex)
     34     \li \%s (string)
     35 
     36     Warning: to correctly pass parameters (such as chars, ints, etc)
     37     __all of them should always be explicitly cast__ as when calling
     38     the function.
     39     See @ref docs_chars_varargs for more details.
     40  */
     41 void printf(const char *format, ...);
     42 
     43 /** Print the string and arguments given by format to a buffer.
     44 
     45     @param str		The buffer to print into
     46     @param format	The format string as per @ref printf
     47 
     48     Does not return the number of characters printed.
     49 
     50     Warning: to correctly pass parameters (such as chars, ints, etc)
     51     __all of them should always be explicitly cast__ as when calling
     52     the function.
     53     See @ref docs_chars_varargs for more details.
     54  */
     55 void sprintf(char *str, const char *format, ...);
     56 
     57 /** puts() writes the string __s__ and a trailing newline to stdout.
     58 */
     59 void puts(const char *s);
     60 
     61 /** gets() Reads a line from stdin into a buffer pointed to by __s__.
     62 
     63     @param s    Buffer to store string in
     64 
     65     Reads until either a terminating newline or an EOF, which it replaces with '\0'. No
     66     check for buffer overrun is performed.
     67 
     68     Returns: Buffer pointed to by __s__
     69 */
     70 char *gets(char *s) OLDCALL;
     71 
     72 /** getchar() Reads and returns a single character from stdin.
     73  */
     74 char getchar(void) OLDCALL;
     75 
     76 #endif

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.