nckernel  0.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Typedefs | Functions

C Library 에서 입출력 함수들을 정의한다. More...

Collaboration diagram for 표준 입출력 함수:

Macros

#define BUFSIZ   512
 
#define EOF   (-1)
 End of file character. Some things throughout the library rely on this being -1. More...
 
#define putc(c, stream)   fputc(c, stream)
 지정된 스트림으로 문자 하나를 출력한다. More...
 
#define putchar(c)   fputc(c, stdout)
 표준 출력으로 문자 하나를 출력한다. More...
 
#define puts(s)   fputs(s, stdout)
 표준 출력으로 문자열을 출력한다. More...
 
#define SEEK_CUR   1
 Seek from current position. More...
 
#define SEEK_END   2
 Seek from end of file. More...
 
#define SEEK_SET   0
 Seek from beginning of file. More...
 
#define stderr   thread_get_stderr()
 
#define stdin   thread_get_stdin()
 
#define stdout   thread_get_stdout()
 

Typedefs

typedef struct file FILE
 

Functions

void clearerr (FILE *stream)
 
int feof (FILE *stream)
 
int ferror (FILE *stream)
 
int fflush (FILE *stream)
 스트림의 출력 버퍼를 실제 장치로 전송 한다. More...
 
int fileno (FILE *stream)
 
int fprintf (FILE *stream, const char *format,...)
 지정된 형식에 맞춰서 출력된 문자열을 stream 으로 보낸다. More...
 
int fputc (int c, FILE *stream)
 지정된 스트림으로 문자 하나를 출력한다. More...
 
int fputs (const char *s, FILE *stream)
 지정된 스트림으로 문자열을 출력한다. More...
 
int printf (const char *format,...)
 지정된 형식에 맞춰서 문자열을 출력한다. More...
 
int snprintf (char *str, size_t size, const char *format,...)
 지정된 형식에 맞춰서 문자열을 주어진 버퍼에 지정된 길이만큼 쓴다. More...
 
int sprintf (char *str, const char *format,...)
 지정된 형식에 맞춰서 문자열을 주어진 버퍼에 쓴다. More...
 

Detailed Description

C Library 에서 입출력 함수들을 정의한다.

Author
Sung-jae Park nices.nosp@m.j@ni.nosp@m.cesj..nosp@m.com
Date
2011-7-20

최대한 POSIX 표준을 따르도록 노력하였으며, 구현체는 아키텍쳐와는 독립적으로 재사용 될 수 있도록 구현하였다.

Macro Definition Documentation

#define BUFSIZ   512

Definition at line 35 of file stdio.h.

Referenced by fat_load(), and open().

#define EOF   (-1)

End of file character. Some things throughout the library rely on this being -1.

Definition at line 21 of file stdio.h.

#define putc (   c,
  stream 
)    fputc(c, stream)

지정된 스트림으로 문자 하나를 출력한다.

Parameters
[in]c지정된 스트림으로 문자를 출력한다.
[in]stream출력할 스트림
Returns
int 출력된 문자
See Also
fputc()

Definition at line 48 of file stdio.h.

#define putchar (   c)    fputc(c, stdout)

표준 출력으로 문자 하나를 출력한다.

Parameters
[in]c출력할 문자
Returns
int 출력된 문자
See Also
fputc()

Definition at line 56 of file stdio.h.

#define puts (   s)    fputs(s, stdout)

표준 출력으로 문자열을 출력한다.

Parameters
[in]s출력할 문자열
Returns
출력된 문자열 길이
See Also
fputs()

Definition at line 64 of file stdio.h.

#define SEEK_CUR   1

Seek from current position.

Definition at line 31 of file stdio.h.

Referenced by fdc_lseek(), keyboard_lseek(), and video_lseek().

#define SEEK_END   2

Seek from end of file.

Definition at line 33 of file stdio.h.

Referenced by fdc_lseek(), keyboard_lseek(), and video_lseek().

#define SEEK_SET   0

Seek from beginning of file.

Definition at line 29 of file stdio.h.

Referenced by fdc_lseek(), keyboard_lseek(), update_fat_cache(), and video_lseek().

#define stderr   thread_get_stderr()

Definition at line 39 of file stdio.h.

#define stdin   thread_get_stdin()

Definition at line 37 of file stdio.h.

#define stdout   thread_get_stdout()

Definition at line 38 of file stdio.h.

Referenced by vprintf().

Typedef Documentation

typedef struct file FILE

Definition at line 14 of file stdio.h.

Function Documentation

void clearerr ( FILE stream)

Definition at line 76 of file stdio.c.

int feof ( FILE stream)

Definition at line 80 of file stdio.c.

References ENOSYS.

int ferror ( FILE stream)

Definition at line 85 of file stdio.c.

References ENOSYS.

int fflush ( FILE stream)

스트림의 출력 버퍼를 실제 장치로 전송 한다.

Parameters
[in]stream대상 스트림
Returns
int 성공시 0 실패시 EOF

Definition at line 63 of file stdio.c.

References file::buffer, fileno(), file::offset, and write().

Referenced by fputc().

Here is the call graph for this function:

Here is the caller graph for this function:

int fileno ( FILE stream)
Note
(stream - tcb->file_ctx->table) is not able to exceed the "int" boundary

Definition at line 90 of file stdio.c.

References EFAULT, thread::file_ctx, pthread_self(), and thread_file_ctx::table.

Referenced by fflush(), and fputc().

Here is the call graph for this function:

Here is the caller graph for this function:

int fprintf ( FILE stream,
const char *  format,
  ... 
)

지정된 형식에 맞춰서 출력된 문자열을 stream 으로 보낸다.

Parameters
[in]stream출력 스트림
[in]format형식 문자열
[in]...가변 인자 목록
Returns
int 출력된 문자열 길이

Definition at line 5 of file printf.c.

References va_end, va_start, and vfprintf().

Here is the call graph for this function:

int fputc ( int  c,
FILE stream 
)

지정된 스트림으로 문자 하나를 출력한다.

Parameters
[in]c출력할 문자
[in]stream출력할 스트림
Returns
int 출력된 문자

Definition at line 17 of file stdio.c.

References file::buffer, fflush(), fileno(), file::offset, file::size, and write().

Referenced by fputs().

Here is the call graph for this function:

Here is the caller graph for this function:

int fputs ( const char *  s,
FILE stream 
)

지정된 스트림으로 문자열을 출력한다.

Parameters
[in]s출력할 문자열
[in]stream출력할 스트림
Returns
int 출력된 문자열의 길이

Definition at line 45 of file stdio.c.

References fputc().

Here is the call graph for this function:

int printf ( const char *  format,
  ... 
)

지정된 형식에 맞춰서 문자열을 출력한다.

Parameters
[in]format형식 문자열
[in]...가변 인자 목록
Returns
int 출력된 문자열 길이

Definition at line 41 of file printf.c.

References va_end, va_start, and vprintf().

Referenced by fdc_read(), main(), open(), pthread_detach(), pthread_join(), update_fat_cache(), and util_hexdump().

Here is the call graph for this function:

Here is the caller graph for this function:

int snprintf ( char *  str,
size_t  size,
const char *  format,
  ... 
)

지정된 형식에 맞춰서 문자열을 주어진 버퍼에 지정된 길이만큼 쓴다.

Parameters
[in]str출력 버퍼
[in]size출력 버퍼의 크기
[in]format형식 문자열
[in]...가변 인자 목록
Returns
int 출력된 문자열의 길이

Definition at line 29 of file printf.c.

References va_end, va_start, and vsnprintf().

Here is the call graph for this function:

int sprintf ( char *  str,
const char *  format,
  ... 
)

지정된 형식에 맞춰서 문자열을 주어진 버퍼에 쓴다.

Parameters
[in]str출력 버퍼
[in]format형식 문자열
[in]...가변 인자 목록
Returns
int 출력된 문자열 길이

Definition at line 17 of file printf.c.

References va_end, va_start, and vsprintf().

Here is the call graph for this function: