akaros/kern/include/stdio.h
<<
>>
Prefs
   1#pragma once
   2
   3#include <ros/common.h>
   4#include <stdarg.h>
   5#include <kdebug.h>
   6
   7#ifndef NULL
   8#define NULL    ((void *) 0)
   9#endif /* !NULL */
  10
  11//#define DEBUG
  12#ifdef DEBUG
  13#define printd(args...) cprintf(args)
  14#else
  15#define printd(args...) {}
  16#endif
  17
  18#define printk(args...) cprintf(args)
  19#define __I_AM_HERE_GUTS "Core %d is in %s() at %s:%d\n", core_id(), \
  20                         __func__, __FILE__, __LINE__
  21
  22#define I_AM_HERE printk(__I_AM_HERE_GUTS)
  23#define I_AM_HERE_x printx(__I_AM_HERE_GUTS)
  24#define I_AM_HERE_t trace_printk(__I_AM_HERE_GUTS)
  25#define I_AM_HERE_tx trace_printx(__I_AM_HERE_GUTS)
  26
  27// lib/stdio.c
  28void    cputchar(int c);
  29void    cputbuf(const char *buf, int len);
  30int     getchar(void);
  31int     iscons(int fd);
  32
  33// lib/printfmt.c
  34void    printfmt(void (*putch)(int, void**), void **putdat, const char *fmt, ...);
  35void    vprintfmt(void (*putch)(int, void**), void **putdat, const char *fmt, va_list);
  36
  37// lib/printf.c
  38void print_lock(void);
  39void print_unlock(void);
  40void print_unlock_force(void);
  41int     ( cprintf)(const char *fmt, ...);
  42int     vcprintf(const char *fmt, va_list);
  43
  44// lib/sprintf.c
  45
  46static inline bool snprintf_error(int ret, size_t buf_len)
  47{
  48        return ret < 0 || ret >= buf_len;
  49}
  50
  51int snprintf(char *str, size_t size, const char *fmt, ...);
  52int vsnprintf(char *str, size_t size, const char *fmt, va_list);
  53
  54// lib/fprintf.c
  55int     printf(const char *fmt, ...);
  56int     fprintf(int fd, const char *fmt, ...);
  57int     vfprintf(int fd, const char *fmt, va_list);
  58
  59// lib/readline.c
  60int readline(char *buf, size_t buf_l, const char *prompt, ...);
  61
  62char *seprintf(char *buf, char *end, const char *fmt, ...);
  63
  64// kern/src/net/eipconv.c
  65void printemac(void (*putch)(int, void**), void **putdat, uint8_t *mac);
  66void printip(void (*putch)(int, void**), void **putdat, uint8_t *ip);
  67void printipmask(void (*putch)(int, void**), void **putdat, uint8_t *ip);
  68void printipv4(void (*putch)(int, void**), void **putdat, uint8_t *ip);
  69
  70/* #K */
  71void trace_printk(const char *fmt, ...);
  72
  73/* vsprintf.c (linux) */
  74int vsscanf(const char *buf, const char *fmt, va_list args);
  75int sscanf(const char *buf, const char *fmt, ...);
  76