#include "stream.h"
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
Go to the source code of this file.
Define Documentation
Value:void carry_##T(stream_t *self) \
{ size_t n = (self->ibyte-1)/sizeof(T); \
while( ((T*)(self->d))[n]==max_##T ) \
((T*)(self->d))[n--]=0; \
((T*)(self->d))[n]++; \
}
Definition at line 166 of file stream.c.
Value:T pop_##T(stream_t *self) \
{ T v; \
if(self->ibyte>=self->nbytes) return 0; \
v = *(T*)(self->d+self->ibyte); \
self->ibyte+=sizeof(T); \
return v; \
}
Definition at line 114 of file stream.c.
Value:void push_##T(stream_t *self, T v) \
{ *(T*)(self->d+self->ibyte) = v; \
self->ibyte+=sizeof(T); \
maybe_resize(self); \
}
Definition at line 62 of file stream.c.
#define MAX_TYPE |
( |
|
T | ) |
static const T max_##T = (T)(-1) |
#define SAFE_FREE |
( |
|
e | ) |
if(e) { free(e); (e)=NULL; } |
Value:do{ if(!(e)) {\
printf("%s(%d):"ENDL "\t%s"ENDL "\tExpression evaluated as false."ENDL, \
__FILE__,__LINE__,#e); \
goto Error; \
}} while(0)
Definition at line 18 of file stream.c.
Typedef Documentation
Function Documentation