⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 yc_memalgo.h

📁 一个类STL的多平台可移植的算法容器库,主要用于嵌入式系统编程时的内存管理等方面
💻 H
字号:
/*
 * The young Library
 * Copyright (c) 2005 by Yang Huan(杨桓)

 * Permission to use, copy, modify, distribute and sell this software for any
 * purpose is hereby granted without fee, provided that the above copyright
 * notice appear in all copies and that both that copyright notice and this
 * permission notice appear in supporting documentation.
 * The author make no representations about the suitability of this software
 * for any purpose. It is provided "as is" without express or implied warranty.
 */

/******************************************************************************/
/******************************************************************************/
#ifndef __MACRO_C_YOUNG_LIBRARY_MEMORY_ALGORITHM_HEADER_FILE__
#define __MACRO_C_YOUNG_LIBRARY_MEMORY_ALGORITHM_HEADER_FILE__
/******************************************************************************/
#include "yc_definition.h"

#ifdef __cplusplus
    namespace youngc {  extern "C" {
#endif
/******************************************************************************/
/******************************************************************************/

#ifdef __MACRO_C_YOUNG_LIBRARY_COMPILER_SUPPORT_STANDARD_MEMORY_FUNCTION__
    #include <string.h>
    #define  ylib_memcopy( dst, src, count )  memcpy( dst, src, count )
    #define  ylib_memmove( dst, src, count )  memmove( dst, src, count )
    #define  ylib_memset( dst, c, count )     memset( dst, c, count )
#else
    void* ylib_memcopy( void* dst,
                        const void* src,
                        size_t count );

    void* ylib_memmove( void* dst,
                        const void* src,
                        size_t count );

    void* ylib_memset( void* dst,
                       int c,
                       size_t count );
#endif

wchar_t* ylib_wmemset( wchar_t* dst,
                       wchar_t value,
                       size_t count );

void* memfill( void* dst,
               const void* value,
               size_t count,
               size_t element_size );

void memswap( void* left,
              void* right,
              size_t size );

void memreverse( void* ptr,
                 size_t count,
                 size_t element_size );

/******************************************************************************/
/******************************************************************************/
#ifdef __cplusplus
    }  }
#endif
#endif
/******************************************************************************/
/******************************************************************************/

⌨️ 快捷键说明

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