git.y1.nz

SameBoy

Accurate GB/GBC emulator
download: https://git.y1.nz/archives/sameboy.tar.gz
README | Files | Log | Refs | LICENSE

SDL/console.h

      1 #include <stdbool.h>
      2 #include <stdint.h>
      3 #include <stdarg.h>
      4 
      5 #define CON_EOF "\x04"
      6 bool CON_start(char *(*completer)(const char *substring, uintptr_t *context));
      7 char *CON_readline(const char *prompt);
      8 char *CON_readline_async(void);
      9 
     10 typedef struct {
     11     enum {
     12         CON_COLOR_NONE = 0,
     13         CON_COLOR_BLACK,
     14         CON_COLOR_RED,
     15         CON_COLOR_GREEN,
     16         CON_COLOR_YELLOW,
     17         CON_COLOR_BLUE,
     18         CON_COLOR_MAGENTA,
     19         CON_COLOR_CYAN,
     20         CON_COLOR_LIGHT_GREY,
     21         
     22         CON_COLOR_DARK_GREY = CON_COLOR_BLACK + 0x10,
     23         CON_COLOR_BRIGHT_RED = CON_COLOR_RED + 0x10,
     24         CON_COLOR_BRIGHT_GREEN = CON_COLOR_GREEN + 0x10,
     25         CON_COLOR_BRIGHT_YELLOW = CON_COLOR_YELLOW + 0x10,
     26         CON_COLOR_BRIGHT_BLUE = CON_COLOR_BLUE + 0x10,
     27         CON_COLOR_BRIGHT_MAGENTA = CON_COLOR_MAGENTA + 0x10,
     28         CON_COLOR_BRIGHT_CYAN = CON_COLOR_CYAN + 0x10,
     29         CON_COLOR_WHITE = CON_COLOR_LIGHT_GREY + 0x10,
     30     } color:8, background:8;
     31     bool bold;
     32     bool italic;
     33     bool underline;
     34 } CON_attributes_t;
     35 
     36 #ifndef __printflike
     37 /* Missing from Linux headers. */
     38 #define __printflike(fmtarg, firstvararg) \
     39 __attribute__((__format__ (__printf__, fmtarg, firstvararg)))
     40 #endif
     41 
     42 void CON_print(const char *string);
     43 void CON_attributed_print(const char *string, CON_attributes_t *attributes);
     44 void CON_vprintf(const char *fmt, va_list args);
     45 void CON_attributed_vprintf(const char *fmt, CON_attributes_t *attributes, va_list args);
     46 void CON_printf(const char *fmt, ...) __printflike(1, 2);
     47 void CON_attributed_printf(const char *fmt, CON_attributes_t *attributes,...) __printflike(1, 3);
     48 void CON_set_async_prompt(const char *string);
     49 void CON_set_repeat_empty(bool repeat);
     50 void CON_set_line_ready_callback(void (*callback)(void));
     51 bool CON_no_csi_mode(void);

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