Changeset 26 in libcf for trunk/include/cf_file.h


Ignore:
Timestamp:
02/04/13 17:00:53 (11 years ago)
Author:
cheese
Message:

#1 documentation with doxygen

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/cf_file.h

    r17 r26  
    11/**
    2  * cf_file.h
     2 * @file    cf_file.h
     3 * @author  myusgun <myusgun@gmail.com>
     4 * @version 0.1
    35 */
    46#ifndef __CF_FILE_H__
     
    1618#define CF_ERROR_FILE_GET_SIZE          CF_ERROR_FILE - 7
    1719
    18 typedef enum{
    19     CF_FILE_RO = O_RDONLY,
    20     CF_FILE_WO = O_WRONLY,
    21     CF_FILE_WR = O_RDWR,
    22     CF_FILE_CR = O_CREAT,
    23     CF_FILE_TR = O_TRUNC,
    24     CF_FILE_AP = O_APPEND
     20/** 파일 열기 옵션 플래그 */
     21typedef enum {
     22    CF_FILE_RO = O_RDONLY,  /**< 읽기 전용 */
     23    CF_FILE_WO = O_WRONLY,  /**< 쓰기 전용 */
     24    CF_FILE_WR = O_RDWR,    /**< 읽기/쓰기 */
     25    CF_FILE_CR = O_CREAT,   /**< 파일이 존재하지 않으면 생성 */
     26    CF_FILE_TR = O_TRUNC,   /**< 파일이 존재하면 비우기 */
     27    CF_FILE_AP = O_APPEND   /**< 파일이 존재하면 이어서 쓰기 */
    2528} E_CF_FILE_FLAG, CF_FILE_FLAG;
    2629
     
    2932#endif
    3033
     34/**
     35 * 파일 열기
     36 *
     37 * @return 성공 시, 파일 디스크립터; 실패 시, 오류 코드
     38 *
     39 * @param path  파일 경로
     40 * @param flag  파일 열기 플래그
     41 *
     42 * @see CF_FILE_FLAG
     43 */
    3144CF_EXPORT int
    3245CF_File_Open            (const char         * path,
    3346                         const CF_FILE_FLAG flag);
    3447
     48/**
     49 * 파일 닫기
     50 *
     51 * @return 성공 시, CF_OK; 실패 시, 오류 코드
     52 *
     53 * @param fd 파일 디스크립터
     54 */
    3555CF_EXPORT int
    36 CF_File_Close           (const int  fd);
     56CF_File_Close           (const int fd);
    3757
     58/**
     59 * 파일 생성
     60 *
     61 * @return 성공 시, 파일 디스크립터; 실패 시, 오류 코드
     62 *
     63 * @param path  파일 경로
     64 */
    3865CF_EXPORT int
    3966CF_File_Create          (const char * path);
    4067
     68/**
     69 * 파일 읽기
     70 *
     71 * @return 성공 시, 읽은 바이트 수; 실패 시, 오류 코드
     72 *
     73 * @param fd    파일 디스크립터
     74 * @param buf   데이터를 저장할 메모리
     75 * @param len   데이터를 저장할 메모리의 크기
     76 */
    4177CF_EXPORT int
    4278CF_File_Read            (const int      fd,
     
    4480                         const size_t   len);
    4581
     82/**
     83 * 파일 쓰기
     84 *
     85 * @return 성공 시, CF_OK; 실패 시, 오류 코드
     86 *
     87 * @param fd    파일 디스크립터
     88 * @param buf   데이터가 저장된 메모리
     89 * @param len   쓸 데이터의 길이
     90 */
    4691CF_EXPORT int
    4792CF_File_Write           (const int      fd,
     
    4994                         const size_t   len);
    5095
     96/**
     97 * 파일 크기 얻기
     98 *
     99 * @return 성공 시, 파일 크기; 실패 시, 오류 코드
     100 *
     101 * @param fd    파일 디스크립터
     102 */
    51103CF_EXPORT int
    52104CF_File_GetSize         (const int fd);
Note: See TracChangeset for help on using the changeset viewer.