Desktop/xinu_mips-1.0.2.tar/xinu_mips-1.0.2/lib/libxc/fscanf.c File Reference

Go to the source code of this file.


#define EMPTY   (-1)
#define EOF   (-2)
#define TTY_IOC_NEXTC   0x0028


static int getch (int, int *)
static int ungetch (int, int *)
int _doscan (register char *, register int **, int(*)(), int(*)(), int, int)
int fscanf (int dev, char *fmt, int args)

Detailed Description

fscanf, getch, ungetch

fscanf.c 1358 2008-06-30 03:48:37Z mschul

Definition in file fscanf.c.

Define Documentation

#define EMPTY   (-1)

Definition at line 9 of file fscanf.c.

#define EOF   (-2)

Definition at line 10 of file fscanf.c.

#define TTY_IOC_NEXTC   0x0028

Definition at line 11 of file fscanf.c.

Function Documentation

int _doscan ( register char *  fmt,
register int **  argp,
int(*)()  getch,
int(*)()  ungetch,
int  arg1,
int  arg2 

Scan and recognize input according to a format

*fmt format string for the scanf
**argp arguments to scanf
getch function to unget a character
ungetch function to unget a character
arg1 1st argument to getch/ungetch
arg2 2nd argument to getch/ungetch

Definition at line 47 of file doscan.c.

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

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

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

Definition at line 24 of file fscanf.c.

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

static int getch ( int  dev,
int *  buf 
) [static]

Get a character from a device with pushback.

dev device to read from
*buf buffer for reading into

Definition at line 37 of file fscanf.c.

References control(), EMPTY, EOF, getc(), and TTY_IOC_NEXTC.

Referenced by _doscan(), _innum(), _instr(), and fscanf().

static int ungetch ( int  dev,
int *  buf 
) [static]

Pushback a character for getch.

dev device to push back to
*buf buffer for pushing back from

Definition at line 51 of file fscanf.c.

References EMPTY.

Referenced by _doscan(), _innum(), and fscanf().

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