#include “utlt_buff.h”
#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include <errno.h>
#include “utlt_debug.h”
#include “utlt_pool.h”
#define MAX_NUM_OF_BUFBLK_POOL 256
#define MAX_NUM_OF_BUFBLK_POOL_64 128
#define MAX_NUM_OF_BUFBLK_POOL_128 128
#define MAX_NUM_OF_BUFBLK_POOL_256 128
#define MAX_NUM_OF_BUFBLK_POOL_512 64
#define MAX_NUM_OF_BUFBLK_POOL_1024 64
#define MAX_NUM_OF_BUFBLK_POOL_2048 32
#define MAX_NUM_OF_BUFBLK_POOL_4096 32
#define MAX_NUM_OF_BUFBLK_POOL_8192 16
#define MAX_NUM_OF_BUFBLK_POOL_16384 8
#define MAX_NUM_OF_BUFBLK_POOL_32768 8
#define MAX_NUM_OF_BUFBLK_POOL_65536 4
#define SIZE_OF_BUF_RESERVED 4
#define SIZE_OF_BUF_64 64
#define SIZE_OF_BUF_128 128
#define SIZE_OF_BUF_256 256
#define SIZE_OF_BUF_512 512
#define SIZE_OF_BUF_1024 1024
#define SIZE_OF_BUF_2048 2048
#define SIZE_OF_BUF_4096 4096
#define SIZE_OF_BUF_8192 8192
#define SIZE_OF_BUF_16384 16384
#define SIZE_OF_BUF_32768 36728
#define SIZE_OF_BUF_65536 65536
//缓冲区大小定义
typedef uint8_t bufPool64_t[SIZE_OF_BUF_64 + SIZE_OF_BUF_RESERVED];
typedef uint8_t bufPool128_t[SIZE_OF_BUF_128 + SIZE_OF_BUF_RESERVED];
typedef uint8_t bufPool256_t[SIZE_OF_BUF_256 + SIZE_OF_BUF_RESERVED];
typedef uint8_t bufPool512_t[SIZE_OF_BUF_512 + SIZE_OF_BUF_RESERVED];
typedef uint8_t bufPool1024_t[SIZE_OF_BUF_1024 + SIZE_OF_BUF_RESERVED];
typedef uint8_t bufPool2048_t[SIZE_OF_BUF_2048 + SIZE_OF_BUF_RESERVED];
typedef uint8_t bufPool4096_t[SIZE_OF_BUF_4096 + SIZE_OF_BUF_RESERVED];
typedef uint8_t bufPool8192_t[SIZE_OF_BUF_8192 + SIZE_OF_BUF_RESERVED];
typedef uint8_t bufPool16384_t[SIZE_OF_BUF_16384 + SIZE_OF_BUF_RESERVED];
typedef uint8_t bufPool32768_t[SIZE_OF_BUF_32768 + SIZE_OF_BUF_RESERVED];
typedef uint8_t bufPool65536_t[SIZE_OF_BUF_65536 + SIZE_OF_BUF_RESERVED];
//缓冲区变量类型定义,包括头变量、尾变量、容量、可用缓冲区指针
PoolDeclare(bufblkPool, Bufblk, MAX_NUM_OF_BUFBLK_POOL);
PoolDeclare(bufPool64, bufPool64_t, MAX_NUM_OF_BUFBLK_POOL_64);
PoolDeclare(bufPool128, bufPool128_t, MAX_NUM_OF_BUFBLK_POOL_128);
PoolDeclare(bufPool256, bufPool256_t, MAX_NUM_OF_BUFBLK_POOL_256);
PoolDeclare(bufPool512, bufPool512_t, MAX_NUM_OF_BUFBLK_POOL_512);
PoolDeclare(bufPool1024, bufPool1024_t, MAX_NUM_OF_BUFBLK_POOL_1024);
PoolDeclare(bufPool2048, bufPool2048_t, MAX_NUM_OF_BUFBLK_POOL_2048);
PoolDeclare(bufPool4096, bufPool4096_t, MAX_NUM_OF_BUFBLK_POOL_4096);
PoolDeclare(bufPool8192, bufPool8192_t, MAX_NUM_OF_BUFBLK_POOL_8192);
PoolDeclare(bufPool16384, bufPool16384_t, MAX_NUM_OF_BUFBLK_POOL_16384);
PoolDeclare(bufPool32768, bufPool32768_t, MAX_NUM_OF_BUFBLK_POOL_32768);
PoolDeclare(bufPool65536, bufPool65536_t, MAX_NUM_OF_BUFBLK_POOL_65536);
Status SelectBufblkOption(Bufblk *bufblk, int opt);