1
0
mirror of https://github.com/pmmp/ext-encoding.git synced 2024-11-23 13:36:25 +00:00
ext-encoding/classes/ByteBuffer.h
Dylan K. Taylor d0e71a30aa
Pull simple type encoders out into a separate class
this isn't the final form, but these statics already turned out to be
handy for the tests, and they'll probably be good for attributes and
other stuff like it.
2024-04-10 15:07:05 +01:00

24 lines
522 B
C

#ifndef BYTE_BUFFER_H
#define BYTE_BUFFER_H
extern "C" {
#include "php.h"
}
#include "../ZendUtil.h"
typedef struct _byte_buffer_zend_object {
zend_string* buffer;
size_t read_offset;
size_t write_offset;
size_t used;
zend_object std;
} byte_buffer_zend_object;
#define BYTE_BUFFER_FROM_ZVAL(zv) fetch_from_zend_object<byte_buffer_zend_object>(Z_OBJ_P(zv))
#define BYTE_BUFFER_THIS() BYTE_BUFFER_FROM_ZVAL(ZEND_THIS)
extern zend_class_entry* byte_buffer_ce;
zend_class_entry* init_class_ByteBuffer(void);
#endif