43 lines
923 B
C
43 lines
923 B
C
|
#ifndef CCM_CCM_H
|
||
|
#define CCM_CCM_H
|
||
|
|
||
|
#include "commons.h"
|
||
|
#include "vec.h"
|
||
|
#include "value.h"
|
||
|
#include "err.h"
|
||
|
|
||
|
typedef unsigned long long CCM;
|
||
|
|
||
|
typedef struct {
|
||
|
err_t err;
|
||
|
vec_t values;
|
||
|
vec_t stack;
|
||
|
} ccm_t;
|
||
|
|
||
|
void ccm_init(ccm_t* self);
|
||
|
void ccm_free(ccm_t* self);
|
||
|
|
||
|
size_t ccm_str(ccm_t* self, char* buffer, size_t size);
|
||
|
|
||
|
int ccm_is_num(ccm_t* self, CCM value);
|
||
|
double ccm_from_num(ccm_t* self, CCM value);
|
||
|
CCM ccm_to_num(ccm_t* self, double value, int line);
|
||
|
|
||
|
int ccm_is_tuple(ccm_t* self, CCM value);
|
||
|
vec_t* ccm_from_tuple(ccm_t* self, CCM value);
|
||
|
CCM ccm_to_tuple(ccm_t* self, vec_t* values, int line);
|
||
|
|
||
|
void ccm_push(ccm_t* self, CCM value);
|
||
|
CCM ccm_pop(ccm_t* self);
|
||
|
CCM ccm_top(ccm_t* self, int depth);
|
||
|
|
||
|
void ccm_add(ccm_t* self);
|
||
|
void ccm_sub(ccm_t* self);
|
||
|
void ccm_usub(ccm_t* self);
|
||
|
void ccm_mul(ccm_t* self);
|
||
|
void ccm_div(ccm_t* self);
|
||
|
void ccm_mod(ccm_t* self);
|
||
|
void ccm_pow(ccm_t* self);
|
||
|
|
||
|
#endif
|