12 #ifndef _CEPTR_RECEPTOR_H
13 #define _CEPTR_RECEPTOR_H
26 T *__r_make_definitions();
30 T *__r_build_expectation(
Symbol carrier,
T *pattern,
T *action,
T *with,
T *until,
T *
using,
T *cid);
33 void _r_remove_expectation(
Receptor *r,
T *expectation);
63 #define __r_make_addr(p,t,a) ___r_make_addr(p,t,a,0)
71 void evaluateEndCondition(
T *ec,
bool *cleanup,
bool *allow);
73 bool __cid_equal(
SemTable *sem,
T *cid1,
T*cid2);
74 T *__cid_new(
T *parent,
UUIDt *c,
T *topic);
75 UUIDt *__cid_getUUID(
T *cid);
95 #define is_null_symbol(s) ((s).semtype == 0 && (s).context == 0 && (s).id == 0)
96 #define is_null_xaddr(x) (is_null_symbol(x.symbol) && (x).addr == 0)
97 #define is_xaddr_eq(x,y) (semeq(x.symbol,y.symbol) && (x).addr == (y).addr)
99 #define spec_is_symbol_equal(r,got, expected) spec_total++; if (semeq(expected,got)){putchar('.');} else {putchar('F');sprintf(failures[spec_failures++],"%s:%d expected %s to be %s but was %s",__FUNCTION__,__LINE__,#got,_r_get_symbol_name(r,expected),_r_get_symbol_name(r,got));}
101 #define spec_is_structure_equal(r,got, expected) spec_total++; if (semeq(expected,got)){putchar('.');} else {putchar('F');sprintf(failures[spec_failures++],"%s:%d expected %s to be %s but was %s",__FUNCTION__,__LINE__,#got,_r_get_structure_name(r,expected),_r_get_structure_name(r,got));}
103 #define spec_is_process_equal(r,got, expected) spec_total++; if (semeq(expected,got)){putchar('.');} else {putchar('F');sprintf(failures[spec_failures++],"%s:%d expected %s to be %s but was %s",__FUNCTION__,__LINE__,#got,_r_get_process_name(r,expected),_r_get_process_name(r,got));}
105 #define spec_is_xaddr_equal(sem,got,expected) spec_total++; if (is_xaddr_eq(got,expected)){putchar('.');} else {putchar('F');sprintf(failures[spec_failures++],"%s:%d expected %s to be %s.%d but was %s.%d",__FUNCTION__,__LINE__,#got,!is_null_symbol(expected.symbol)?_sem_get_name(sem,expected.symbol):"0",expected.addr,!is_null_symbol(got.symbol) ? _sem_get_name(sem,got.symbol):"0",got.addr);}
112 void _r_defineClockReceptor(
SemTable *sem);
115 #define __r_make_tick() __r_make_timestamp(TICK,00)
116 T *__r_make_timestamp(
Symbol s,
int delta);
120 void __r_dump_instances(
Receptor *r);
Structure __r_get_symbol_structure(Receptor *r, Symbol s)
find a symbol's structure
void _r_serialize(Receptor *r, void **surfaceP, size_t *lengthP)
header file for symbol and structure definition functions
void __r_test_expectation(Receptor *r, T *expectation, T *signal)
void _r_free(Receptor *r)
semantic trees header file
Receptor * __r_get_receptor(T *installed_receptor)
TreeHash _r_hash(Receptor *r, Xaddr t)
Receptor * _r_new_receptor_from_package(SemTable *sem, Symbol s, T *p, T *bindings)
Creates a new receptor from a receptor package.
Structure _r_define_structure(Receptor *r, char *label, int num_params,...)
void _r_add_expectation(Receptor *r, Aspect aspect, Symbol carrier, T *pattern, T *action, T *with, T *until, T *using, T *cid)
Adds an expectation to a receptor's aspect.
Structure __r_define_structure(Receptor *r, char *label, T *structure_def)
Receptor * _r_new(SemTable *sem, SemanticID r)
Creates a new receptor.
Receptor * _r_unserialize(SemTable *sem, void *surface)
T * _r_send(Receptor *r, T *signal)
SemanticID _r_get_sem_by_label(Receptor *r, char *label)
T * __r_make_signal(ReceptorAddress from, ReceptorAddress to, Aspect aspect, Symbol carrier, T *signal_contents, UUIDt *in_response_to, T *until, T *conversation)
T * _r_build_def_semtrex(Receptor *r, Symbol s)
header file for table for coordinating meaning across a vmhost
size_t __r_get_symbol_size(Receptor *r, Symbol s, void *surface)
T * _r_get_instance(Receptor *r, Xaddr x)
void * ___clock_thread(void *arg)
Label tables map human readable text strings to parts of semantic trees.
Symbol _r_define_symbol(Receptor *r, Structure s, char *label)
Error _r_deliver(Receptor *r, T *signal)
T * _r_set_instance(Receptor *r, Xaddr x, T *t)
Process _r_define_process(Receptor *r, T *code, char *name, char *intention, T *signature, T *link)
T * _r_delete_instance(Receptor *r, Xaddr x)
T * _r_request(Receptor *r, T *signal, Symbol response_carrier, T *code_point, int process_id, T *cid)
int _r_def_match(Receptor *r, Symbol s, T *t)
Xaddr _r_new_instance(Receptor *r, T *t)