strm.c

来自「PB 熟悉的哥们希望大家可以互相学习一下」· C语言 代码 · 共 28 行

C
28
字号
/***************************************************************
 *                                                             *
 * Copyright(c) 2001-2005 McObject,LLC. All Right Reserved.    *
 *                                                             *
 ***************************************************************/

#include "strm.h"

int file_writer(void* stream_handle /* FILE *  */, const void* from, unsigned nbytes)
{
    FILE* f = (FILE*)stream_handle;
    int nbs = fwrite(from, 1, nbytes, f);
    return nbs;
}


int file_reader(void* stream_handle /* FILE *  */,  /* OUT */void* to, unsigned max_nbytes)
{
    FILE* f = (FILE*)stream_handle;
    int nbs =  - 1;
    if (to == 0)
    {
        return nbs;
    }
    nbs = fread(to, 1, max_nbytes, f);
    return nbs;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?