XINU
Macros | Functions
sscanf.c File Reference

文字列strを書式formatに従って読み込み、指定されたアドレスに格納する。 More...

Go to the source code of this file.

Macros

#define EOF   (-2)
 End of File. More...
 

Functions

int _doscan (register char *, register int **, int(*getc)(int, char **), int(*ungetc)(int, char **), int, int)
 
static int sgetch (int, char **)
 
int sscanf (char *str, char *fmt, int args)
 
static int sungetch (int, char **)
 

Detailed Description

文字列strを書式formatに従って読み込み、指定されたアドレスに格納する。

Definition in file sscanf.c.

Macro Definition Documentation

◆ EOF

#define EOF   (-2)

End of File.

Definition at line 7 of file sscanf.c.

Referenced by sgetch().

Function Documentation

◆ _doscan()

int _doscan ( register char *  ,
register int **  ,
int(*)(int, char **)  getc,
int(*)(int, char **)  ungetc,
int  ,
int   
)

Referenced by sscanf().

Here is the caller graph for this function:

◆ sgetch()

static int sgetch ( int  dummy,
char **  cpp 
)
static

Definition at line 36 of file sscanf.c.

References EOF.

Referenced by sscanf().

40 {
41  return (*(*cpp) == '\0' ? EOF : *(*cpp)++);
42 }
#define EOF
End of File.
Definition: sscanf.c:7
Here is the caller graph for this function:

◆ sscanf()

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

Definition at line 20 of file sscanf.c.

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

25 {
26  char *s;
27 
28  s = str;
29  return (_doscan(fmt, (int **)&args, sgetch, sungetch, 0, (int)&s));
30 }
int _doscan(register char *, register int **, int(*getc)(int, char **), int(*ungetc)(int, char **), int, int)
static int sungetch(int, char **)
Definition: sscanf.c:48
static int sgetch(int, char **)
Definition: sscanf.c:36
Here is the call graph for this function:

◆ sungetch()

static int sungetch ( int  dummy,
char **  cpp 
)
static

Definition at line 48 of file sscanf.c.

Referenced by sscanf().

52 {
53  return (*(*cpp)--);
54 }
Here is the caller graph for this function: