Desktop/xinu_mips-1.0.2.tar/xinu_mips-1.0.2/include/stdio.h File Reference

#include <kernel.h>
#include <device.h>
#include <vararg.h>

Include dependency graph for stdio.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define puts(s)   fputs(CONSOLE, s)
#define printf(...)   fprintf (CONSOLE, __VA_ARGS__)
#define scanf(fmt, args)   fscanf(CONSOLE, fmt, args)

Functions

syscall kprintf (char *,...)
syscall kputc (device *, unsigned char)
int _doscan (register char *, register int **, int(*)(void), int(*)(char), int, int)
int fscanf (int, char *, int)
int sscanf (char *, char *, int)
char * fgets (int, char *, int)
void _doprnt (char *, va_list, int(*)(int, int), int)
int fprintf (int, char *,...)
int sprintf (char *, char *,...)
int fputs (int, char *)


Detailed Description

puts, printf, scanf

Id
stdio.h 232 2007-07-12 19:03:52Z brylow

Definition in file stdio.h.


Define Documentation

#define printf ( ...   )     fprintf (CONSOLE, __VA_ARGS__)

#define puts (  )     fputs(CONSOLE, s)

CONSOLE input and output

Definition at line 41 of file stdio.h.

#define scanf ( fmt,
args   )     fscanf(CONSOLE, fmt, args)

Definition at line 43 of file stdio.h.


Function Documentation

void _doprnt ( char *  ,
va_list  ,
int(*)(int, int)  ,
int   
)

Formatted output

Referenced by fprintf(), kprintf(), and sprintf().

int _doscan ( register char *  ,
register int **  ,
int(*)(void)  ,
int(*)(char)  ,
int  ,
int   
)

Formatted input

Referenced by fscanf(), and sscanf().

char* fgets ( int  dev,
char *  s,
int  n 
)

Read a newline-terminated string from device (file) dev

Parameters:
dev device to read from
*s buffer for result
n maximum read length

Definition at line 18 of file fgets.c.

References getc(), and NULL.

int fprintf ( int  dev,
char *  fmt,
  ... 
)

Print a formatted message on specified device (file)

Parameters:
dev device to write to
*fmt format string

Definition at line 20 of file fprintf.c.

References _doprnt(), OK, putc(), va_end, and va_start.

Referenced by shell(), testItem(), uartStat(), xsh_exit(), xsh_gpiostat(), xsh_help(), xsh_kill(), xsh_led(), xsh_memstat(), xsh_ps(), xsh_reset(), xsh_sleep(), xsh_testsuite(), and xsh_uartstat().

int fputs ( int  dev,
char *  s 
)

Write a null-terminated string to a device (file)

Parameters:
dev device to write to
*s string to write
Returns:
result of last putc

Definition at line 17 of file fputs.c.

References putc().

int fscanf ( int  dev,
char *  fmt,
int  args 
)

Read from a device (file) according to a format.

Parameters:
dev device to read from
*fmt format string
args number of arguments in format string
Returns:
result of _doscan

Definition at line 24 of file fscanf.c.

References _doscan(), EMPTY, getch(), and ungetch().

syscall kprintf ( char *  fmt,
  ... 
)

Kernel output (for debugging use only)

kprintf - kernel printf: formatted, unbuffered output to CONSOLE

Parameters:
*fmt pointer to string being printed
Returns:
OK on success

Definition at line 55 of file kprintf.c.

References _doprnt(), devtab, kputc(), OK, SERIAL0, va_end, and va_start.

syscall kputc ( device pdev,
unsigned char  c 
)

kputc - perform a synchronous kernel write to the console tty

Parameters:
*pdev pointer to device on which to write character
c character to write
Returns:
c on success, SYSERR on failure

Definition at line 21 of file kprintf.c.

References dentry::controlblk, uart::cout, dentry::csr, uart::csr, uart_csreg::ier, uart_csreg::lsr, NULL, SYSERR, UART_LSR_TEMT, and uarttab.

Referenced by kprintf().

int sprintf ( char *  str,
char *  fmt,
  ... 
)

Format arguments and place output in a string

Parameters:
*str output string
*fmt format string

Definition at line 19 of file sprintf.c.

References _doprnt(), sprntf(), va_end, and va_start.

Referenced by test_checkProcState(), test_checkResult(), test_checkSemCount(), test_deltaQueue(), test_procQueue(), test_semaphore(), test_semaphore2(), test_semaphore3(), and test_semaphore4().

int sscanf ( char *  str,
char *  fmt,
int  args 
)

Read from a string according to a format.

Parameters:
*str string to read from
*fmt format string
args number of arguments in format string
Returns:
result of _doscan

Definition at line 22 of file sscanf.c.

References _doscan(), sgetch(), and sungetch().


Generated on Thu Oct 9 22:34:42 2008 for xinu by  doxygen 1.5.5