📄 yc_definition.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_DEFINITION_HEADER_FILE__
#define __MACRO_C_YOUNG_LIBRARY_DEFINITION_HEADER_FILE__
/******************************************************************************/
#include <stddef.h>
#include <limits.h>
#include "yc_configuration.h"
#ifdef __cplusplus
namespace youngc {
#endif
/******************************************************************************/
/******************************************************************************/
typedef unsigned char ylib_byte_t;
typedef unsigned int ylib_word_t;
#ifndef __MACRO_C_YOUNG_LIBRARY_COMPILER_SUPPORT_BOOLEAN_TYPE__
typedef enum { false = 0, true = !false } bool;
#endif
#ifndef SIZE_MAX
#define SIZE_MAX ( (size_t)(~((size_t)0)) )
#endif
#ifndef MB_LEN_MAX
#define MB_LEN_MAX 1
#endif
enum YOUNG_LIBRARY_COMMON_CONSTANT
{
BYTE_BITS = CHAR_BIT,
CHARACTER_SIZE_MAX = MB_LEN_MAX
};
typedef union
{
bool bool_val;
char char_val;
signed char schar_val;
unsigned char uchar_val;
short short_val;
unsigned short ushort_val;
int int_val;
unsigned int uint_val;
long long_val;
unsigned long ulong_val;
float flt_val;
double db_val;
long double ldb_val;
void* ptr_val;
#ifdef __MACRO_C_YOUNG_LIBRARY_COMPILER_SUPPORT_LONG_LONG_TYPE__
long long llong_val;
unsigned long long ullong_val;
#endif
#if defined(_MSC_VER) || defined(__BORLANDC__)
__int64 i64_val;
unsigned __int64 ui64_val;
#endif
} ylib_inner_t;
/******************************************************************************/
typedef void (*ylib_fp_oper_t)( void* element );
typedef void (*ylib_fp_move_t)( void* destination, void* source );
typedef int (*ylib_fp_copy_t)( void* destination, const void* source );
typedef void* (*ylib_fp_alloc_t)( size_t bytes );
typedef void (*ylib_fp_dealloc_t)( void* ptr, size_t bytes );
typedef const void* (*ylib_fp_get_t)( const void* element );
/* (1) < 0 : left < right; (2) = 0 : left = right; (3) > 0 : left > right */
typedef int (*ylib_fp_cmp_t)( const void* left, const void* right );
/******************************************************************************/
/******************************************************************************/
#ifdef __cplusplus
} /* end namespace */
#endif
#endif
/******************************************************************************/
/******************************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -