buffer.c

来自「h.248协议源码」· C语言 代码 · 共 52 行

C
52
字号
#ifdef __cplusplus
extern "C" {
#endif



/*

NOTICE:
This document contains information that is proprietary to RADVision LTD..
No part of this publication may be reproduced in any form whatsoever without 
written prior approval by RADVision LTD..

RADVision LTD. reserves the right to revise this publication and make changes 
without obligation to notify any person of such revisions or changes.

*/ 

#include <string.h>
#include "buffer.h"

RvBool buffAddToBuffer(RV_BUFFER* to, RV_BUFFER* from, RvUint32 offset)
{
    if (from->length + offset <= to->length)
    {
        memcpy((RvUint8*)to->buffer + offset, from->buffer, from->length);

        return rvTrue;
    }

    return rvFalse;
}

RvBool buffValid(RV_BUFFER *buff, RvUint32 size)
{
    return (size <= buff->length  &&  buff->buffer);
}

RV_BUFFER  buffCreate(void* data,int size)
{
    RV_BUFFER buff;
    buff.buffer = (unsigned char*)data;
    buff.length = size;
    return buff;
}
#ifdef __cplusplus
}              
#endif



⌨️ 快捷键说明

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