buffer_get_type

该函数返回给定缓冲区的类型。

返回值将是以下常量之一:

Buffer Type Constant
常量描述
buffer_fixedA buffer of fixed size.
buffer_growA buffer that will "grow" dynamically as data is added
buffer_wrapA buffer where the data will "wrap". When the data being added reaches the limit of the buffer size, the overwrite will be placed back at the start of the buffer, and further writing will continue from that point.
buffer_fastA special "stripped" buffer that is extremely fast to read/write to. Can only be used with buffer_u8 data types, and must be 1 byte aligned.

 

语法:

buffer_get_type(buffer);

参数类型描述
bufferBufferThe buffer to check.

 

返回:

Buffer Type Constant

 

例子:

type = buffer_get_type(buff);

上面的代码获取变量 buff 中存储的缓冲区类型,并将其存储在变量中。