diff --git a/c/include/vstore.h b/c/include/vstore.h index 476fbbed..b1d23921 100644 --- a/c/include/vstore.h +++ b/c/include/vstore.h @@ -318,65 +318,65 @@ CORTO_EXPORT corto_remote _corto_remote__assign(corto_remote _this, corto_type r #define corto_remote__assign(_this, return_type, is_reference, _impl) _corto_remote__assign(_this, corto_type(return_type), is_reference, (void(*)(void))_impl) #define corto_remote__set(_this, return_type, is_reference, _impl) _this = _this ? _this : (corto_remote*)corto_ptr_new(corto_remote_o); _corto_remote__assign(_this, corto_type(return_type), is_reference, (void(*)(void))_impl) -/* /corto/vstore/result */ -CORTO_EXPORT corto_result* _corto_result__create(corto_object _parent, const char *_id, const char * id, const char * name, const char * parent, const char * type, uintptr_t value, corto_resultMask flags); -#define corto_result__create(_parent, _id, id, name, parent, type, value, flags) _corto_result__create(_parent, _id, id, name, parent, type, value, flags) -#define corto_result__create_auto(_parent, _id, id, name, parent, type, value, flags) corto_result* _id = corto_result__create(_parent, #_id, id, name, parent, type, value, flags); (void)_id -#define corto_result__declare(parent, id) (corto_result*)corto_declare(parent, id, corto_result_o) -CORTO_EXPORT corto_int16 _corto_result__update(corto_result* _this, const char * id, const char * name, const char * parent, const char * type, uintptr_t value, corto_resultMask flags); -#define corto_result__update(_this, id, name, parent, type, value, flags) _corto_result__update(corto_result(_this), id, name, parent, type, value, flags) -CORTO_EXPORT corto_result* _corto_result__assign(corto_result* _this, const char * id, const char * name, const char * parent, const char * type, uintptr_t value, corto_resultMask flags); -#define corto_result__optional_not_set NULL -#define corto_result__optional_set(id, name, parent, type, value, flags) (corto_result*)corto_result__assign((corto_result*)corto_ptr_new(corto_result_o), id, name, parent, type, value, flags) -#define corto_result__optional_set_cond(__cond, id, name, parent, type, value, flags) __cond ? (corto_result*)corto_result__assign((corto_result*)corto_ptr_new(corto_result_o), id, name, parent, type, value, flags) : NULL -#define corto_result__unset(_this) _this ? corto_ptr_free(_this, corto_result_o), 0 : 0; _this = NULL; -#define corto_result__assign(_this, id, name, parent, type, value, flags) _corto_result__assign(_this, id, name, parent, type, value, flags) -#define corto_result__set(_this, id, name, parent, type, value, flags) _this = _this ? _this : (corto_result*)corto_ptr_new(corto_result_o); _corto_result__assign(_this, id, name, parent, type, value, flags) - -/* /corto/vstore/resultIter */ -CORTO_EXPORT corto_resultIter* _corto_resultIter__create(corto_object _parent, const char *_id); -#define corto_resultIter__create(_parent, _id) _corto_resultIter__create(_parent, _id) -#define corto_resultIter__create_auto(_parent, _id) corto_resultIter* _id = corto_resultIter__create(_parent, #_id); (void)_id -#define corto_resultIter__declare(parent, id) (corto_resultIter*)corto_declare(parent, id, corto_resultIter_o) -CORTO_EXPORT corto_int16 _corto_resultIter__update(corto_resultIter* _this); -#define corto_resultIter__update(_this) _corto_resultIter__update(corto_resultIter(_this)) -CORTO_EXPORT corto_resultIter* _corto_resultIter__assign(corto_resultIter* _this); -#define corto_resultIter__optional_not_set NULL -#define corto_resultIter__optional_set() (corto_resultIter*)corto_resultIter__assign((corto_resultIter*)corto_ptr_new(corto_resultIter_o)) -#define corto_resultIter__optional_set_cond(__cond) __cond ? (corto_resultIter*)corto_resultIter__assign((corto_resultIter*)corto_ptr_new(corto_resultIter_o)) : NULL -#define corto_resultIter__unset(_this) _this ? corto_ptr_free(_this, corto_resultIter_o), 0 : 0; _this = NULL; -#define corto_resultIter__assign(_this) _corto_resultIter__assign(_this) -#define corto_resultIter__set(_this) _this = _this ? _this : (corto_resultIter*)corto_ptr_new(corto_resultIter_o); _corto_resultIter__assign(_this) - -/* /corto/vstore/resultlist */ -CORTO_EXPORT corto_resultlist* _corto_resultlist__create(corto_object _parent, const char *_id, corto_uint32 length, corto_result* elements); -#define corto_resultlist__create(_parent, _id, length, elements) _corto_resultlist__create(_parent, _id, length, elements) -#define corto_resultlist__create_auto(_parent, _id, length, elements) corto_resultlist* _id = corto_resultlist__create(_parent, #_id, length, elements); (void)_id -#define corto_resultlist__declare(parent, id) (corto_resultlist*)corto_declare(parent, id, corto_resultlist_o) -CORTO_EXPORT corto_int16 _corto_resultlist__update(corto_resultlist* _this, corto_uint32 length, corto_result* elements); -#define corto_resultlist__update(_this, length, elements) _corto_resultlist__update(corto_resultlist(_this), length, elements) -CORTO_EXPORT corto_resultlist* _corto_resultlist__assign(corto_resultlist* _this, corto_uint32 length, corto_result* elements); -#define corto_resultlist__optional_not_set NULL -#define corto_resultlist__optional_set(length, elements) (corto_resultlist*)corto_resultlist__assign((corto_resultlist*)corto_ptr_new(corto_resultlist_o), length, elements) -#define corto_resultlist__optional_set_cond(__cond, length, elements) __cond ? (corto_resultlist*)corto_resultlist__assign((corto_resultlist*)corto_ptr_new(corto_resultlist_o), length, elements) : NULL -#define corto_resultlist__unset(_this) _this ? corto_ptr_free(_this, corto_resultlist_o), 0 : 0; _this = NULL; -#define corto_resultlist__assign(_this, length, elements) _corto_resultlist__assign(_this, length, elements) -#define corto_resultlist__set(_this, length, elements) _this = _this ? _this : (corto_resultlist*)corto_ptr_new(corto_resultlist_o); _corto_resultlist__assign(_this, length, elements) - -/* /corto/vstore/resultMask */ -CORTO_EXPORT corto_resultMask* _corto_resultMask__create(corto_object _parent, const char *_id, corto_resultMask value); -#define corto_resultMask__create(_parent, _id, value) _corto_resultMask__create(_parent, _id, value) -#define corto_resultMask__create_auto(_parent, _id, value) corto_resultMask* _id = corto_resultMask__create(_parent, #_id, value); (void)_id -#define corto_resultMask__declare(parent, id) (corto_resultMask*)corto_declare(parent, id, corto_resultMask_o) -CORTO_EXPORT corto_int16 _corto_resultMask__update(corto_resultMask* _this, corto_resultMask value); -#define corto_resultMask__update(_this, value) _corto_resultMask__update(corto_resultMask(_this), value) -CORTO_EXPORT corto_resultMask* _corto_resultMask__assign(corto_resultMask* _this, corto_resultMask value); -#define corto_resultMask__optional_not_set NULL -#define corto_resultMask__optional_set(value) (corto_resultMask*)corto_resultMask__assign((corto_resultMask*)corto_ptr_new(corto_resultMask_o), value) -#define corto_resultMask__optional_set_cond(__cond, value) __cond ? (corto_resultMask*)corto_resultMask__assign((corto_resultMask*)corto_ptr_new(corto_resultMask_o), value) : NULL -#define corto_resultMask__unset(_this) _this ? corto_ptr_free(_this, corto_resultMask_o), 0 : 0; _this = NULL; -#define corto_resultMask__assign(_this, value) _corto_resultMask__assign(_this, value) -#define corto_resultMask__set(_this, value) _this = _this ? _this : (corto_resultMask*)corto_ptr_new(corto_resultMask_o); _corto_resultMask__assign(_this, value) +/* /corto/vstore/record */ +CORTO_EXPORT corto_record* _corto_record__create(corto_object _parent, const char *_id, const char * id, const char * name, const char * parent, const char * type, uintptr_t value, corto_recordMask flags); +#define corto_record__create(_parent, _id, id, name, parent, type, value, flags) _corto_record__create(_parent, _id, id, name, parent, type, value, flags) +#define corto_record__create_auto(_parent, _id, id, name, parent, type, value, flags) corto_record* _id = corto_record__create(_parent, #_id, id, name, parent, type, value, flags); (void)_id +#define corto_record__declare(parent, id) (corto_record*)corto_declare(parent, id, corto_record_o) +CORTO_EXPORT corto_int16 _corto_record__update(corto_record* _this, const char * id, const char * name, const char * parent, const char * type, uintptr_t value, corto_recordMask flags); +#define corto_record__update(_this, id, name, parent, type, value, flags) _corto_record__update(corto_record(_this), id, name, parent, type, value, flags) +CORTO_EXPORT corto_record* _corto_record__assign(corto_record* _this, const char * id, const char * name, const char * parent, const char * type, uintptr_t value, corto_recordMask flags); +#define corto_record__optional_not_set NULL +#define corto_record__optional_set(id, name, parent, type, value, flags) (corto_record*)corto_record__assign((corto_record*)corto_ptr_new(corto_record_o), id, name, parent, type, value, flags) +#define corto_record__optional_set_cond(__cond, id, name, parent, type, value, flags) __cond ? (corto_record*)corto_record__assign((corto_record*)corto_ptr_new(corto_record_o), id, name, parent, type, value, flags) : NULL +#define corto_record__unset(_this) _this ? corto_ptr_free(_this, corto_record_o), 0 : 0; _this = NULL; +#define corto_record__assign(_this, id, name, parent, type, value, flags) _corto_record__assign(_this, id, name, parent, type, value, flags) +#define corto_record__set(_this, id, name, parent, type, value, flags) _this = _this ? _this : (corto_record*)corto_ptr_new(corto_record_o); _corto_record__assign(_this, id, name, parent, type, value, flags) + +/* /corto/vstore/recordIter */ +CORTO_EXPORT corto_recordIter* _corto_recordIter__create(corto_object _parent, const char *_id); +#define corto_recordIter__create(_parent, _id) _corto_recordIter__create(_parent, _id) +#define corto_recordIter__create_auto(_parent, _id) corto_recordIter* _id = corto_recordIter__create(_parent, #_id); (void)_id +#define corto_recordIter__declare(parent, id) (corto_recordIter*)corto_declare(parent, id, corto_recordIter_o) +CORTO_EXPORT corto_int16 _corto_recordIter__update(corto_recordIter* _this); +#define corto_recordIter__update(_this) _corto_recordIter__update(corto_recordIter(_this)) +CORTO_EXPORT corto_recordIter* _corto_recordIter__assign(corto_recordIter* _this); +#define corto_recordIter__optional_not_set NULL +#define corto_recordIter__optional_set() (corto_recordIter*)corto_recordIter__assign((corto_recordIter*)corto_ptr_new(corto_recordIter_o)) +#define corto_recordIter__optional_set_cond(__cond) __cond ? (corto_recordIter*)corto_recordIter__assign((corto_recordIter*)corto_ptr_new(corto_recordIter_o)) : NULL +#define corto_recordIter__unset(_this) _this ? corto_ptr_free(_this, corto_recordIter_o), 0 : 0; _this = NULL; +#define corto_recordIter__assign(_this) _corto_recordIter__assign(_this) +#define corto_recordIter__set(_this) _this = _this ? _this : (corto_recordIter*)corto_ptr_new(corto_recordIter_o); _corto_recordIter__assign(_this) + +/* /corto/vstore/recordlist */ +CORTO_EXPORT corto_recordlist* _corto_recordlist__create(corto_object _parent, const char *_id, corto_uint32 length, corto_record* elements); +#define corto_recordlist__create(_parent, _id, length, elements) _corto_recordlist__create(_parent, _id, length, elements) +#define corto_recordlist__create_auto(_parent, _id, length, elements) corto_recordlist* _id = corto_recordlist__create(_parent, #_id, length, elements); (void)_id +#define corto_recordlist__declare(parent, id) (corto_recordlist*)corto_declare(parent, id, corto_recordlist_o) +CORTO_EXPORT corto_int16 _corto_recordlist__update(corto_recordlist* _this, corto_uint32 length, corto_record* elements); +#define corto_recordlist__update(_this, length, elements) _corto_recordlist__update(corto_recordlist(_this), length, elements) +CORTO_EXPORT corto_recordlist* _corto_recordlist__assign(corto_recordlist* _this, corto_uint32 length, corto_record* elements); +#define corto_recordlist__optional_not_set NULL +#define corto_recordlist__optional_set(length, elements) (corto_recordlist*)corto_recordlist__assign((corto_recordlist*)corto_ptr_new(corto_recordlist_o), length, elements) +#define corto_recordlist__optional_set_cond(__cond, length, elements) __cond ? (corto_recordlist*)corto_recordlist__assign((corto_recordlist*)corto_ptr_new(corto_recordlist_o), length, elements) : NULL +#define corto_recordlist__unset(_this) _this ? corto_ptr_free(_this, corto_recordlist_o), 0 : 0; _this = NULL; +#define corto_recordlist__assign(_this, length, elements) _corto_recordlist__assign(_this, length, elements) +#define corto_recordlist__set(_this, length, elements) _this = _this ? _this : (corto_recordlist*)corto_ptr_new(corto_recordlist_o); _corto_recordlist__assign(_this, length, elements) + +/* /corto/vstore/recordMask */ +CORTO_EXPORT corto_recordMask* _corto_recordMask__create(corto_object _parent, const char *_id, corto_recordMask value); +#define corto_recordMask__create(_parent, _id, value) _corto_recordMask__create(_parent, _id, value) +#define corto_recordMask__create_auto(_parent, _id, value) corto_recordMask* _id = corto_recordMask__create(_parent, #_id, value); (void)_id +#define corto_recordMask__declare(parent, id) (corto_recordMask*)corto_declare(parent, id, corto_recordMask_o) +CORTO_EXPORT corto_int16 _corto_recordMask__update(corto_recordMask* _this, corto_recordMask value); +#define corto_recordMask__update(_this, value) _corto_recordMask__update(corto_recordMask(_this), value) +CORTO_EXPORT corto_recordMask* _corto_recordMask__assign(corto_recordMask* _this, corto_recordMask value); +#define corto_recordMask__optional_not_set NULL +#define corto_recordMask__optional_set(value) (corto_recordMask*)corto_recordMask__assign((corto_recordMask*)corto_ptr_new(corto_recordMask_o), value) +#define corto_recordMask__optional_set_cond(__cond, value) __cond ? (corto_recordMask*)corto_recordMask__assign((corto_recordMask*)corto_ptr_new(corto_recordMask_o), value) : NULL +#define corto_recordMask__unset(_this) _this ? corto_ptr_free(_this, corto_recordMask_o), 0 : 0; _this = NULL; +#define corto_recordMask__assign(_this, value) _corto_recordMask__assign(_this, value) +#define corto_recordMask__set(_this, value) _this = _this ? _this : (corto_recordMask*)corto_ptr_new(corto_recordMask_o); _corto_recordMask__assign(_this, value) /* /corto/vstore/route */ CORTO_EXPORT corto_route _corto_route__create(corto_object _parent, const char *_id, const char * pattern, void(*_impl)(void)); @@ -469,13 +469,13 @@ CORTO_EXPORT corto_subscriber _corto_subscriber__assign(corto_subscriber _this, #define corto_subscriber__set(_this, query, format, instance, dispatcher, enabled, _impl) _this = _this ? _this : (corto_subscriber*)corto_ptr_new(corto_subscriber_o); _corto_subscriber__assign(_this, query, format, instance, corto_dispatcher(dispatcher), enabled, (void(*)(void))_impl) /* /corto/vstore/subscriber_event */ -CORTO_EXPORT corto_subscriber_event* _corto_subscriber_event__create(corto_object _parent, const char *_id, corto_subscriber subscriber, corto_object instance, corto_object source, corto_eventMask event, corto_result* data, corto_fmt_data* fmt); +CORTO_EXPORT corto_subscriber_event* _corto_subscriber_event__create(corto_object _parent, const char *_id, corto_subscriber subscriber, corto_object instance, corto_object source, corto_eventMask event, corto_record* data, corto_fmt_data* fmt); #define corto_subscriber_event__create(_parent, _id, subscriber, instance, source, event, data, fmt) _corto_subscriber_event__create(_parent, _id, corto_subscriber(subscriber), instance, source, event, data, fmt) #define corto_subscriber_event__create_auto(_parent, _id, subscriber, instance, source, event, data, fmt) corto_subscriber_event* _id = corto_subscriber_event__create(_parent, #_id, subscriber, instance, source, event, data, fmt); (void)_id #define corto_subscriber_event__declare(parent, id) (corto_subscriber_event*)corto_declare(parent, id, corto_subscriber_event_o) -CORTO_EXPORT corto_int16 _corto_subscriber_event__update(corto_subscriber_event* _this, corto_subscriber subscriber, corto_object instance, corto_object source, corto_eventMask event, corto_result* data, corto_fmt_data* fmt); +CORTO_EXPORT corto_int16 _corto_subscriber_event__update(corto_subscriber_event* _this, corto_subscriber subscriber, corto_object instance, corto_object source, corto_eventMask event, corto_record* data, corto_fmt_data* fmt); #define corto_subscriber_event__update(_this, subscriber, instance, source, event, data, fmt) _corto_subscriber_event__update(corto_subscriber_event(_this), corto_subscriber(subscriber), instance, source, event, data, fmt) -CORTO_EXPORT corto_subscriber_event* _corto_subscriber_event__assign(corto_subscriber_event* _this, corto_subscriber subscriber, corto_object instance, corto_object source, corto_eventMask event, corto_result* data, corto_fmt_data* fmt); +CORTO_EXPORT corto_subscriber_event* _corto_subscriber_event__assign(corto_subscriber_event* _this, corto_subscriber subscriber, corto_object instance, corto_object source, corto_eventMask event, corto_record* data, corto_fmt_data* fmt); #define corto_subscriber_event__optional_not_set NULL #define corto_subscriber_event__optional_set(subscriber, instance, source, event, data, fmt) (corto_subscriber_event*)corto_subscriber_event__assign((corto_subscriber_event*)corto_ptr_new(corto_subscriber_event_o), subscriber, instance, source, event, data, fmt) #define corto_subscriber_event__optional_set_cond(__cond, subscriber, instance, source, event, data, fmt) __cond ? (corto_subscriber_event*)corto_subscriber_event__assign((corto_subscriber_event*)corto_ptr_new(corto_subscriber_event_o), subscriber, instance, source, event, data, fmt) : NULL @@ -524,22 +524,22 @@ CORTO_EXPORT corto_mount_subscription* corto_mount_subscriptionList__last(corto_ CORTO_EXPORT corto_mount_subscription* corto_mount_subscriptionList__get(corto_mount_subscriptionList list, corto_uint32 index); CORTO_EXPORT void corto_mount_subscriptionList__clear(corto_mount_subscriptionList list); -/* /corto/vstore/resultlist */ -CORTO_EXPORT corto_result* corto_resultlist__insert_alloc(corto_resultlist list); -CORTO_EXPORT corto_result* corto_resultlist__insert(corto_resultlist list, corto_result* element); -CORTO_EXPORT corto_result* corto_resultlist__append_alloc(corto_resultlist list); -CORTO_EXPORT corto_result* corto_resultlist__append(corto_resultlist list, corto_result* element); -CORTO_EXPORT corto_result* corto_resultlist__takeFirst(corto_resultlist list); -CORTO_EXPORT corto_result* corto_resultlist__last(corto_resultlist list); -CORTO_EXPORT corto_result* corto_resultlist__get(corto_resultlist list, corto_uint32 index); -CORTO_EXPORT void corto_resultlist__clear(corto_resultlist list); +/* /corto/vstore/recordlist */ +CORTO_EXPORT corto_record* corto_recordlist__insert_alloc(corto_recordlist list); +CORTO_EXPORT corto_record* corto_recordlist__insert(corto_recordlist list, corto_record* element); +CORTO_EXPORT corto_record* corto_recordlist__append_alloc(corto_recordlist list); +CORTO_EXPORT corto_record* corto_recordlist__append(corto_recordlist list, corto_record* element); +CORTO_EXPORT corto_record* corto_recordlist__takeFirst(corto_recordlist list); +CORTO_EXPORT corto_record* corto_recordlist__last(corto_recordlist list); +CORTO_EXPORT corto_record* corto_recordlist__get(corto_recordlist list, corto_uint32 index); +CORTO_EXPORT void corto_recordlist__clear(corto_recordlist list); #define corto_objectIter__foreach(iter, elem) \ corto_object elem;\ while(corto_iter_hasNext(&iter) ? elem = (corto_object)corto_iter_next(&iter), TRUE : FALSE) -#define corto_resultIter__foreach(iter, elem) \ - corto_result elem;\ - while(corto_iter_hasNext(&iter) ? elem = *(corto_result*)(corto_word)corto_iter_next(&iter), TRUE : FALSE) +#define corto_recordIter__foreach(iter, elem) \ + corto_record elem;\ + while(corto_iter_hasNext(&iter) ? elem = *(corto_record*)(corto_word)corto_iter_next(&iter), TRUE : FALSE) #define corto_sampleIter__foreach(iter, elem) \ corto_sample elem;\ diff --git a/c/src/vstore.c b/c/src/vstore.c index 8de5341b..c010f810 100644 --- a/c/src/vstore.c +++ b/c/src/vstore.c @@ -982,19 +982,19 @@ corto_remote _corto_remote__assign(corto_remote _this, corto_type return_type, b return _this; } -corto_result* _corto_result__create(corto_object _parent, const char *_id, const char * id, const char * name, const char * parent, const char * type, uintptr_t value, corto_resultMask flags) { - corto_result* _this; - _this = (corto_result*)corto_declare(_parent, _id, corto_result_o); +corto_record* _corto_record__create(corto_object _parent, const char *_id, const char * id, const char * name, const char * parent, const char * type, uintptr_t value, corto_recordMask flags) { + corto_record* _this; + _this = (corto_record*)corto_declare(_parent, _id, corto_record_o); if (!_this) { return NULL; } if (!corto_check_state(_this, CORTO_VALID)) { - corto_set_str(&((corto_result*)_this)->id, id); - corto_set_str(&((corto_result*)_this)->name, name); - corto_set_str(&((corto_result*)_this)->parent, parent); - corto_set_str(&((corto_result*)_this)->type, type); - ((corto_result*)_this)->value = value; - ((corto_result*)_this)->flags = flags; + corto_set_str(&((corto_record*)_this)->id, id); + corto_set_str(&((corto_record*)_this)->name, name); + corto_set_str(&((corto_record*)_this)->parent, parent); + corto_set_str(&((corto_record*)_this)->type, type); + ((corto_record*)_this)->value = value; + ((corto_record*)_this)->flags = flags; if (corto_define(_this)) { corto_release(_this); _this = NULL; @@ -1003,23 +1003,23 @@ corto_result* _corto_result__create(corto_object _parent, const char *_id, const return _this; } -corto_int16 _corto_result__update(corto_result* _this, const char * id, const char * name, const char * parent, const char * type, uintptr_t value, corto_resultMask flags) { +corto_int16 _corto_record__update(corto_record* _this, const char * id, const char * name, const char * parent, const char * type, uintptr_t value, corto_recordMask flags) { CORTO_UNUSED(_this); if (!corto_update_begin(_this)) { if ((corto_typeof(corto_typeof(_this)) == (corto_type)corto_target_o) && !corto_owned(_this)) { - corto_set_str(&((corto_result*)((corto_result*)CORTO_OFFSET(_this, ((corto_type)corto_result_o)->size)))->id, id); - corto_set_str(&((corto_result*)((corto_result*)CORTO_OFFSET(_this, ((corto_type)corto_result_o)->size)))->name, name); - corto_set_str(&((corto_result*)((corto_result*)CORTO_OFFSET(_this, ((corto_type)corto_result_o)->size)))->parent, parent); - corto_set_str(&((corto_result*)((corto_result*)CORTO_OFFSET(_this, ((corto_type)corto_result_o)->size)))->type, type); - ((corto_result*)((corto_result*)CORTO_OFFSET(_this, ((corto_type)corto_result_o)->size)))->value = value; - ((corto_result*)((corto_result*)CORTO_OFFSET(_this, ((corto_type)corto_result_o)->size)))->flags = flags; + corto_set_str(&((corto_record*)((corto_record*)CORTO_OFFSET(_this, ((corto_type)corto_record_o)->size)))->id, id); + corto_set_str(&((corto_record*)((corto_record*)CORTO_OFFSET(_this, ((corto_type)corto_record_o)->size)))->name, name); + corto_set_str(&((corto_record*)((corto_record*)CORTO_OFFSET(_this, ((corto_type)corto_record_o)->size)))->parent, parent); + corto_set_str(&((corto_record*)((corto_record*)CORTO_OFFSET(_this, ((corto_type)corto_record_o)->size)))->type, type); + ((corto_record*)((corto_record*)CORTO_OFFSET(_this, ((corto_type)corto_record_o)->size)))->value = value; + ((corto_record*)((corto_record*)CORTO_OFFSET(_this, ((corto_type)corto_record_o)->size)))->flags = flags; } else { - corto_set_str(&((corto_result*)_this)->id, id); - corto_set_str(&((corto_result*)_this)->name, name); - corto_set_str(&((corto_result*)_this)->parent, parent); - corto_set_str(&((corto_result*)_this)->type, type); - ((corto_result*)_this)->value = value; - ((corto_result*)_this)->flags = flags; + corto_set_str(&((corto_record*)_this)->id, id); + corto_set_str(&((corto_record*)_this)->name, name); + corto_set_str(&((corto_record*)_this)->parent, parent); + corto_set_str(&((corto_record*)_this)->type, type); + ((corto_record*)_this)->value = value; + ((corto_record*)_this)->flags = flags; } if (corto_update_end(_this)) { return -1; @@ -1030,20 +1030,20 @@ corto_int16 _corto_result__update(corto_result* _this, const char * id, const ch return 0; } -corto_result* _corto_result__assign(corto_result* _this, const char * id, const char * name, const char * parent, const char * type, uintptr_t value, corto_resultMask flags) { +corto_record* _corto_record__assign(corto_record* _this, const char * id, const char * name, const char * parent, const char * type, uintptr_t value, corto_recordMask flags) { CORTO_UNUSED(_this); - corto_set_str(&((corto_result*)_this)->id, id); - corto_set_str(&((corto_result*)_this)->name, name); - corto_set_str(&((corto_result*)_this)->parent, parent); - corto_set_str(&((corto_result*)_this)->type, type); - ((corto_result*)_this)->value = value; - ((corto_result*)_this)->flags = flags; + corto_set_str(&((corto_record*)_this)->id, id); + corto_set_str(&((corto_record*)_this)->name, name); + corto_set_str(&((corto_record*)_this)->parent, parent); + corto_set_str(&((corto_record*)_this)->type, type); + ((corto_record*)_this)->value = value; + ((corto_record*)_this)->flags = flags; return _this; } -corto_resultIter* _corto_resultIter__create(corto_object _parent, const char *_id) { - corto_resultIter* _this; - _this = (corto_resultIter*)corto_declare(_parent, _id, corto_resultIter_o); +corto_recordIter* _corto_recordIter__create(corto_object _parent, const char *_id) { + corto_recordIter* _this; + _this = (corto_recordIter*)corto_declare(_parent, _id, corto_recordIter_o); if (!_this) { return NULL; } @@ -1056,7 +1056,7 @@ corto_resultIter* _corto_resultIter__create(corto_object _parent, const char *_i return _this; } -corto_int16 _corto_resultIter__update(corto_resultIter* _this) { +corto_int16 _corto_recordIter__update(corto_recordIter* _this) { CORTO_UNUSED(_this); if (!corto_update_begin(_this)) { if ((corto_typeof(corto_typeof(_this)) == (corto_type)corto_target_o) && !corto_owned(_this)) { @@ -1071,22 +1071,22 @@ corto_int16 _corto_resultIter__update(corto_resultIter* _this) { return 0; } -corto_resultIter* _corto_resultIter__assign(corto_resultIter* _this) { +corto_recordIter* _corto_recordIter__assign(corto_recordIter* _this) { CORTO_UNUSED(_this); return _this; } -corto_resultlist* _corto_resultlist__create(corto_object _parent, const char *_id, corto_uint32 length, corto_result* elements) { - corto_resultlist* _this; - _this = (corto_resultlist*)corto_declare(_parent, _id, corto_resultlist_o); +corto_recordlist* _corto_recordlist__create(corto_object _parent, const char *_id, corto_uint32 length, corto_record* elements) { + corto_recordlist* _this; + _this = (corto_recordlist*)corto_declare(_parent, _id, corto_recordlist_o); if (!_this) { return NULL; } if (!corto_check_state(_this, CORTO_VALID)) { corto_uint32 i = 0; - corto_resultlist__clear(*_this); + corto_recordlist__clear(*_this); for (i = 0; i < length; i ++) { - corto_resultlist__append(*_this, &elements[i]); + corto_recordlist__append(*_this, &elements[i]); } if (corto_define(_this)) { corto_release(_this); @@ -1096,20 +1096,20 @@ corto_resultlist* _corto_resultlist__create(corto_object _parent, const char *_i return _this; } -corto_int16 _corto_resultlist__update(corto_resultlist* _this, corto_uint32 length, corto_result* elements) { +corto_int16 _corto_recordlist__update(corto_recordlist* _this, corto_uint32 length, corto_record* elements) { CORTO_UNUSED(_this); if (!corto_update_begin(_this)) { if ((corto_typeof(corto_typeof(_this)) == (corto_type)corto_target_o) && !corto_owned(_this)) { corto_uint32 i = 0; - corto_resultlist__clear(*((corto_resultlist*)CORTO_OFFSET(_this, ((corto_type)corto_resultlist_o)->size))); + corto_recordlist__clear(*((corto_recordlist*)CORTO_OFFSET(_this, ((corto_type)corto_recordlist_o)->size))); for (i = 0; i < length; i ++) { - corto_resultlist__append(*((corto_resultlist*)CORTO_OFFSET(_this, ((corto_type)corto_resultlist_o)->size)), &elements[i]); + corto_recordlist__append(*((corto_recordlist*)CORTO_OFFSET(_this, ((corto_type)corto_recordlist_o)->size)), &elements[i]); } } else { corto_uint32 i = 0; - corto_resultlist__clear(*_this); + corto_recordlist__clear(*_this); for (i = 0; i < length; i ++) { - corto_resultlist__append(*_this, &elements[i]); + corto_recordlist__append(*_this, &elements[i]); } } if (corto_update_end(_this)) { @@ -1121,19 +1121,19 @@ corto_int16 _corto_resultlist__update(corto_resultlist* _this, corto_uint32 leng return 0; } -corto_resultlist* _corto_resultlist__assign(corto_resultlist* _this, corto_uint32 length, corto_result* elements) { +corto_recordlist* _corto_recordlist__assign(corto_recordlist* _this, corto_uint32 length, corto_record* elements) { CORTO_UNUSED(_this); corto_uint32 i = 0; - corto_resultlist__clear(*_this); + corto_recordlist__clear(*_this); for (i = 0; i < length; i ++) { - corto_resultlist__append(*_this, &elements[i]); + corto_recordlist__append(*_this, &elements[i]); } return _this; } -corto_resultMask* _corto_resultMask__create(corto_object _parent, const char *_id, corto_resultMask value) { - corto_resultMask* _this; - _this = (corto_resultMask*)corto_declare(_parent, _id, corto_resultMask_o); +corto_recordMask* _corto_recordMask__create(corto_object _parent, const char *_id, corto_recordMask value) { + corto_recordMask* _this; + _this = (corto_recordMask*)corto_declare(_parent, _id, corto_recordMask_o); if (!_this) { return NULL; } @@ -1147,11 +1147,11 @@ corto_resultMask* _corto_resultMask__create(corto_object _parent, const char *_i return _this; } -corto_int16 _corto_resultMask__update(corto_resultMask* _this, corto_resultMask value) { +corto_int16 _corto_recordMask__update(corto_recordMask* _this, corto_recordMask value) { CORTO_UNUSED(_this); if (!corto_update_begin(_this)) { if ((corto_typeof(corto_typeof(_this)) == (corto_type)corto_target_o) && !corto_owned(_this)) { - *((corto_resultMask*)CORTO_OFFSET(_this, ((corto_type)corto_resultMask_o)->size)) = value; + *((corto_recordMask*)CORTO_OFFSET(_this, ((corto_type)corto_recordMask_o)->size)) = value; } else { *_this = value; } @@ -1164,7 +1164,7 @@ corto_int16 _corto_resultMask__update(corto_resultMask* _this, corto_resultMask return 0; } -corto_resultMask* _corto_resultMask__assign(corto_resultMask* _this, corto_resultMask value) { +corto_recordMask* _corto_recordMask__assign(corto_recordMask* _this, corto_recordMask value) { CORTO_UNUSED(_this); *_this = value; return _this; @@ -1480,7 +1480,7 @@ corto_subscriber _corto_subscriber__assign(corto_subscriber _this, corto_query* return _this; } -corto_subscriber_event* _corto_subscriber_event__create(corto_object _parent, const char *_id, corto_subscriber subscriber, corto_object instance, corto_object source, corto_eventMask event, corto_result* data, corto_fmt_data* fmt) { +corto_subscriber_event* _corto_subscriber_event__create(corto_object _parent, const char *_id, corto_subscriber subscriber, corto_object instance, corto_object source, corto_eventMask event, corto_record* data, corto_fmt_data* fmt) { corto_subscriber_event* _this; _this = (corto_subscriber_event*)corto_declare(_parent, _id, corto_subscriber_event_o); if (!_this) { @@ -1492,7 +1492,7 @@ corto_subscriber_event* _corto_subscriber_event__create(corto_object _parent, co corto_set_ref(&((corto_subscriber_event*)_this)->source, source); ((corto_subscriber_event*)_this)->event = event; if (data) { - corto_ptr_copy(&((corto_subscriber_event*)_this)->data, corto_result_o, data); + corto_ptr_copy(&((corto_subscriber_event*)_this)->data, corto_record_o, data); } if (fmt) { corto_ptr_copy(&((corto_subscriber_event*)_this)->fmt, corto_fmt_data_o, fmt); @@ -1505,7 +1505,7 @@ corto_subscriber_event* _corto_subscriber_event__create(corto_object _parent, co return _this; } -corto_int16 _corto_subscriber_event__update(corto_subscriber_event* _this, corto_subscriber subscriber, corto_object instance, corto_object source, corto_eventMask event, corto_result* data, corto_fmt_data* fmt) { +corto_int16 _corto_subscriber_event__update(corto_subscriber_event* _this, corto_subscriber subscriber, corto_object instance, corto_object source, corto_eventMask event, corto_record* data, corto_fmt_data* fmt) { CORTO_UNUSED(_this); if (!corto_update_begin(_this)) { if ((corto_typeof(corto_typeof(_this)) == (corto_type)corto_target_o) && !corto_owned(_this)) { @@ -1514,7 +1514,7 @@ corto_int16 _corto_subscriber_event__update(corto_subscriber_event* _this, corto corto_set_ref(&((corto_subscriber_event*)((corto_subscriber_event*)CORTO_OFFSET(_this, ((corto_type)corto_subscriber_event_o)->size)))->source, source); ((corto_subscriber_event*)((corto_subscriber_event*)CORTO_OFFSET(_this, ((corto_type)corto_subscriber_event_o)->size)))->event = event; if (data) { - corto_ptr_copy(&((corto_subscriber_event*)((corto_subscriber_event*)CORTO_OFFSET(_this, ((corto_type)corto_subscriber_event_o)->size)))->data, corto_result_o, data); + corto_ptr_copy(&((corto_subscriber_event*)((corto_subscriber_event*)CORTO_OFFSET(_this, ((corto_type)corto_subscriber_event_o)->size)))->data, corto_record_o, data); } if (fmt) { corto_ptr_copy(&((corto_subscriber_event*)((corto_subscriber_event*)CORTO_OFFSET(_this, ((corto_type)corto_subscriber_event_o)->size)))->fmt, corto_fmt_data_o, fmt); @@ -1525,7 +1525,7 @@ corto_int16 _corto_subscriber_event__update(corto_subscriber_event* _this, corto corto_set_ref(&((corto_subscriber_event*)_this)->source, source); ((corto_subscriber_event*)_this)->event = event; if (data) { - corto_ptr_copy(&((corto_subscriber_event*)_this)->data, corto_result_o, data); + corto_ptr_copy(&((corto_subscriber_event*)_this)->data, corto_record_o, data); } if (fmt) { corto_ptr_copy(&((corto_subscriber_event*)_this)->fmt, corto_fmt_data_o, fmt); @@ -1540,14 +1540,14 @@ corto_int16 _corto_subscriber_event__update(corto_subscriber_event* _this, corto return 0; } -corto_subscriber_event* _corto_subscriber_event__assign(corto_subscriber_event* _this, corto_subscriber subscriber, corto_object instance, corto_object source, corto_eventMask event, corto_result* data, corto_fmt_data* fmt) { +corto_subscriber_event* _corto_subscriber_event__assign(corto_subscriber_event* _this, corto_subscriber subscriber, corto_object instance, corto_object source, corto_eventMask event, corto_record* data, corto_fmt_data* fmt) { CORTO_UNUSED(_this); corto_set_ref(&((corto_subscriber_event*)_this)->subscriber, subscriber); corto_set_ref(&((corto_subscriber_event*)_this)->instance, instance); corto_set_ref(&((corto_subscriber_event*)_this)->source, source); ((corto_subscriber_event*)_this)->event = event; if (data) { - corto_ptr_copy(&((corto_subscriber_event*)_this)->data, corto_result_o, data); + corto_ptr_copy(&((corto_subscriber_event*)_this)->data, corto_record_o, data); } if (fmt) { corto_ptr_copy(&((corto_subscriber_event*)_this)->fmt, corto_fmt_data_o, fmt); @@ -1687,55 +1687,55 @@ void corto_mount_subscriptionList__clear(corto_mount_subscriptionList list) { corto_ll_clear(list); } -corto_result* corto_resultlist__insert_alloc(corto_resultlist list) { - corto_result* result; - result = (corto_result*)corto_calloc(corto_type_sizeof(corto_type(corto_result_o))); +corto_record* corto_recordlist__insert_alloc(corto_recordlist list) { + corto_record* result; + result = (corto_record*)corto_calloc(corto_type_sizeof(corto_type(corto_record_o))); { - corto_ptr_init(result, corto_result_o); + corto_ptr_init(result, corto_record_o); } corto_ll_insert(list, result); return result; } -corto_result* corto_resultlist__insert(corto_resultlist list, corto_result* element) { - corto_result *result = corto_resultlist__insert_alloc(list); - corto_ptr_copy(result, corto_result_o, element); +corto_record* corto_recordlist__insert(corto_recordlist list, corto_record* element) { + corto_record *result = corto_recordlist__insert_alloc(list); + corto_ptr_copy(result, corto_record_o, element); return result; } -corto_result* corto_resultlist__append_alloc(corto_resultlist list) { - corto_result* result; - result = (corto_result*)corto_calloc(corto_type_sizeof(corto_type(corto_result_o))); +corto_record* corto_recordlist__append_alloc(corto_recordlist list) { + corto_record* result; + result = (corto_record*)corto_calloc(corto_type_sizeof(corto_type(corto_record_o))); { - corto_ptr_init(result, corto_result_o); + corto_ptr_init(result, corto_record_o); } corto_ll_append(list, result); return result; } -corto_result* corto_resultlist__append(corto_resultlist list, corto_result* element) { - corto_result *result = corto_resultlist__append_alloc(list); - corto_ptr_copy(result, corto_result_o, element); +corto_record* corto_recordlist__append(corto_recordlist list, corto_record* element) { + corto_record *result = corto_recordlist__append_alloc(list); + corto_ptr_copy(result, corto_record_o, element); return result; } -corto_result* corto_resultlist__takeFirst(corto_resultlist list) { - return (corto_result*)(corto_word)corto_ll_takeFirst(list); +corto_record* corto_recordlist__takeFirst(corto_recordlist list) { + return (corto_record*)(corto_word)corto_ll_takeFirst(list); } -corto_result* corto_resultlist__last(corto_resultlist list) { - return (corto_result*)(corto_word)corto_ll_last(list); +corto_record* corto_recordlist__last(corto_recordlist list) { + return (corto_record*)(corto_word)corto_ll_last(list); } -corto_result* corto_resultlist__get(corto_resultlist list, corto_uint32 index) { - return (corto_result*)corto_ll_get(list, index); +corto_record* corto_recordlist__get(corto_recordlist list, corto_uint32 index) { + return (corto_record*)corto_ll_get(list, index); } -void corto_resultlist__clear(corto_resultlist list) { +void corto_recordlist__clear(corto_recordlist list) { corto_iter iter = corto_ll_iter(list); while(corto_iter_hasNext(&iter)) { void *ptr = corto_iter_next(&iter); - corto_ptr_deinit(ptr, corto_result_o); + corto_ptr_deinit(ptr, corto_record_o); corto_dealloc(ptr); } corto_ll_clear(list); diff --git a/include/lang/_load.h b/include/lang/_load.h index d58c5d91..72d3b446 100644 --- a/include/lang/_load.h +++ b/include/lang/_load.h @@ -116,7 +116,7 @@ CORTO_META_OBJECT(sequence, interfaceseq); CORTO_META_OBJECT(sequence, stringseq); CORTO_META_OBJECT(sequence, int32seq); CORTO_META_OBJECT(sequence, wordseq); -CORTO_META_OBJECT(list, resultList); +CORTO_META_OBJECT(list, recordList); CORTO_META_OBJECT(list, objectlist); CORTO_META_OBJECT(list, taglist); CORTO_META_OBJECT(list, stringlist); diff --git a/include/store/fmt.h b/include/store/fmt.h index 932f5a51..76d1397a 100644 --- a/include/store/fmt.h +++ b/include/store/fmt.h @@ -138,13 +138,13 @@ CORTO_EXPORT void* corto_fmt_from_result( corto_fmt fmt, corto_fmt_opt *opt, - corto_result *result); + corto_record *result); CORTO_EXPORT int16_t corto_fmt_to_result( corto_fmt fmt, corto_fmt_opt *opt, - corto_result *result, + corto_record *result, const void *data); CORTO_EXPORT diff --git a/include/vstore/_binding.h b/include/vstore/_binding.h index ec44948f..753a0b42 100644 --- a/include/vstore/_binding.h +++ b/include/vstore/_binding.h @@ -28,12 +28,12 @@ #define corto_observer_event(o) ((corto_observer_event*)corto_assert_type((corto_type)corto_observer_event_o, o)) #define corto_operatorKind(o) ((corto_operatorKind*)corto_assert_type((corto_type)corto_operatorKind_o, o)) #define corto_remote(o) ((corto_remote)corto_assert_type((corto_type)corto_remote_o, o)) -#define corto_resultMask(o) ((corto_resultMask*)corto_assert_type((corto_type)corto_resultMask_o, o)) +#define corto_recordMask(o) ((corto_recordMask*)corto_assert_type((corto_type)corto_recordMask_o, o)) #define corto_sample(o) ((corto_sample*)corto_assert_type((corto_type)corto_sample_o, o)) #define corto_sampleIter(o) ((corto_sampleIter*)corto_assert_type((corto_type)corto_sampleIter_o, o)) -#define corto_result(o) ((corto_result*)corto_assert_type((corto_type)corto_result_o, o)) -#define corto_resultIter(o) ((corto_resultIter*)corto_assert_type((corto_type)corto_resultIter_o, o)) -#define corto_resultlist(o) ((corto_resultlist*)corto_assert_type((corto_type)corto_resultlist_o, o)) +#define corto_record(o) ((corto_record*)corto_assert_type((corto_type)corto_record_o, o)) +#define corto_recordIter(o) ((corto_recordIter*)corto_assert_type((corto_type)corto_recordIter_o, o)) +#define corto_recordlist(o) ((corto_recordlist*)corto_assert_type((corto_type)corto_recordlist_o, o)) #define corto_route(o) ((corto_route)corto_assert_type((corto_type)corto_route_o, o)) #define corto_router(o) ((corto_router)corto_assert_type((corto_type)corto_router_o, o)) #define corto_routerimpl(o) ((corto_routerimpl)corto_assert_type((corto_type)corto_routerimpl_o, o)) @@ -63,12 +63,12 @@ typedef corto_objectIter _type_corto_objectIter; typedef corto_observer_event _type_corto_observer_event; typedef corto_operatorKind _type_corto_operatorKind; typedef corto_remote _type_corto_remote; -typedef corto_resultMask _type_corto_resultMask; +typedef corto_recordMask _type_corto_recordMask; typedef corto_sample _type_corto_sample; typedef corto_sampleIter _type_corto_sampleIter; -typedef corto_result _type_corto_result; -typedef corto_resultIter _type_corto_resultIter; -typedef corto_resultlist _type_corto_resultlist; +typedef corto_record _type_corto_record; +typedef corto_recordIter _type_corto_recordIter; +typedef corto_recordlist _type_corto_recordlist; typedef corto_route _type_corto_route; typedef corto_router _type_corto_router; typedef corto_routerimpl _type_corto_routerimpl; @@ -128,9 +128,9 @@ typedef corto_subscriber_eventIter _type_corto_subscriber_eventIter; #define corto_observer_event_init(_this) _corto_observer_event_init(_this) #define corto_query_cardinality(_this) _corto_query_cardinality(_this) #define corto_query_match(_this, result) _corto_query_match(_this, result) -#define corto_result_contentof(_this, format) _corto_result_contentof(_this, format) -#define corto_result_fromcontent(_this, format, content) _corto_result_fromcontent(_this, format, content) -#define corto_result_get_text(_this) _corto_result_get_text(_this) +#define corto_record_contentof(_this, format) _corto_record_contentof(_this, format) +#define corto_record_fromcontent(_this, format, content) _corto_record_fromcontent(_this, format, content) +#define corto_record_get_text(_this) _corto_record_get_text(_this) #define corto_route_construct(_this) _corto_route_construct(corto_route(_this)) #define corto_route_init(_this) _corto_route_init(corto_route(_this)) #define corto_router_construct(_this) _corto_router_construct(corto_router(_this)) @@ -204,9 +204,9 @@ typedef corto_subscriber_eventIter _type_corto_subscriber_eventIter; #define corto_observer_event_init _corto_observer_event_init #define corto_query_cardinality _corto_query_cardinality #define corto_query_match _corto_query_match -#define corto_result_contentof _corto_result_contentof -#define corto_result_fromcontent _corto_result_fromcontent -#define corto_result_get_text _corto_result_get_text +#define corto_record_contentof _corto_record_contentof +#define corto_record_fromcontent _corto_record_fromcontent +#define corto_record_get_text _corto_record_get_text #define corto_route_construct _corto_route_construct #define corto_route_init _corto_route_init #define corto_router_construct _corto_router_construct @@ -278,9 +278,9 @@ typedef corto_subscriber_eventIter _type_corto_subscriber_eventIter; #define safe_corto_observer_event_init(_this) _corto_observer_event_init(_this) #define safe_corto_query_cardinality(_this) _corto_query_cardinality(_this) #define safe_corto_query_match(_this, result) _corto_query_match(_this, result) -#define safe_corto_result_contentof(_this, format) _corto_result_contentof(_this, format) -#define safe_corto_result_fromcontent(_this, format, content) _corto_result_fromcontent(_this, format, content) -#define safe_corto_result_get_text(_this) _corto_result_get_text(_this) +#define safe_corto_record_contentof(_this, format) _corto_record_contentof(_this, format) +#define safe_corto_record_fromcontent(_this, format, content) _corto_record_fromcontent(_this, format, content) +#define safe_corto_record_get_text(_this) _corto_record_get_text(_this) #define safe_corto_route_construct(_this) _corto_route_construct(corto_route(_this)) #define safe_corto_route_init(_this) _corto_route_init(corto_route(_this)) #define safe_corto_router_construct(_this) _corto_router_construct(corto_router(_this)) @@ -311,8 +311,8 @@ typedef corto_subscriber_eventIter _type_corto_subscriber_eventIter; ) #define corto_loader_on_query(_this, query) ( \ ((corto_function)corto_loader_on_query_o)->kind == CORTO_PROCEDURE_CDECL \ - ? ((_type_corto_resultIter (*)(corto_object, corto_query *))((corto_function)((corto_interface)corto_typeof(_this))->methods.buffer[((corto_method)corto_loader_on_query_o)->index - 1])->fptr)(corto_loader(_this), query) \ - : *(corto_resultIter*)corto_invoke(((corto_interface)corto_typeof(_this))->methods.buffer[((corto_method)corto_loader_on_query_o)->index - 1], alloca(sizeof(corto_resultIter)), corto_loader(_this), query) \ + ? ((_type_corto_recordIter (*)(corto_object, corto_query *))((corto_function)((corto_interface)corto_typeof(_this))->methods.buffer[((corto_method)corto_loader_on_query_o)->index - 1])->fptr)(corto_loader(_this), query) \ + : *(corto_recordIter*)corto_invoke(((corto_interface)corto_typeof(_this))->methods.buffer[((corto_method)corto_loader_on_query_o)->index - 1], alloca(sizeof(corto_recordIter)), corto_loader(_this), query) \ ) #define corto_mount_on_batch_notify(_this, event_count, events) ( \ ((corto_function)corto_mount_on_batch_notify_o)->kind == CORTO_PROCEDURE_CDECL \ @@ -326,8 +326,8 @@ typedef corto_subscriber_eventIter _type_corto_subscriber_eventIter; ) #define corto_mount_on_history_query(_this, query) ( \ ((corto_function)corto_mount_on_history_query_o)->kind == CORTO_PROCEDURE_CDECL \ - ? ((_type_corto_resultIter (*)(corto_object, corto_query *))((corto_function)((corto_interface)corto_typeof(_this))->methods.buffer[((corto_method)corto_mount_on_history_query_o)->index - 1])->fptr)(corto_mount(_this), query) \ - : *(corto_resultIter*)corto_invoke(((corto_interface)corto_typeof(_this))->methods.buffer[((corto_method)corto_mount_on_history_query_o)->index - 1], alloca(sizeof(corto_resultIter)), corto_mount(_this), query) \ + ? ((_type_corto_recordIter (*)(corto_object, corto_query *))((corto_function)((corto_interface)corto_typeof(_this))->methods.buffer[((corto_method)corto_mount_on_history_query_o)->index - 1])->fptr)(corto_mount(_this), query) \ + : *(corto_recordIter*)corto_invoke(((corto_interface)corto_typeof(_this))->methods.buffer[((corto_method)corto_mount_on_history_query_o)->index - 1], alloca(sizeof(corto_recordIter)), corto_mount(_this), query) \ ) #define corto_mount_on_id(_this) ( \ ((corto_function)corto_mount_on_id_o)->kind == CORTO_PROCEDURE_CDECL \ @@ -351,8 +351,8 @@ typedef corto_subscriber_eventIter _type_corto_subscriber_eventIter; ) #define corto_mount_on_query(_this, query) ( \ ((corto_function)corto_mount_on_query_o)->kind == CORTO_PROCEDURE_CDECL \ - ? ((_type_corto_resultIter (*)(corto_object, corto_query *))((corto_function)((corto_interface)corto_typeof(_this))->methods.buffer[((corto_method)corto_mount_on_query_o)->index - 1])->fptr)(corto_mount(_this), query) \ - : *(corto_resultIter*)corto_invoke(((corto_interface)corto_typeof(_this))->methods.buffer[((corto_method)corto_mount_on_query_o)->index - 1], alloca(sizeof(corto_resultIter)), corto_mount(_this), query) \ + ? ((_type_corto_recordIter (*)(corto_object, corto_query *))((corto_function)((corto_interface)corto_typeof(_this))->methods.buffer[((corto_method)corto_mount_on_query_o)->index - 1])->fptr)(corto_mount(_this), query) \ + : *(corto_recordIter*)corto_invoke(((corto_interface)corto_typeof(_this))->methods.buffer[((corto_method)corto_mount_on_query_o)->index - 1], alloca(sizeof(corto_recordIter)), corto_mount(_this), query) \ ) #define corto_mount_on_resume(_this, parent, id, object) ( \ ((corto_function)corto_mount_on_resume_o)->kind == CORTO_PROCEDURE_CDECL \ diff --git a/include/vstore/_interface.h b/include/vstore/_interface.h index dc4bbf71..4fe871d1 100644 --- a/include/vstore/_interface.h +++ b/include/vstore/_interface.h @@ -61,7 +61,7 @@ void _corto_loader_destruct( corto_loader _this); CORTO_EXPORT -corto_resultIter _corto_loader_on_query_v( +corto_recordIter _corto_loader_on_query_v( corto_loader _this, corto_query *query); @@ -84,7 +84,7 @@ void _corto_mount_destruct( corto_mount _this); CORTO_EXPORT -corto_resultIter _corto_mount_historyQuery( +corto_recordIter _corto_mount_historyQuery( corto_mount _this, corto_query *query); @@ -116,7 +116,7 @@ void _corto_mount_on_history_batch_notify_v( corto_subscriber_eventIter events); CORTO_EXPORT -corto_resultIter _corto_mount_on_history_query_v( +corto_recordIter _corto_mount_on_history_query_v( corto_mount _this, corto_query *query); @@ -143,7 +143,7 @@ void _corto_mount_on_notify_v( corto_subscriber_event *event); CORTO_EXPORT -corto_resultIter _corto_mount_on_query_v( +corto_recordIter _corto_mount_on_query_v( corto_mount _this, corto_query *query); @@ -201,7 +201,7 @@ void _corto_mount_publish( uintptr_t value); CORTO_EXPORT -corto_resultIter _corto_mount_query( +corto_recordIter _corto_mount_query( corto_mount _this, corto_query *query); @@ -215,7 +215,7 @@ int16_t _corto_mount_resume( CORTO_EXPORT void _corto_mount_return( corto_mount _this, - corto_result *r); + corto_record *r); CORTO_EXPORT int16_t _corto_mount_set_format( @@ -300,25 +300,25 @@ uint32_t _corto_query_cardinality( CORTO_EXPORT bool _corto_query_match( corto_query* _this, - corto_result *result); + corto_record *result); -/* struct corto/vstore/result */ +/* struct corto/vstore/record */ CORTO_EXPORT -corto_string _corto_result_contentof( - corto_result* _this, +corto_string _corto_record_contentof( + corto_record* _this, const char *format); CORTO_EXPORT -int16_t _corto_result_fromcontent( - corto_result* _this, +int16_t _corto_record_fromcontent( + corto_record* _this, const char *format, const char *content); CORTO_EXPORT -corto_string _corto_result_get_text( - corto_result* _this); +corto_string _corto_record_get_text( + corto_record* _this); /* procedure corto/vstore/route */ diff --git a/include/vstore/_load.h b/include/vstore/_load.h index 091af7fe..28192656 100644 --- a/include/vstore/_load.h +++ b/include/vstore/_load.h @@ -29,7 +29,7 @@ CORTO_META_OBJECT(class, mount); CORTO_META_OBJECT(struct, mount_policy); CORTO_META_OBJECT(struct, mount_subscription); CORTO_META_OBJECT(class, loader); -CORTO_META_OBJECT(struct, result); +CORTO_META_OBJECT(struct, record); CORTO_META_OBJECT(struct, request); CORTO_META_OBJECT(struct, frame); CORTO_META_OBJECT(struct, query); @@ -38,12 +38,12 @@ CORTO_META_OBJECT(interface, dispatcher); CORTO_META_OBJECT(enum, equalityKind); CORTO_META_OBJECT(enum, operatorKind); CORTO_META_OBJECT(bitmask, eventMask); -CORTO_META_OBJECT(bitmask, resultMask); +CORTO_META_OBJECT(bitmask, recordMask); CORTO_META_OBJECT(enum, ownership); CORTO_META_OBJECT(bitmask, mountCallbackMask); CORTO_META_OBJECT(enum, frameKind); -CORTO_META_OBJECT(list, resultlist); +CORTO_META_OBJECT(list, recordlist); CORTO_META_OBJECT(list, mount_subscriptionList); CORTO_META_OBJECT(sequence, augmentseq); @@ -65,7 +65,7 @@ CORTO_META_OBJECT(struct, subscriber_event); CORTO_META_OBJECT(struct, invoke_event); CORTO_META_OBJECT(struct, time); -CORTO_META_OBJECT(iterator, resultIter); +CORTO_META_OBJECT(iterator, recordIter); CORTO_META_OBJECT(iterator, sampleIter); CORTO_META_OBJECT(iterator, subscriber_eventIter); diff --git a/include/vstore/_type.h b/include/vstore/_type.h index ab279627..ff815d64 100644 --- a/include/vstore/_type.h +++ b/include/vstore/_type.h @@ -157,7 +157,7 @@ typedef struct corto_mount_s { double sample_rate; uint32_t queue_max; uint64_t expiry_time; - bool filter_results; + bool filter_records; corto_mount_subscriptionList subscriptions; corto_objectlist events; corto_objectlist historicalEvents; @@ -246,8 +246,8 @@ typedef struct corto_remote_s { struct corto_method_s super; } *corto_remote; -/* bitmask corto/vstore/resultMask */ -typedef uint32_t corto_resultMask; +/* bitmask corto/vstore/recordMask */ +typedef uint32_t corto_recordMask; #define CORTO_RESULT_LEAF (0x1) #define CORTO_RESULT_HIDDEN (0x2) @@ -259,24 +259,24 @@ typedef struct corto_sample { typedef corto_iter corto_sampleIter; -/* struct corto/vstore/result */ -typedef struct corto_result { +/* struct corto/vstore/record */ +typedef struct corto_record { corto_string id; corto_string name; corto_string parent; corto_string type; uintptr_t value; - corto_resultMask flags; + corto_recordMask flags; corto_object object; corto_sampleIter history; corto_object owner; -} corto_result; +} corto_record; -typedef corto_iter corto_resultIter; +typedef corto_iter corto_recordIter; -#ifndef corto_resultlist_DEFINED -#define corto_resultlist_DEFINED -typedef corto_ll corto_resultlist; +#ifndef corto_recordlist_DEFINED +#define corto_recordlist_DEFINED +typedef corto_ll corto_recordlist; #endif /* procedure corto/vstore/route */ @@ -311,7 +311,7 @@ typedef struct corto_subscriber_event { corto_object instance; corto_object source; corto_eventMask event; - corto_result data; + corto_record data; corto_fmt_data fmt; } corto_subscriber_event; diff --git a/include/vstore/vstore.h b/include/vstore/vstore.h index d96c05b5..78e17c21 100644 --- a/include/vstore/vstore.h +++ b/include/vstore/vstore.h @@ -219,7 +219,7 @@ typedef struct corto_select__fluent { struct corto_select__fluent (*yield_unknown)(); /** Return an iterator to the requested results. - * Results are returned as corto_result instances. A corto_result contains + * Results are returned as corto_record instances. A corto_record contains * metadata and when a content type is specified, a serialized value of an * object. When using this function, no objects are created. * @@ -227,7 +227,7 @@ typedef struct corto_select__fluent { * @return 0 if success, -1 if failed. */ int16_t (*iter)( - corto_resultIter *iter_out); + corto_recordIter *iter_out); /** Resume objects into the object store. * This function will resume objects in the object store. @@ -258,7 +258,7 @@ typedef struct corto_select__fluent { struct corto_select__fluent (*vstore)( bool enable); /* Unstable API */ - int16_t (*subscribe)(corto_resultIter *ret); /* Unstable API */ + int16_t (*subscribe)(corto_recordIter *ret); /* Unstable API */ int16_t (*unsubscribe)(void); /* Unstable API */ char* (*id)(void); /* Unstable API */ } corto_select__fluent; @@ -386,7 +386,7 @@ typedef struct corto_subscribe__fluent { * data events (`DEFINE`, `UPDATE`, `DELETE`). * * The difference between subscribers and observers is that while observers - * provide a reference to an object, a subscriber returns a `corto_result`, which + * provide a reference to an object, a subscriber returns a `corto_record`, which * contains metadata about the object, and when requested, a serialized value. * * This means that a subscriber does not require objects to be stored in the diff --git a/src/store/bootstrap.c b/src/store/bootstrap.c index d767deb9..cd5994ca 100644 --- a/src/store/bootstrap.c +++ b/src/store/bootstrap.c @@ -168,7 +168,7 @@ corto_object home_o = NULL; BUILTIN_VALUE(,secure_actionKind),\ BUILTIN_VALUE(lang_, modifierMask),\ BUILTIN_VALUE(vstore_, eventMask),\ - BUILTIN_VALUE(vstore_, resultMask),\ + BUILTIN_VALUE(vstore_, recordMask),\ BUILTIN_VALUE(lang_, state),\ BUILTIN_VALUE(lang_, attr),\ BUILTIN_VALUE(lang_, int32seq),\ @@ -182,7 +182,7 @@ corto_object home_o = NULL; BUILTIN_VALUE(lang_, objectlist),\ BUILTIN_VALUE(lang_, taglist),\ BUILTIN_VALUE(lang_, stringlist),\ - BUILTIN_VALUE(vstore_, resultlist),\ + BUILTIN_VALUE(vstore_, recordlist),\ BUILTIN_VALUE(vstore_, mount_subscriptionList),\ BUILTIN_VALUE(lang_, parameter),\ BUILTIN_VALUE(vstore_, time),\ @@ -190,14 +190,14 @@ corto_object home_o = NULL; BUILTIN_VALUE(vstore_, sample),\ BUILTIN_VALUE(vstore_, sampleIter),\ BUILTIN_VALUE(vstore_, subscriber_eventIter),\ - BUILTIN_VALUE(vstore_, result),\ + BUILTIN_VALUE(vstore_, record),\ BUILTIN_VALUE(lang_, delegatedata),\ BUILTIN_VOID(vstore_, dispatcher),\ BUILTIN_VALUE(lang_, pre_action),\ BUILTIN_VALUE(lang_, name_action),\ BUILTIN_VALUE(lang_, post_action),\ BUILTIN_VALUE(vstore_, handleAction),\ - BUILTIN_VALUE(vstore_, resultIter),\ + BUILTIN_VALUE(vstore_, recordIter),\ BUILTIN_VALUE(vstore_, objectIter),\ BUILTIN_VALUE(vstore_, query),\ BUILTIN_VALUE(vstore_, mount_subscription),\ @@ -494,9 +494,9 @@ corto_object home_o = NULL; BUILTIN_OBJ(lang_modifierMask_OPTIONAL),\ BUILTIN_OBJ(lang_modifierMask_OBSERVABLE),\ BUILTIN_OBJ(lang_modifierMask_KEY),\ - /* resultMask */\ - BUILTIN_OBJ(vstore_resultMask_RESULT_LEAF),\ - BUILTIN_OBJ(vstore_resultMask_RESULT_HIDDEN),\ + /* recordMask */\ + BUILTIN_OBJ(vstore_recordMask_RESULT_LEAF),\ + BUILTIN_OBJ(vstore_recordMask_RESULT_HIDDEN),\ /* type */\ BUILTIN_OBJ(lang_type_kind),\ BUILTIN_OBJ(lang_type_reference),\ @@ -706,7 +706,7 @@ corto_object home_o = NULL; BUILTIN_OBJ(vstore_mount_sample_rate),\ BUILTIN_OBJ(vstore_mount_queue_max),\ BUILTIN_OBJ(vstore_mount_expiry_time),\ - BUILTIN_OBJ(vstore_mount_filter_results),\ + BUILTIN_OBJ(vstore_mount_filter_records),\ BUILTIN_OBJ(vstore_mount_subscriptions),\ BUILTIN_OBJ(vstore_mount_events),\ BUILTIN_OBJ(vstore_mount_historicalEvents),\ @@ -832,19 +832,19 @@ corto_object home_o = NULL; /* sample */\ BUILTIN_OBJ(vstore_sample_timestamp),\ BUILTIN_OBJ(vstore_sample_value),\ - /* result */\ - BUILTIN_OBJ(vstore_result_id),\ - BUILTIN_OBJ(vstore_result_name),\ - BUILTIN_OBJ(vstore_result_parent),\ - BUILTIN_OBJ(vstore_result_type),\ - BUILTIN_OBJ(vstore_result_value),\ - BUILTIN_OBJ(vstore_result_flags),\ - BUILTIN_OBJ(vstore_result_object),\ - BUILTIN_OBJ(vstore_result_history),\ - BUILTIN_OBJ(vstore_result_owner),\ - BUILTIN_OBJ(vstore_result_get_text_),\ - BUILTIN_OBJ(vstore_result_fromcontent_),\ - BUILTIN_OBJ(vstore_result_contentof_),\ + /* record */\ + BUILTIN_OBJ(vstore_record_id),\ + BUILTIN_OBJ(vstore_record_name),\ + BUILTIN_OBJ(vstore_record_parent),\ + BUILTIN_OBJ(vstore_record_type),\ + BUILTIN_OBJ(vstore_record_value),\ + BUILTIN_OBJ(vstore_record_flags),\ + BUILTIN_OBJ(vstore_record_object),\ + BUILTIN_OBJ(vstore_record_history),\ + BUILTIN_OBJ(vstore_record_owner),\ + BUILTIN_OBJ(vstore_record_get_text_),\ + BUILTIN_OBJ(vstore_record_fromcontent_),\ + BUILTIN_OBJ(vstore_record_contentof_),\ /* package */\ BUILTIN_OBJ(lang_package_description),\ BUILTIN_OBJ(lang_package_version),\ diff --git a/src/store/bootstrap.h b/src/store/bootstrap.h index df234390..6c14f226 100644 --- a/src/store/bootstrap.h +++ b/src/store/bootstrap.h @@ -506,7 +506,7 @@ CORTO_FWDECL_VSTORE(struct, frame); CORTO_FWDECL_VSTORE(struct, query); CORTO_FWDECL_VSTORE(struct, mount_subscription); CORTO_FWDECL_VSTORE(struct, observer_event); -CORTO_FWDECL_VSTORE(struct, result); +CORTO_FWDECL_VSTORE(struct, record); CORTO_FWDECL_VSTORE(struct, sample); CORTO_FWDECL_VSTORE(struct, subscriber_event); @@ -569,7 +569,7 @@ CORTO_FWDECL(bitmask, attr); CORTO_FWDECL_VSTORE(bitmask, eventMask); CORTO_FWDECL(bitmask, modifierMask); CORTO_FWDECL_VSTORE(bitmask, mountCallbackMask); -CORTO_FWDECL_VSTORE(bitmask, resultMask); +CORTO_FWDECL_VSTORE(bitmask, recordMask); CORTO_FWDECL(bitmask, state); /* Sequences */ @@ -582,7 +582,7 @@ CORTO_FWDECL(sequence, stringseq); CORTO_FWDECL(sequence, wordseq); /* Lists */ -CORTO_FWDECL_VSTORE(list, resultlist); +CORTO_FWDECL_VSTORE(list, recordlist); CORTO_FWDECL(list, objectlist); CORTO_FWDECL(list, taglist); CORTO_FWDECL(list, stringlist); @@ -595,7 +595,7 @@ CORTO_FWDECL(delegate, name_action); CORTO_FWDECL_VSTORE(delegate, handleAction); /* Iterators */ -CORTO_FWDECL_VSTORE(iterator, resultIter); +CORTO_FWDECL_VSTORE(iterator, recordIter); CORTO_FWDECL_VSTORE(iterator, subscriber_eventIter); CORTO_FWDECL_VSTORE(iterator, objectIter); CORTO_FWDECL_VSTORE(iterator, sampleIter); @@ -866,9 +866,9 @@ CORTO_BITMASK_O(lang, modifierMask); CORTO_CONSTANT_O(lang_modifierMask, OBSERVABLE); CORTO_CONSTANT_O(lang_modifierMask, KEY); -CORTO_BITMASK_O(vstore, resultMask); - CORTO_CONSTANT_O(vstore_resultMask, RESULT_LEAF); - CORTO_CONSTANT_O(vstore_resultMask, RESULT_HIDDEN); +CORTO_BITMASK_O(vstore, recordMask); + CORTO_CONSTANT_O(vstore_recordMask, RESULT_LEAF); + CORTO_CONSTANT_O(vstore_recordMask, RESULT_HIDDEN); /* Collections */ CORTO_SEQUENCE_O(lang, interfaceseq, lang_interface, 0); @@ -881,7 +881,7 @@ CORTO_SEQUENCE_O(lang, wordseq, lang_word, 0); CORTO_LIST_O(lang, stringlist, lang_string, 0); CORTO_LIST_O(lang, objectlist, lang_object, 0); CORTO_LIST_O(lang, taglist, lang_tag, 0); -CORTO_LIST_O(vstore, resultlist, vstore_result, 0); +CORTO_LIST_O(vstore, recordlist, vstore_record, 0); CORTO_LIST_O(vstore, mount_subscriptionList, vstore_mount_subscription, 0); /* Delegate types */ @@ -892,7 +892,7 @@ CORTO_DELEGATE_O(vstore, handleAction, lang_void); /* Iterator types */ CORTO_ITERATOR_O(vstore, objectIter, lang_object); -CORTO_ITERATOR_O(vstore, resultIter, vstore_result); +CORTO_ITERATOR_O(vstore, recordIter, vstore_record); CORTO_ITERATOR_O(vstore, subscriber_eventIter, vstore_subscriber_event); CORTO_ITERATOR_O(vstore, sampleIter, vstore_sample); @@ -1266,20 +1266,20 @@ CORTO_STRUCT_O(vstore, sample, NULL, CORTO_DECLARED | CORTO_VALID, NULL, NULL, C CORTO_MEMBER_O(vstore_sample, timestamp, vstore_time, CORTO_GLOBAL); CORTO_MEMBER_O(vstore_sample, value, lang_word, CORTO_GLOBAL); -/* /corto/vstore/result */ -CORTO_STRUCT_O(vstore, result, NULL, CORTO_DECLARED | CORTO_VALID, NULL, NULL, CORTO_NODELEGATE); - CORTO_MEMBER_O(vstore_result, id, lang_string, CORTO_GLOBAL); - CORTO_MEMBER_O(vstore_result, name, lang_string, CORTO_GLOBAL); - CORTO_MEMBER_O(vstore_result, parent, lang_string, CORTO_GLOBAL); - CORTO_MEMBER_O(vstore_result, type, lang_string, CORTO_GLOBAL); - CORTO_MEMBER_O(vstore_result, value, lang_word, CORTO_GLOBAL); - CORTO_MEMBER_O(vstore_result, flags, vstore_resultMask, CORTO_GLOBAL); - CORTO_MEMBER_O(vstore_result, object, lang_object, CORTO_HIDDEN); - CORTO_MEMBER_O(vstore_result, history, vstore_sampleIter, CORTO_HIDDEN); - CORTO_MEMBER_O(vstore_result, owner, lang_object, CORTO_HIDDEN); - CORTO_METHOD_O(vstore_result, get_text, "()", lang_string, corto_result_get_text); - CORTO_METHOD_O(vstore_result, fromcontent, "(string format,string content)", lang_int16, corto_result_fromcontent); - CORTO_METHOD_O(vstore_result, contentof, "(string format)", lang_string, corto_result_contentof); +/* /corto/vstore/record */ +CORTO_STRUCT_O(vstore, record, NULL, CORTO_DECLARED | CORTO_VALID, NULL, NULL, CORTO_NODELEGATE); + CORTO_MEMBER_O(vstore_record, id, lang_string, CORTO_GLOBAL); + CORTO_MEMBER_O(vstore_record, name, lang_string, CORTO_GLOBAL); + CORTO_MEMBER_O(vstore_record, parent, lang_string, CORTO_GLOBAL); + CORTO_MEMBER_O(vstore_record, type, lang_string, CORTO_GLOBAL); + CORTO_MEMBER_O(vstore_record, value, lang_word, CORTO_GLOBAL); + CORTO_MEMBER_O(vstore_record, flags, vstore_recordMask, CORTO_GLOBAL); + CORTO_MEMBER_O(vstore_record, object, lang_object, CORTO_HIDDEN); + CORTO_MEMBER_O(vstore_record, history, vstore_sampleIter, CORTO_HIDDEN); + CORTO_MEMBER_O(vstore_record, owner, lang_object, CORTO_HIDDEN); + CORTO_METHOD_O(vstore_record, get_text, "()", lang_string, corto_record_get_text); + CORTO_METHOD_O(vstore_record, fromcontent, "(string format,string content)", lang_int16, corto_record_fromcontent); + CORTO_METHOD_O(vstore_record, contentof, "(string format)", lang_string, corto_record_contentof); /* /corto/vstore/dispatcher */ CORTO_INTERFACE_O(vstore, dispatcher); @@ -1318,7 +1318,7 @@ CORTO_STRUCT_BASE_O(vstore, subscriber_event, vstore_event, 0, NULL, CORTO_DECLA CORTO_REFERENCE_O(vstore_subscriber_event, instance, lang_object, CORTO_GLOBAL, CORTO_VALID | CORTO_DECLARED, NULL); CORTO_REFERENCE_O(vstore_subscriber_event, source, lang_object, CORTO_GLOBAL, CORTO_VALID | CORTO_DECLARED, NULL); CORTO_MEMBER_O(vstore_subscriber_event, event, vstore_eventMask, CORTO_GLOBAL); - CORTO_MEMBER_O(vstore_subscriber_event, data, vstore_result, CORTO_GLOBAL); + CORTO_MEMBER_O(vstore_subscriber_event, data, vstore_record, CORTO_GLOBAL); CORTO_MEMBER_O(vstore_subscriber_event, fmt, vstore_fmt_data, CORTO_GLOBAL); CORTO_FUNCTION_O(vstore_subscriber_event, handle, "(vstore/event e)", lang_void, corto_subscriber_event_handle); CORTO_METHOD_O(vstore_subscriber_event, init, "()", lang_int16, corto_subscriber_event_init); @@ -1369,7 +1369,7 @@ CORTO_STRUCT_O(vstore, query, NULL, CORTO_DECLARED | CORTO_VALID, NULL, NULL, CO CORTO_MEMBER_O(vstore_query, content, lang_bool, CORTO_GLOBAL|CORTO_HIDDEN); CORTO_MEMBER_O(vstore_query, yield_unknown, lang_bool, CORTO_GLOBAL|CORTO_HIDDEN); CORTO_METHOD_O(vstore_query, cardinality, "()", lang_uint32, corto_query_cardinality); - CORTO_METHOD_O(vstore_query, match, "(vstore/result result)", lang_bool, corto_query_cardinality); + CORTO_METHOD_O(vstore_query, match, "(vstore/record record)", lang_bool, corto_query_cardinality); /* /corto/vstore/subscriber */ CORTO_FW_IFCDE(vstore, subscriber); @@ -1410,7 +1410,7 @@ CORTO_CLASS_O(vstore, mount, vstore_subscriber, CORTO_HIDDEN, CORTO_ATTR_DEFAULT CORTO_MEMBER_O(vstore_mount, sample_rate, lang_float64, CORTO_GLOBAL | CORTO_HIDDEN); CORTO_MEMBER_O(vstore_mount, queue_max, lang_uint32, CORTO_GLOBAL | CORTO_HIDDEN); CORTO_MEMBER_O(vstore_mount, expiry_time, lang_uint64, CORTO_GLOBAL | CORTO_HIDDEN); - CORTO_MEMBER_O(vstore_mount, filter_results, lang_bool, CORTO_GLOBAL | CORTO_HIDDEN); + CORTO_MEMBER_O(vstore_mount, filter_records, lang_bool, CORTO_GLOBAL | CORTO_HIDDEN); /* Readonly members */ CORTO_MEMBER_O(vstore_mount, subscriptions, vstore_mount_subscriptionList, CORTO_READONLY); @@ -1439,12 +1439,12 @@ CORTO_CLASS_O(vstore, mount, vstore_subscriber, CORTO_HIDDEN, CORTO_ATTR_DEFAULT CORTO_METHOD_O(vstore_mount, set_format, "(string type)", lang_int16, corto_mount_set_format); CORTO_METHOD_O(vstore_mount, set_formatIn, "(string type)", lang_int16, corto_mount_set_formatIn); CORTO_METHOD_O(vstore_mount, set_formatOut, "(string type)", lang_int16, corto_mount_set_formatOut); - CORTO_METHOD_O(vstore_mount, return, "(vstore/result r)", lang_void, corto_mount_return); + CORTO_METHOD_O(vstore_mount, return, "(vstore/record r)", lang_void, corto_mount_return); CORTO_METHOD_O(vstore_mount, publish, "(vstore/eventMask event,string from,string id,string type,word value)", lang_void, corto_mount_unsubscribe); CORTO_METHOD_O(vstore_mount, invoke, "(object instance,function proc,word argptrs)", lang_void, corto_mount_invoke); CORTO_METHOD_O(vstore_mount, id, "()", lang_string, corto_mount_id); - CORTO_METHOD_O(vstore_mount, query, "(vstore/query query)", vstore_resultIter, corto_mount_query); - CORTO_METHOD_O(vstore_mount, historyQuery, "(vstore/query query)", vstore_resultIter, corto_mount_query); + CORTO_METHOD_O(vstore_mount, query, "(vstore/query query)", vstore_recordIter, corto_mount_query); + CORTO_METHOD_O(vstore_mount, historyQuery, "(vstore/query query)", vstore_recordIter, corto_mount_query); CORTO_METHOD_O(vstore_mount, resume, "(string parent,string id,inout:object o_out)", lang_int16, corto_mount_resume); CORTO_METHOD_O(vstore_mount, subscribe, "(/corto/vstore/query query)", lang_void, corto_mount_subscribe); CORTO_METHOD_O(vstore_mount, unsubscribe, "(/corto/vstore/query query)", lang_void, corto_mount_unsubscribe); @@ -1452,8 +1452,8 @@ CORTO_CLASS_O(vstore, mount, vstore_subscriber, CORTO_HIDDEN, CORTO_ATTR_DEFAULT /* Overridable methods */ CORTO_OVERRIDABLE_O(vstore_mount, on_invoke, "(object instance,function proc,word argptrs)", lang_void, corto_mount_on_invoke_v); CORTO_OVERRIDABLE_O(vstore_mount, on_id, "()", lang_string, corto_mount_on_id_v); - CORTO_OVERRIDABLE_O(vstore_mount, on_query, "(/corto/vstore/query query)", vstore_resultIter, corto_mount_on_query_v); - CORTO_OVERRIDABLE_O(vstore_mount, on_history_query, "(/corto/vstore/query query)", vstore_resultIter, corto_mount_on_history_query_v); + CORTO_OVERRIDABLE_O(vstore_mount, on_query, "(/corto/vstore/query query)", vstore_recordIter, corto_mount_on_query_v); + CORTO_OVERRIDABLE_O(vstore_mount, on_history_query, "(/corto/vstore/query query)", vstore_recordIter, corto_mount_on_history_query_v); CORTO_OVERRIDABLE_O(vstore_mount, on_resume, "(string parent,string id,inout:object object)", lang_int16, corto_mount_on_resume_v); CORTO_OVERRIDABLE_O(vstore_mount, on_notify, "(vstore/subscriber_event event)", lang_void, corto_mount_on_notify_v); CORTO_OVERRIDABLE_O(vstore_mount, on_batch_notify, "(uint32 event_count,vstore/subscriber_eventIter events)", lang_void, corto_mount_on_batch_notify_v); @@ -1538,7 +1538,7 @@ CORTO_CLASS_O(vstore, loader, vstore_mount, CORTO_READONLY, CORTO_ATTR_DEFAULT, CORTO_MEMBER_O(vstore_loader, autoLoad, lang_bool, CORTO_GLOBAL); CORTO_METHOD_O(vstore_loader, construct, "()", lang_int16, corto_loader_construct); CORTO_METHOD_O(vstore_loader, destruct, "()", lang_void, corto_loader_destruct); - CORTO_OVERRIDABLE_O(vstore_loader, on_query, "(/corto/vstore/query query)", vstore_resultIter, corto_loader_on_query_v); + CORTO_OVERRIDABLE_O(vstore_loader, on_query, "(/corto/vstore/query query)", vstore_recordIter, corto_loader_on_query_v); CORTO_OVERRIDE_O(vstore_loader, on_resume, "(string parent,string id,inout:object object)", lang_int16, corto_loader_on_resume); diff --git a/src/store/fmt.c b/src/store/fmt.c index 37bb3018..e4ad47dc 100644 --- a/src/store/fmt.c +++ b/src/store/fmt.c @@ -41,11 +41,11 @@ struct corto_fmt_s { /* Translate results to and from self-contained format values */ void* ___ (*fromResult)( corto_fmt_opt *data, - corto_result *o); + corto_record *o); int16_t ___ (*toResult)( corto_fmt_opt *data, - corto_result* o, + corto_record* o, const void* content); /* Translate objects to and from self-contained format values */ @@ -300,7 +300,7 @@ corto_fmt_lookup( sprintf(id, "%s_fromResult", packagePtr); result->fromResult = - (void* ___ (*)(corto_fmt_opt*, corto_result*)) + (void* ___ (*)(corto_fmt_opt*, corto_record*)) corto_load_proc(packageId, &dl, id); if (!result->fromResult) { corto_throw( @@ -310,7 +310,7 @@ corto_fmt_lookup( sprintf(id, "%s_toResult", packagePtr); result->toResult = - (int16_t ___ (*)(corto_fmt_opt*, corto_result*, const void*)) + (int16_t ___ (*)(corto_fmt_opt*, corto_record*, const void*)) corto_load_proc(packageId, &dl, id); if (!result->toResult) { corto_throw( @@ -409,7 +409,7 @@ int16_t corto_fmt_to_value( void* corto_fmt_from_result( corto_fmt fmt, corto_fmt_opt *opt, - corto_result *result) + corto_record *result) { return fmt->fromResult(opt, result); } @@ -417,7 +417,7 @@ void* corto_fmt_from_result( int16_t corto_fmt_to_result( corto_fmt fmt, corto_fmt_opt *opt, - corto_result *result, + corto_record *result, const void *data) { return fmt->toResult(opt, result, data); diff --git a/src/vstore/README.md b/src/vstore/README.md index 8ac346b1..a1a41b37 100644 --- a/src/vstore/README.md +++ b/src/vstore/README.md @@ -111,7 +111,7 @@ select foo/* from / the result would have been `foo/obj`. ### Query results -Queries, both realtime and single shot, format query results as a `vstore/result` +Queries, both realtime and single shot, format query results as a `vstore/record` type. The members of this type describe the metadata and serialized value of an object. That way, a user can evaluate data without having to insert objects from the virtual store into the object store. @@ -122,7 +122,7 @@ corto_iter it; corto_select("*").from("/foo").iter(&it); while (corto_iter_hasNext(&it)) { - corto_result *r = corto_iter_next(&it); + corto_record *r = corto_iter_next(&it); printf("id = %s, parent = %s, type = %s", r->id, r->parent, @@ -130,7 +130,7 @@ while (corto_iter_hasNext(&it)) { } ``` The corto architecture is built such that an application never has to occupy more -memory than is required for a single `corto_result` while iterating over the +memory than is required for a single `corto_record` while iterating over the results of a query. Allthough it is ultimately up to a mount to take advantage of the capabilities of the API, the corto architecture in theory allows for processing infinite datasets on devices of any size. @@ -138,7 +138,7 @@ processing infinite datasets on devices of any size. This is the same example, but for a realtime query (using a subscriber): ```c void callback(corto_subscriber_event *e) { - // e->data is of type corto_result* + // e->data is of type corto_record* printf("id = %s, parent = %s, type = %s", e->data.id, e->data.parent, @@ -171,14 +171,14 @@ Specifiying a format also works for subscribers: corto_subscribe("*").from("/foo").format("text/json").callback(cb); ``` -The serialized value can be obtained like this (assuming `r` is the `corto_result`): +The serialized value can be obtained like this (assuming `r` is the `corto_record`): ```c -printf("value = %s\n", corto_result_get_text(r)); +printf("value = %s\n", corto_record_get_text(r)); ``` or for subscribers: ```c -printf("value = %s\n", corto_result_get_text(&e->data)); +printf("value = %s\n", corto_record_get_text(&e->data)); ``` ### Implement a mount @@ -278,7 +278,7 @@ And change the implementation of `on_notify` to this (using our fictional writeD e->data.id, e->data.parent, e->data.type, - corto_result_get_text(&e->data) // Returns JSON! + corto_record_get_text(&e->data) // Returns JSON! ); ``` diff --git a/src/vstore/loader.c b/src/vstore/loader.c index 029cdcc6..cd7d1841 100644 --- a/src/vstore/loader.c +++ b/src/vstore/loader.c @@ -16,7 +16,7 @@ int16_t corto_loader_construct( if (safe_corto_mount_set_format(this, "text/json")) { return -1; } - corto_mount(this)->filter_results = false; + corto_mount(this)->filter_records = false; return safe_corto_mount_construct(this); } else { @@ -42,8 +42,8 @@ void corto_loader_iterRelease( /* Delete data from request */ corto_iter it = corto_ll_iter(data->list); while (corto_iter_hasNext(&it)) { - corto_result *r = corto_iter_next(&it); - corto_ptr_deinit(r, corto_result_o); + corto_record *r = corto_iter_next(&it); + corto_ptr_deinit(r, corto_record_o); corto_dealloc(r); } corto_ll_free(data->list); @@ -59,7 +59,7 @@ bool corto_loader_checkIfAdded( { corto_iter it = corto_ll_iter(list); while (corto_iter_hasNext(&it)) { - corto_result *r = corto_iter_next(&it); + corto_record *r = corto_iter_next(&it); if (!stricmp(r->id, name)) { return TRUE; } @@ -114,13 +114,13 @@ void corto_loader_addDir( sprintf(package, "%s/%s", q->from, f); corto_path_clean(package, package); - corto_result *result = corto_calloc(sizeof(corto_result)); + corto_record *result = corto_calloc(sizeof(corto_record)); corto_id packageFile; sprintf(packageFile, "%s/project.json", fpath); if (corto_file_test(packageFile)) { char *json = corto_file_load(packageFile); - corto_result_fromcontent(result, "text/json", json); + corto_record_fromcontent(result, "text/json", json); } else { result->id = corto_strdup(f); result->type = corto_strdup("package"); @@ -155,7 +155,7 @@ void corto_loader_addDir( } } -corto_resultIter corto_loader_on_query_v( +corto_recordIter corto_loader_on_query_v( corto_loader this, corto_query *query) { diff --git a/src/vstore/mount.c b/src/vstore/mount.c index 514a119f..160e6fba 100644 --- a/src/vstore/mount.c +++ b/src/vstore/mount.c @@ -73,7 +73,7 @@ void* corto_mount_thread( void corto_mount_notify(corto_subscriber_event *e) { corto_mount this = (corto_mount)e->subscriber; corto_eventMask event = e->event; - corto_result *r = &e->data; + corto_record *r = &e->data; if (!r->object || (!this->attr || corto_check_attr(r->object, this->attr))) { if (this->callbacks & CORTO_MOUNT_NOTIFY) { @@ -404,7 +404,7 @@ int16_t corto_mount_init( this->sample_rate = 0; this->expiry_time = -1; - this->filter_results = true; + this->filter_records = true; this->attr = CORTO_ATTR_PERSISTENT; return safe_corto_subscriber_init(this); @@ -733,18 +733,18 @@ void corto_mount_post( } } -corto_resultIter corto_mount_on_query_v( +corto_recordIter corto_mount_on_query_v( corto_mount this, corto_query *query) { - corto_resultIter result; + corto_recordIter result; CORTO_UNUSED(this); memset(&result, 0, sizeof(corto_iter)); if (corto_instanceof(corto_routerimpl_o, corto_typeof(this))) { corto_id routerRequest; - corto_any routerResult = {corto_type(corto_resultIter_o), &result}; + corto_any routerResult = {corto_type(corto_recordIter_o), &result}; corto_any routerParam = {corto_type(corto_query_o), query}; if (!strcmp(query->from, ".")) { sprintf(routerRequest, "/"); @@ -840,11 +840,11 @@ void corto_mount_publish( void corto_mount_queryRelease(corto_iter *iter) { corto_ll_iter_s *data = iter->ctx; - corto_ptr_deinit(&data->list, corto_resultlist_o); + corto_ptr_deinit(&data->list, corto_recordlist_o); corto_ll_iterRelease(iter); } -corto_resultIter corto_mount_query( +corto_recordIter corto_mount_query( corto_mount this, corto_query *query) { @@ -865,7 +865,7 @@ corto_resultIter corto_mount_query( return result; } -corto_resultIter corto_mount_historyQuery( +corto_recordIter corto_mount_historyQuery( corto_mount this, corto_query *query) { @@ -890,7 +890,7 @@ int16_t corto_mount_resumeResult( corto_mount this, const char *parent, const char *id, - corto_result *r, + corto_record *r, corto_object *o_out) { bool new_object = false; @@ -1015,14 +1015,14 @@ int16_t corto_mount_resume( q.content = TRUE; /* Query the mount */ - corto_resultIter it = corto_mount_query(this, &q); + corto_recordIter it = corto_mount_query(this, &q); if (corto_iter_hasNext(&it)) { - corto_result *r = corto_iter_next(&it); + corto_record *r = corto_iter_next(&it); /* If mount requests that corto should filter its results, it may * return more than one result */ - if (this->filter_results) { + if (this->filter_records) { do { /* If this mount required corto to filter its own results, * test if returned object is requested object */ @@ -1049,7 +1049,7 @@ int16_t corto_mount_resume( result = out; if (corto_iter_hasNext(&it)) { - if (!this->filter_results) { + if (!this->filter_records) { /* If mount is doing its own filtering but is returning * more than one result, something is wrong */ corto_error( @@ -1094,7 +1094,7 @@ int16_t corto_mount_resume( void corto_mount_return( corto_mount this, - corto_result *r) + corto_record *r) { corto_ll result = corto_tls_get(CORTO_KEY_MOUNT_RESULT); @@ -1123,7 +1123,7 @@ void corto_mount_return( return; } - corto_result *elem = corto_calloc(sizeof(corto_result)); + corto_record *elem = corto_calloc(sizeof(corto_record)); elem->id = corto_strdup(r->id); elem->name = r->name ? corto_strdup(r->name) : NULL; elem->parent = corto_strdup(r->parent); @@ -1486,7 +1486,7 @@ void corto_mount_on_batch_notify_v( CORTO_UNUSED(events); } -corto_resultIter corto_mount_on_history_query_v( +corto_recordIter corto_mount_on_history_query_v( corto_mount this, corto_query *query) { diff --git a/src/vstore/observer.c b/src/vstore/observer.c index 2c9f2209..c677bf4c 100644 --- a/src/vstore/observer.c +++ b/src/vstore/observer.c @@ -344,7 +344,7 @@ void corto_updateSubscriptionById( corto_select(id).subscribe(&it); while (corto_iter_hasNext(&it)) { - corto_result *r = corto_iter_next(&it); + corto_record *r = corto_iter_next(&it); /* Reuse id buffer. Because this function is recursive, using a * large buffer allocated on stack is 'dangerous'. */ diff --git a/src/vstore/query.c b/src/vstore/query.c index 29b1a1a6..b9967cc3 100644 --- a/src/vstore/query.c +++ b/src/vstore/query.c @@ -14,7 +14,7 @@ uint32_t corto_query_cardinality( bool corto_query_match( corto_query* this, - corto_result *result) + corto_record *result) { corto_assert(result->id != NULL, "no id specified in result"); corto_assert(result->parent != NULL, "no parent specified in result"); diff --git a/src/vstore/result.c b/src/vstore/result.c index b974e64a..90873c56 100644 --- a/src/vstore/result.c +++ b/src/vstore/result.c @@ -3,8 +3,8 @@ #include #include "src/store/object.h" -corto_string corto_result_contentof( - corto_result* this, +corto_string corto_record_contentof( + corto_record* this, const char *format) { corto_string result = NULL; @@ -23,8 +23,8 @@ corto_string corto_result_contentof( return NULL; } -int16_t corto_result_fromcontent( - corto_result* this, +int16_t corto_record_fromcontent( + corto_record* this, const char *format, const char *content) { @@ -42,8 +42,8 @@ int16_t corto_result_fromcontent( return -1; } -corto_string corto_result_get_text( - corto_result* this) +corto_string corto_record_get_text( + corto_record* this) { return (corto_string)this->value; } diff --git a/src/vstore/select.c b/src/vstore/select.c index a1f16dad..f6ad7e03 100644 --- a/src/vstore/select.c +++ b/src/vstore/select.c @@ -171,10 +171,10 @@ struct corto_select_data { corto_id name; corto_id parent; corto_id type; - corto_result item; + corto_record item; bool valueAllocated; corto_selectHistoryIter_t historyIterData; - corto_result *next; + corto_record *next; }; static @@ -284,7 +284,7 @@ int16_t corto_selectConvert( static void corto_setItemData( corto_object o, - corto_result *item, + corto_record *item, corto_select_data *data) { corto_id to, from; @@ -362,7 +362,7 @@ void corto_setItemData( static bool corto_selectMatch( corto_object o, - corto_result *item, + corto_record *item, corto_select_data *data) { bool result = TRUE; @@ -513,7 +513,7 @@ char* corto_selectRelativeParent( } static -corto_resultIter corto_selectRequestMount( +corto_recordIter corto_selectRequestMount( corto_select_data *data, corto_mount mount) { @@ -616,7 +616,7 @@ bool corto_selectIterMount( corto_id rpath; corto_mount mount = data->mounts[frame->currentMount - 1]; - corto_result *result = corto_iter_next(&frame->iter); + corto_record *result = corto_iter_next(&frame->iter); if (!result) { corto_critical("mount iterator returned NULL"); } @@ -643,7 +643,7 @@ bool corto_selectIterMount( /* Filter data early if mount indicates it doesn't do any filtering, and * this is not a tree query */ if (data->filterProgram && - mount->filter_results && + mount->filter_records && data->mask != CORTO_ON_TREE) { if (!corto_selectMatch(NULL, result, data)) { @@ -1024,7 +1024,7 @@ int16_t corto_selectTree( data->sp, frame->cur->scope, frame->cur->expr, data->location); do { - corto_resultMask flags = CORTO_RESULT_LEAF, hasData = FALSE; + corto_recordMask flags = CORTO_RESULT_LEAF, hasData = FALSE; /* Unwind stack for depleted iterators */ while (!(hasData = corto_selectIterNext(data, frame, &o, lastKey)) && @@ -1221,7 +1221,7 @@ void corto_selectFilterMounts( static void* corto_selectNext( - corto_resultIter *iter) + corto_recordIter *iter) { corto_select_data *data = iter->ctx; @@ -1478,7 +1478,7 @@ bool corto_selectNextExpr( } static -bool corto_selectHasNext(corto_resultIter *iter) { +bool corto_selectHasNext(corto_recordIter *iter) { corto_select_data *data = iter->ctx; if (data->quit) { return 0; @@ -1525,13 +1525,13 @@ bool corto_selectHasNext(corto_resultIter *iter) { } static -corto_resultIter corto_selectPrepareIterator ( +corto_recordIter corto_selectPrepareIterator ( struct corto_selectRequest *r) { corto_select_data *data = corto_calloc(sizeof(corto_select_data)); - corto_resultIter result; - memset(&result, 0, sizeof(corto_resultIter)); + corto_recordIter result; + memset(&result, 0, sizeof(corto_recordIter)); const char *scope = r->scope; @@ -1734,7 +1734,7 @@ corto_select__fluent corto_selectorInstanceof( static int16_t corto_selectorIter( - corto_resultIter *ret) + corto_recordIter *ret) { corto_assert(ret != NULL, "no iterator provided to .iter()"); @@ -1830,7 +1830,7 @@ int corto_mountAction_subscribe( static int16_t corto_selectorSubscribe( - corto_resultIter *ret) + corto_recordIter *ret) { corto_assert(ret != NULL, "no iterator provided to .subscribe()"); @@ -1942,7 +1942,7 @@ int16_t corto_selectorResume(void) /* Iterate over objects to resume them in the store */ while (corto_iter_hasNext(&it)) { - corto_result *r = corto_iter_next(&it); + corto_record *r = corto_iter_next(&it); if (r->object) { corto_claim(r->object); } @@ -1957,7 +1957,7 @@ int16_t corto_selectorResume(void) static int64_t corto_selectorCount() { - corto_resultIter it; + corto_recordIter it; uint64_t count = 0; corto_selectRequest *request = diff --git a/src/vstore/subscriber.c b/src/vstore/subscriber.c index 83d2cb52..563ed3a0 100644 --- a/src/vstore/subscriber.c +++ b/src/vstore/subscriber.c @@ -205,7 +205,7 @@ static int16_t corto_subscriber_invoke( corto_object instance, corto_eventMask mask, - corto_result *r, + corto_record *r, corto_subscriber s, corto_subscriber_event *existing_event, corto_fmtcache *cache) @@ -469,7 +469,7 @@ int16_t corto_notify_subscribersById( } } - corto_result r = { + corto_record r = { .id = (char*)id, .name = NULL, .parent = parentPtr, @@ -930,7 +930,7 @@ int16_t corto_subscriber_subscribe( /* Populate alignment queue. Any message delivered to the subscriber will * end up in the queue */ while (corto_iter_hasNext(&it)) { - corto_result *r = corto_iter_next(&it); + corto_record *r = corto_iter_next(&it); corto_subscriber_invoke(instance, CORTO_DEFINE, r, this, NULL, NULL); /* Nifty trick to take ownership of the serialized value- that way there diff --git a/test/store/src/BinarySerializer.c b/test/store/src/BinarySerializer.c index 1306d61b..6b32a725 100644 --- a/test/store/src/BinarySerializer.c +++ b/test/store/src/BinarySerializer.c @@ -9,7 +9,7 @@ void test_BinarySerializer_tc_serializeReferenceType( test_assert(corto_select("corto").format("binary/corto").iter(&it) == 0); test_assert(corto_iter_hasNext(&it) != 0); - corto_result *r = corto_iter_next(&it); + corto_record *r = corto_iter_next(&it); test_assert(r != NULL); test_assert(r->value != 0); @@ -54,7 +54,7 @@ void test_BinarySerializer_tc_serializeReferenceTypeWithInit( test_assert(corto_select("corto/lang/class").format("binary/corto").iter(&it) == 0); test_assert(corto_iter_hasNext(&it) != 0); - corto_result *r = corto_iter_next(&it); + corto_record *r = corto_iter_next(&it); test_assert(r != NULL); test_assert(r->value != 0); diff --git a/test/store/src/Security.c b/test/store/src/Security.c index d34247f5..24ce8ae1 100644 --- a/test/store/src/Security.c +++ b/test/store/src/Security.c @@ -248,7 +248,7 @@ void test_Security_tc_authorizeDeniedSelect( ret = corto_select("*") .from("/A").iter(&iter); test_assert(ret == 0); - corto_resultIter__foreach(iter, result) { + corto_recordIter__foreach(iter, result) { test_assert(strcmp(result.id, "b")); } @@ -359,7 +359,7 @@ void test_Security_tc_authorizeSelect( .from("/A").iter(&iter); test_assert(ret == 0); corto_int32 count = 0; - corto_resultIter__foreach(iter, result) { + corto_recordIter__foreach(iter, result) { if (!strcmp(result.id, "b")) { count ++; } @@ -945,7 +945,7 @@ void test_Security_tc_lockDenyTreeGrantSelectScope( test_assert(corto_select("*").from("/a/b").iter(&it) == 0); test_assert(corto_iter_hasNext(&it) != 0); - corto_result *r = corto_iter_next(&it); + corto_record *r = corto_iter_next(&it); test_assert(r != NULL); test_assertstr(r->id, "c"); test_assertstr(r->type, "void"); diff --git a/test/vstore/model.corto b/test/vstore/model.corto index 17ad34d0..b27d9666 100644 --- a/test/vstore/model.corto +++ b/test/vstore/model.corto @@ -93,7 +93,7 @@ class JsonReplicator : mount, hidden { construct() int16 override - on_query(vstore.query query) iterator[vstore.result] + on_query(vstore.query query) iterator[vstore.record] } // Mount that serves up data as corto strings @@ -102,7 +102,7 @@ class StringReplicator : mount, hidden { construct() int16 override - on_query(vstore.query query) iterator[vstore.result] + on_query(vstore.query query) iterator[vstore.record] } // Mount that provides id service @@ -121,11 +121,11 @@ class ListMount : mount, hidden { member mount: object alias mask: observer/mask member kind: ownership - member items: resultList, private|not_null + member items: recordList, private|not_null construct() int16 override - on_query(vstore/query query) iterator[vstore.result] + on_query(vstore.query query) iterator[vstore.record] } // Mount that uses iterator @@ -133,7 +133,7 @@ class MountWIterData: mount, hidden { mount: object override - on_query(vstore/query query) iterator[vstore.result] + on_query(vstore.query query) iterator[vstore.record] } // Mount that counts iterator calls @@ -142,31 +142,31 @@ class MountIterCount: mount, hidden { nextCount: int32, readonly hasNextCount: int32, readonly releaseCount: int32, readonly - result: vstore/result, readonly + result: vstore.record, readonly id: string, readonly construct() int16 override - on_query(vstore/query query) iterator[vstore.result] + on_query(vstore.query query) iterator[vstore.record] } // Mount with nested objects class VirtualMount: mount, hidden { mount: string - data: resultList, private|not_null + data: recordList, private|not_null construct() int16 override - on_query(vstore/query query) iterator[vstore.result] + on_query(vstore.query query) iterator[vstore.record] } // Mount that returns data with an initial slash in the parent class MountInitialSlash: mount { override - on_query(vstore/query query) iterator[vstore.result] + on_query(vstore.query query) iterator[vstore.record] } // Mount that serves up historical data @@ -175,10 +175,10 @@ class HistoryMount : vstore/mount, hidden { construct() int16 override - on_history_query(vstore/query query) iterator[vstore.result] + on_history_query(vstore.query query) iterator[vstore.record] struct data { - result: vstore/result + result: vstore/record history: list[string], not_null } @@ -190,11 +190,11 @@ class SinkMount: vstore/mount, hidden { mount: object type: string value: string - items: resultList, private|not_null + items: recordList, private|not_null construct() int16 override - on_query(vstore/query query) iterator[vstore.result] + on_query(vstore.query query) iterator[vstore.record] on_resume(string parent, string id, inout object object) int16 } @@ -203,44 +203,44 @@ class AutoResumeSinkMount : vstore/mount, hidden { mount: object type: string value: string - subscribes: list[vstore/query], readonly|not_null - unsubscribes: list[vstore/query], readonly|not_null - mounts: list[vstore/query], readonly|not_null - unmounts: list[vstore/query], readonly|not_null - items: resultList, private|not_null + subscribes: list[vstore.query], readonly|not_null + unsubscribes: list[vstore.query], readonly|not_null + mounts: list[vstore.query], readonly|not_null + unmounts: list[vstore.query], readonly|not_null + items: recordList, private|not_null construct() int16 override - on_query(vstore/query query) iterator[vstore.result] - on_subscribe(vstore/query query, word ctx) word - on_unsubscribe(vstore/query query, word ctx) void - on_mount(vstore/query query, word ctx) word - on_unmount(vstore/query query, word ctx) void + on_query(vstore.query query) iterator[vstore.record] + on_subscribe(vstore.query query, word ctx) word + on_unsubscribe(vstore.query query, word ctx) void + on_mount(vstore.query query, word ctx) word + on_unmount(vstore.query query, word ctx) void } // LOCAL mount that serves up nested data class VirtualSinkMount : vstore/mount, hidden { from: string - items: resultList, private|not_null + items: recordList, private|not_null count: int32, readonly construct() int16 override - on_query(vstore/query query) iterator[vstore.result] + on_query(vstore.query query) iterator[vstore.record] } // Mount that returns specified item using iterator class ObjectMount : vstore/mount, hidden { select: string from: string - item: result + item: vstore.record construct() int16 override - on_query(vstore/query query) iterator[vstore.result] + on_query(vstore.query query) iterator[vstore.record] } // The loader is a complex mount that filters on type, hides store packages and @@ -249,17 +249,17 @@ override // can be verified. class LoaderSimulatorMount : vstore/mount, hidden { queryCount: int32, private - items: resultList, private|not_null + items: recordList, private|not_null construct() int16 override - on_query(vstore/query query) iterator[vstore.result] + on_query(vstore.query query) iterator[vstore.record] } // Mount that serves up a single object class SimpleMount: vstore/mount { - on_query(vstore/query query) iterator[vstore.result] + on_query(vstore.query query) iterator[vstore.record] } // LOCAL mount with no data @@ -292,13 +292,13 @@ override class RefMount: mount, hidden { from: string last_json: string, readonly - items: list[vstore/result], readonly | not_null + items: list[vstore/record], readonly | not_null construct() int16 override on_notify(vstore/subscriber_event event) void - on_query(vstore/query query) iterator[vstore.result] + on_query(vstore.query query) iterator[vstore.record] } //------------------------------------------------------------------------------ @@ -422,8 +422,8 @@ method teardown() function - collect(string scope, string expr, uint64 offset, uint64 limit) list[result] - hasObject(resultList items, string parent, string name, string type) bool + collect(string scope, string expr, uint64 offset, uint64 limit) list[record] + hasObject(recordList items, string parent, string name, string type) bool } // Request data with content type @@ -764,8 +764,8 @@ method test/Suite Subscribe { triggered: uint8 owner: object - result: vstore/result - + result: vstore.record + subscriber noInitialSep: query:{select:"*", from:"testScope"} tc_noInitialSep() diff --git a/test/vstore/src/AutoResumeSinkMount.c b/test/vstore/src/AutoResumeSinkMount.c index dd2eab98..83075417 100644 --- a/test/vstore/src/AutoResumeSinkMount.c +++ b/test/vstore/src/AutoResumeSinkMount.c @@ -21,8 +21,8 @@ int16_t test_AutoResumeSinkMount_construct( corto_observer(this)->mask = CORTO_ON_TREE; // First tier - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "x", NULL, ".", @@ -31,8 +31,8 @@ int16_t test_AutoResumeSinkMount_construct( FALSE ); - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "y", NULL, ".", @@ -41,8 +41,8 @@ int16_t test_AutoResumeSinkMount_construct( FALSE ); - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "z", NULL, ".", @@ -52,8 +52,8 @@ int16_t test_AutoResumeSinkMount_construct( ); // Second tier - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "a", NULL, "x", @@ -62,8 +62,8 @@ int16_t test_AutoResumeSinkMount_construct( FALSE ); - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "b", NULL, "x", @@ -72,8 +72,8 @@ int16_t test_AutoResumeSinkMount_construct( FALSE ); - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "c", NULL, "x", @@ -83,8 +83,8 @@ int16_t test_AutoResumeSinkMount_construct( ); // Third tier - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "k", NULL, "x/a", @@ -93,8 +93,8 @@ int16_t test_AutoResumeSinkMount_construct( FALSE ); - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "l", NULL, "x/a", @@ -103,8 +103,8 @@ int16_t test_AutoResumeSinkMount_construct( FALSE ); - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "m", NULL, "x/a", @@ -114,8 +114,8 @@ int16_t test_AutoResumeSinkMount_construct( ); // Fourth tier - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "n", NULL, "x/a/k", @@ -124,8 +124,8 @@ int16_t test_AutoResumeSinkMount_construct( FALSE ); - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "o", NULL, "x/a/k", @@ -134,8 +134,8 @@ int16_t test_AutoResumeSinkMount_construct( FALSE ); - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "p", NULL, "x/a/k", @@ -150,12 +150,12 @@ int16_t test_AutoResumeSinkMount_construct( /* Custom release function */ static void test_SinkMount_iterRelease(corto_iter *iter) { corto_ll_iter_s *data = iter->ctx; - corto_resultList__clear(data->list); + corto_recordList__clear(data->list); corto_ll_free(data->list); corto_ll_iterRelease(iter); } -corto_resultIter test_AutoResumeSinkMount_on_query( +corto_recordIter test_AutoResumeSinkMount_on_query( test_AutoResumeSinkMount this, corto_query *query) { @@ -163,11 +163,11 @@ corto_resultIter test_AutoResumeSinkMount_on_query( corto_ll data = corto_ll_new(); /* Filter items by parent */ - corto_resultIter__foreach(iter, e) { + corto_recordIter__foreach(iter, e) { if (!fnmatch(query->from, e.parent, 0)) { if (!fnmatch(query->select, e.id, 0)) { - corto_result__assign( - corto_resultList__append_alloc(data), + corto_record__assign( + corto_recordList__append_alloc(data), e.id, e.id, e.parent, diff --git a/test/vstore/src/HistoryMount.c b/test/vstore/src/HistoryMount.c index 5324352a..58bd8c50 100644 --- a/test/vstore/src/HistoryMount.c +++ b/test/vstore/src/HistoryMount.c @@ -6,7 +6,7 @@ int16_t test_HistoryMount_construct( test_HistoryMount this) { corto_ll samples; - corto_result r; + corto_record r; /* Backwards compatibility patch for mount member */ corto_subscriber s = corto_subscriber(this); @@ -25,7 +25,7 @@ int16_t test_HistoryMount_construct( corto_stringList__append(samples, "{10,11}"); corto_stringList__append(samples, "{20,22}"); - r = (corto_result){"a", NULL, ".", "/test/Point", 0, CORTO_RESULT_LEAF}; + r = (corto_record){"a", NULL, ".", "/test/Point", 0, CORTO_RESULT_LEAF}; test_HistoryMount_data__assign( test_HistoryMount_dataList__append_alloc(this->history), &r, @@ -35,7 +35,7 @@ int16_t test_HistoryMount_construct( corto_stringList__append(samples, "{30,33}"); corto_stringList__append(samples, "{40,44}"); corto_stringList__append(samples, "{50,55}"); - r = (corto_result){"b", NULL, ".", "/test/Point", 0, CORTO_RESULT_LEAF}; + r = (corto_record){"b", NULL, ".", "/test/Point", 0, CORTO_RESULT_LEAF}; test_HistoryMount_data__assign( test_HistoryMount_dataList__append_alloc(this->history), &r, @@ -46,7 +46,7 @@ int16_t test_HistoryMount_construct( corto_stringList__append(samples, "{70,77}"); corto_stringList__append(samples, "{80,88}"); corto_stringList__append(samples, "{90,99}"); - r = (corto_result){"c", NULL, ".", "/test/Point", 0, CORTO_RESULT_LEAF}; + r = (corto_record){"c", NULL, ".", "/test/Point", 0, CORTO_RESULT_LEAF}; test_HistoryMount_data__assign( test_HistoryMount_dataList__append_alloc(this->history), &r, @@ -78,7 +78,7 @@ void* next( int start = 0, stop = 0, i; iterData *ctx = it->ctx; test_HistoryMount_data *data = corto_iter_next(&ctx->iter); - corto_result *result = &data->result; + corto_record *result = &data->result; /* Clear previous history */ corto_sample *s; while ((s = corto_ll_takeFirst(ctx->history))) { @@ -127,11 +127,11 @@ void release( corto_dealloc(ctx); } -corto_resultIter test_HistoryMount_on_history_query( +corto_recordIter test_HistoryMount_on_history_query( test_HistoryMount this, corto_query *query) { - corto_resultIter it; + corto_recordIter it; iterData *data = corto_alloc(sizeof(iterData)); data->this = this; diff --git a/test/vstore/src/JsonReplicator.c b/test/vstore/src/JsonReplicator.c index e10de5b2..6c023cb5 100644 --- a/test/vstore/src/JsonReplicator.c +++ b/test/vstore/src/JsonReplicator.c @@ -15,27 +15,27 @@ int16_t test_JsonReplicator_construct( corto_mount_set_format(this, "text/json"); corto_mount(this)->ownership = CORTO_LOCAL_SOURCE; - corto_mount(this)->filter_results = true; + corto_mount(this)->filter_records = true; return corto_mount_construct(this); } /* Custom release function */ void test_JsonReplicator_iterRelease(corto_iter *iter) { corto_ll_iter_s *data = iter->ctx; - corto_resultList__clear(data->list); + corto_recordList__clear(data->list); corto_ll_free(data->list); corto_ll_iterRelease(iter); } -corto_resultIter test_JsonReplicator_on_query( +corto_recordIter test_JsonReplicator_on_query( test_JsonReplicator this, corto_query *query) { corto_ll data = corto_ll_new(); /* Create top level objects */ - corto_result__assign( - corto_resultList__append_alloc(data), + corto_record__assign( + corto_recordList__append_alloc(data), "a", NULL, ".", @@ -43,8 +43,8 @@ corto_resultIter test_JsonReplicator_on_query( (corto_word)corto_strdup("{\"x\":10,\"y\":20}"), CORTO_RESULT_LEAF ); - corto_result__assign( - corto_resultList__append_alloc(data), + corto_record__assign( + corto_recordList__append_alloc(data), "b", 0, ".", @@ -52,8 +52,8 @@ corto_resultIter test_JsonReplicator_on_query( (corto_word)corto_strdup("{\"x\":30,\"y\":40}"), CORTO_RESULT_LEAF ); - corto_result__assign( - corto_resultList__append_alloc(data), + corto_record__assign( + corto_recordList__append_alloc(data), "c", NULL, ".", diff --git a/test/vstore/src/ListMount.c b/test/vstore/src/ListMount.c index 588f3d2a..151b582e 100644 --- a/test/vstore/src/ListMount.c +++ b/test/vstore/src/ListMount.c @@ -19,8 +19,8 @@ int16_t test_ListMount_construct( corto_mount(this)->ownership = this->kind; /* Create top level objects */ - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "x", NULL, ".", @@ -28,8 +28,8 @@ int16_t test_ListMount_construct( 0, 0 ); - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "yz", NULL, ".", @@ -37,8 +37,8 @@ int16_t test_ListMount_construct( 0, 0 ); - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "xyz", NULL, ".", @@ -48,8 +48,8 @@ int16_t test_ListMount_construct( ); /* Create nested objects */ - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "a", NULL, "x", @@ -58,8 +58,8 @@ int16_t test_ListMount_construct( 0 ); - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "b", NULL, "x", @@ -68,8 +68,8 @@ int16_t test_ListMount_construct( 0 ); - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "c", NULL, "x", @@ -78,8 +78,8 @@ int16_t test_ListMount_construct( 0 ); - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "a", NULL, "xyz", @@ -88,8 +88,8 @@ int16_t test_ListMount_construct( 0 ); - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "abc", NULL, "xyz", @@ -98,8 +98,8 @@ int16_t test_ListMount_construct( 0 ); - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "bc", NULL, "xyz", @@ -108,8 +108,8 @@ int16_t test_ListMount_construct( 0 ); - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "foo", NULL, "xyz/abc", @@ -118,8 +118,8 @@ int16_t test_ListMount_construct( 0 ); - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "bar", NULL, "xyz/abc", @@ -128,8 +128,8 @@ int16_t test_ListMount_construct( 0 ); - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "hello", NULL, "xyz/abc/foo", @@ -138,8 +138,8 @@ int16_t test_ListMount_construct( 0 ); - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "world", NULL, "xyz/abc/foo", @@ -157,12 +157,12 @@ int16_t test_ListMount_construct( /* Custom release function */ void test_ListMount_iterRelease(corto_iter *iter) { corto_ll_iter_s *data = iter->ctx; - corto_resultList__clear(data->list); + corto_recordList__clear(data->list); corto_ll_free(data->list); corto_ll_iterRelease(iter); } -corto_resultIter test_ListMount_on_query( +corto_recordIter test_ListMount_on_query( test_ListMount this, corto_query *query) { @@ -170,11 +170,11 @@ corto_resultIter test_ListMount_on_query( corto_ll data = corto_ll_new(); /* Filter items by parent */ - corto_resultIter__foreach(iter, e) { + corto_recordIter__foreach(iter, e) { if (corto_idmatch(query->from, e.parent)) { if (corto_idmatch(query->select, e.id)) { - corto_result__assign( - corto_resultList__append_alloc(data), + corto_record__assign( + corto_recordList__append_alloc(data), e.id, e.id, e.parent, diff --git a/test/vstore/src/LoaderSimulatorMount.c b/test/vstore/src/LoaderSimulatorMount.c index f6c7c0f9..b5d07234 100644 --- a/test/vstore/src/LoaderSimulatorMount.c +++ b/test/vstore/src/LoaderSimulatorMount.c @@ -11,10 +11,10 @@ int16_t test_LoaderSimulatorMount_construct( corto_set_str(&corto_subscriber(this)->format, "text/json"); corto_mount(this)->ownership = CORTO_LOCAL_SOURCE; - corto_mount(this)->filter_results = false; + corto_mount(this)->filter_records = false; - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "corto", NULL, ".", @@ -23,8 +23,8 @@ int16_t test_LoaderSimulatorMount_construct( CORTO_RESULT_HIDDEN ); - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "p", NULL, ".", @@ -33,8 +33,8 @@ int16_t test_LoaderSimulatorMount_construct( FALSE ); - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "q", NULL, "p", @@ -43,8 +43,8 @@ int16_t test_LoaderSimulatorMount_construct( FALSE ); - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "s", NULL, "p/q", @@ -53,8 +53,8 @@ int16_t test_LoaderSimulatorMount_construct( FALSE ); - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "r", NULL, "corto", @@ -63,8 +63,8 @@ int16_t test_LoaderSimulatorMount_construct( FALSE ); - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "u", NULL, "corto/r", @@ -73,8 +73,8 @@ int16_t test_LoaderSimulatorMount_construct( FALSE ); - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "v", NULL, ".", @@ -89,12 +89,12 @@ int16_t test_LoaderSimulatorMount_construct( /* Custom release function */ static void test_LoaderSimulatorMount_iterRelease(corto_iter *iter) { corto_ll_iter_s *data = iter->ctx; - corto_resultList__clear(data->list); + corto_recordList__clear(data->list); corto_ll_free(data->list); corto_ll_iterRelease(iter); } -corto_resultIter test_LoaderSimulatorMount_on_query( +corto_recordIter test_LoaderSimulatorMount_on_query( test_LoaderSimulatorMount this, corto_query *query) { @@ -102,11 +102,11 @@ corto_resultIter test_LoaderSimulatorMount_on_query( corto_ll data = corto_ll_new(); /* Filter items by parent */ - corto_resultIter__foreach(iter, e) { + corto_recordIter__foreach(iter, e) { if (!fnmatch(query->from, e.parent, 0)) { if (!fnmatch(query->select, e.id, 0)) { - corto_result__assign( - corto_resultList__append_alloc(data), + corto_record__assign( + corto_recordList__append_alloc(data), e.id, e.id, e.parent, diff --git a/test/vstore/src/MountContentTypeRefs.c b/test/vstore/src/MountContentTypeRefs.c index 9f649fb5..8155d397 100644 --- a/test/vstore/src/MountContentTypeRefs.c +++ b/test/vstore/src/MountContentTypeRefs.c @@ -40,7 +40,7 @@ void test_MountContentTypeRefs_tc_selectDataFromMountAtData( "\"null_ref\":null}"; test_assert(corto_iter_hasNext(&it) != 0); - corto_result *r = corto_iter_next(&it); + corto_record *r = corto_iter_next(&it); test_assert(r != NULL); test_assertstr(r->id, "refs"); test_assertstr(r->parent, "."); @@ -79,7 +79,7 @@ void test_MountContentTypeRefs_tc_selectDataFromMountAtDataNested1( "\"null_ref\":null}"; test_assert(corto_iter_hasNext(&it) != 0); - corto_result *r = corto_iter_next(&it); + corto_record *r = corto_iter_next(&it); test_assert(r != NULL); test_assertstr(r->id, "refs"); test_assertstr(r->parent, "parent"); @@ -118,7 +118,7 @@ void test_MountContentTypeRefs_tc_selectDataFromMountAtDataNested2( "\"null_ref\":null}"; test_assert(corto_iter_hasNext(&it) != 0); - corto_result *r = corto_iter_next(&it); + corto_record *r = corto_iter_next(&it); test_assert(r != NULL); test_assertstr(r->id, "refs"); test_assertstr(r->parent, "grandparent/parent"); @@ -157,7 +157,7 @@ void test_MountContentTypeRefs_tc_selectDataFromMountAtRoot( "\"null_ref\":null}"; test_assert(corto_iter_hasNext(&it) != 0); - corto_result *r = corto_iter_next(&it); + corto_record *r = corto_iter_next(&it); test_assert(r != NULL); test_assertstr(r->id, "refs"); test_assertstr(r->parent, "."); @@ -196,7 +196,7 @@ void test_MountContentTypeRefs_tc_selectDataNested1FromMountAtData( "\"null_ref\":null}"; test_assert(corto_iter_hasNext(&it) != 0); - corto_result *r = corto_iter_next(&it); + corto_record *r = corto_iter_next(&it); test_assert(r != NULL); test_assertstr(r->id, "refs"); test_assertstr(r->parent, ".."); @@ -235,7 +235,7 @@ void test_MountContentTypeRefs_tc_selectDataNested1FromMountAtDataNested1( "\"null_ref\":null}"; test_assert(corto_iter_hasNext(&it) != 0); - corto_result *r = corto_iter_next(&it); + corto_record *r = corto_iter_next(&it); test_assert(r != NULL); test_assertstr(r->id, "refs"); test_assertstr(r->parent, "."); @@ -274,7 +274,7 @@ void test_MountContentTypeRefs_tc_selectDataNested1FromMountAtDataNested2( "\"null_ref\":null}"; test_assert(corto_iter_hasNext(&it) != 0); - corto_result *r = corto_iter_next(&it); + corto_record *r = corto_iter_next(&it); test_assert(r != NULL); test_assertstr(r->id, "refs"); test_assertstr(r->parent, "parent"); @@ -313,7 +313,7 @@ void test_MountContentTypeRefs_tc_selectDataNested1FromMountAtRoot( "\"null_ref\":null}"; test_assert(corto_iter_hasNext(&it) != 0); - corto_result *r = corto_iter_next(&it); + corto_record *r = corto_iter_next(&it); test_assert(r != NULL); test_assertstr(r->id, "refs"); test_assertstr(r->parent, "../.."); @@ -352,7 +352,7 @@ void test_MountContentTypeRefs_tc_selectDataNested2FromMountAtData( "\"null_ref\":null}"; test_assert(corto_iter_hasNext(&it) != 0); - corto_result *r = corto_iter_next(&it); + corto_record *r = corto_iter_next(&it); test_assert(r != NULL); test_assertstr(r->id, "refs"); test_assertstr(r->parent, "../.."); @@ -391,7 +391,7 @@ void test_MountContentTypeRefs_tc_selectDataNested2FromMountAtDataNested1( "\"null_ref\":null}"; test_assert(corto_iter_hasNext(&it) != 0); - corto_result *r = corto_iter_next(&it); + corto_record *r = corto_iter_next(&it); test_assert(r != NULL); test_assertstr(r->id, "refs"); test_assertstr(r->parent, ".."); @@ -430,7 +430,7 @@ void test_MountContentTypeRefs_tc_selectDataNested2FromMountAtDataNested2( "\"null_ref\":null}"; test_assert(corto_iter_hasNext(&it) != 0); - corto_result *r = corto_iter_next(&it); + corto_record *r = corto_iter_next(&it); test_assert(r != NULL); test_assertstr(r->id, "refs"); test_assertstr(r->parent, "."); @@ -469,7 +469,7 @@ void test_MountContentTypeRefs_tc_selectDataNested2FromMountAtRoot( "\"null_ref\":null}"; test_assert(corto_iter_hasNext(&it) != 0); - corto_result *r = corto_iter_next(&it); + corto_record *r = corto_iter_next(&it); test_assert(r != NULL); test_assertstr(r->id, "refs"); test_assertstr(r->parent, "../../.."); @@ -508,7 +508,7 @@ void test_MountContentTypeRefs_tc_selectRootFromMountAtData( "\"null_ref\":null}"; test_assert(corto_iter_hasNext(&it) != 0); - corto_result *r = corto_iter_next(&it); + corto_record *r = corto_iter_next(&it); test_assert(r != NULL); test_assertstr(r->id, "refs"); test_assertstr(r->parent, "data"); @@ -547,7 +547,7 @@ void test_MountContentTypeRefs_tc_selectRootFromMountAtDataNested1( "\"null_ref\":null}"; test_assert(corto_iter_hasNext(&it) != 0); - corto_result *r = corto_iter_next(&it); + corto_record *r = corto_iter_next(&it); test_assert(r != NULL); test_assertstr(r->id, "refs"); test_assertstr(r->parent, "data/parent"); @@ -586,7 +586,7 @@ void test_MountContentTypeRefs_tc_selectRootFromMountAtDataNested2( "\"null_ref\":null}"; test_assert(corto_iter_hasNext(&it) != 0); - corto_result *r = corto_iter_next(&it); + corto_record *r = corto_iter_next(&it); test_assert(r != NULL); test_assertstr(r->id, "refs"); test_assertstr(r->parent, "data/grandparent/parent"); @@ -631,7 +631,7 @@ void test_MountContentTypeRefs_tc_selectRootFromMountAtRoot( "\"null_ref\":null}"; test_assert(corto_iter_hasNext(&it) != 0); - corto_result *r = corto_iter_next(&it); + corto_record *r = corto_iter_next(&it); test_assert(r != NULL); test_assertstr(r->id, "refs"); test_assertstr(r->parent, "."); diff --git a/test/vstore/src/MountInitialSlash.c b/test/vstore/src/MountInitialSlash.c index ed8bcfc8..ec0a21f5 100644 --- a/test/vstore/src/MountInitialSlash.c +++ b/test/vstore/src/MountInitialSlash.c @@ -2,14 +2,14 @@ #include -corto_resultIter test_MountInitialSlash_on_query( +corto_recordIter test_MountInitialSlash_on_query( test_MountInitialSlash this, corto_query *query) { - corto_result r; + corto_record r; if (!strcmp(query->from, ".")) { - r = (corto_result){ + r = (corto_record){ .id = "foo", .parent = "/", .type = "void" @@ -17,7 +17,7 @@ corto_resultIter test_MountInitialSlash_on_query( corto_mount_return(this, &r); } else if (!strcmp(query->from, "foo")) { - r = (corto_result){ + r = (corto_record){ .id = "bar", .parent = "/foo", .type = "void" diff --git a/test/vstore/src/MountIterCount.c b/test/vstore/src/MountIterCount.c index d641448f..f81b58c0 100644 --- a/test/vstore/src/MountIterCount.c +++ b/test/vstore/src/MountIterCount.c @@ -25,7 +25,7 @@ void test_MounterIterCount_release(corto_iter *it) { this->releaseCount ++; } -corto_resultIter test_MountIterCount_on_query( +corto_recordIter test_MountIterCount_on_query( test_MountIterCount this, corto_query *query) { @@ -60,7 +60,7 @@ int16_t test_MountIterCount_construct( this->mount = corto(CORTO_LOOKUP, {.id = s->query.from}); } - corto_mount(this)->filter_results = false; + corto_mount(this)->filter_records = false; return corto_super_construct(this); } diff --git a/test/vstore/src/MountWIterData.c b/test/vstore/src/MountWIterData.c index 7a5e95fc..5f7107e7 100644 --- a/test/vstore/src/MountWIterData.c +++ b/test/vstore/src/MountWIterData.c @@ -16,11 +16,11 @@ bool iterHasNext( return 0; } -corto_resultIter test_MountWIterData_on_query( +corto_recordIter test_MountWIterData_on_query( test_MountWIterData this, corto_query *query) { - corto_resultIter result; + corto_recordIter result; result.ctx = corto_calloc(sizeof(char)); result.hasNext = iterHasNext; diff --git a/test/vstore/src/ObjectMount.c b/test/vstore/src/ObjectMount.c index 87ab2815..99244e06 100644 --- a/test/vstore/src/ObjectMount.c +++ b/test/vstore/src/ObjectMount.c @@ -14,7 +14,7 @@ int16_t test_ObjectMount_construct( struct iterCtx { - corto_result *result; + corto_record *result; int count; }; @@ -42,7 +42,7 @@ void release( corto_dealloc(it->ctx); } -corto_resultIter test_ObjectMount_on_query( +corto_recordIter test_ObjectMount_on_query( test_ObjectMount this, corto_query *query) { diff --git a/test/vstore/src/RefMount.c b/test/vstore/src/RefMount.c index 503b81df..47664d06 100644 --- a/test/vstore/src/RefMount.c +++ b/test/vstore/src/RefMount.c @@ -13,7 +13,7 @@ int16_t test_RefMount_construct( } /* Let corto filter results for the mount */ - corto_mount(this)->filter_results = true; + corto_mount(this)->filter_records = true; /* Enable resuming objects by configuring mount as local source */ corto_mount(this)->ownership = CORTO_LOCAL_SOURCE; @@ -31,8 +31,8 @@ int16_t test_RefMount_construct( "\"root\":\"/\"," "\"null_ref\":null}"; - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "refs", NULL, ".", @@ -41,8 +41,8 @@ int16_t test_RefMount_construct( 0 ); - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "foo", NULL, ".", @@ -51,8 +51,8 @@ int16_t test_RefMount_construct( 0 ); - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "bar", NULL, "foo", @@ -61,8 +61,8 @@ int16_t test_RefMount_construct( 0 ); - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "hello", NULL, "foo/bar", @@ -71,8 +71,8 @@ int16_t test_RefMount_construct( 0 ); - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "world", NULL, "foo/bar/hello", @@ -95,7 +95,7 @@ void test_RefMount_on_notify( } -corto_resultIter test_RefMount_on_query( +corto_recordIter test_RefMount_on_query( test_RefMount this, corto_query *query) { diff --git a/test/vstore/src/Select.c b/test/vstore/src/Select.c index 437f00d2..3f973614 100644 --- a/test/vstore/src/Select.c +++ b/test/vstore/src/Select.c @@ -2,7 +2,7 @@ #include -corto_resultList test_Select_collect( +corto_recordList test_Select_collect( const char *scope, const char *expr, uint64_t offset, @@ -20,8 +20,8 @@ corto_resultList test_Select_collect( if (ret) goto error; corto_ll result = corto_ll_new(); while (corto_iter_hasNext(&iter)) { - corto_result *item = corto_iter_next(&iter); - corto_result *listItem = corto_alloc(sizeof(corto_result)); + corto_record *item = corto_iter_next(&iter); + corto_record *listItem = corto_alloc(sizeof(corto_record)); listItem->parent = corto_strdup(item->parent); listItem->name = corto_strdup(item->name); listItem->type = corto_strdup(item->type); @@ -34,7 +34,7 @@ corto_resultList test_Select_collect( } bool test_Select_hasObject( - corto_resultlist items, + corto_recordlist items, const char *parent, const char *name, const char *type) @@ -42,7 +42,7 @@ bool test_Select_hasObject( corto_iter iter = corto_ll_iter(items); while (corto_iter_hasNext(&iter)) { - corto_result *item = corto_iter_next(&iter); + corto_record *item = corto_iter_next(&iter); if (!strcmp(item->parent, parent)) { if (!strcmp(item->name, name)) { if (!strcmp(item->type, type)) { @@ -112,7 +112,7 @@ void test_Select_tc_selectDeleteCurrent( { corto_int16 ret = 0; corto_iter iter; - corto_result *item; + corto_record *item; corto_object o = corto_resolve(NULL, "a/ab_ab"); ret = corto_select("a/*").iter( &iter ); @@ -145,7 +145,7 @@ void test_Select_tc_selectDeleteFirst( { corto_int16 ret = 0; corto_iter iter; - corto_result *item; + corto_record *item; corto_object o = corto_resolve(NULL, "a/ab01234567890"); ret = corto_select("a/*").iter( &iter ); @@ -174,7 +174,7 @@ void test_Select_tc_selectDeleteNext( { corto_int16 ret = 0; corto_iter iter; - corto_result *item; + corto_record *item; corto_object o = corto_resolve(NULL, "a/ab_ab"); ret = corto_select("a/*").iter( &iter ); @@ -203,7 +203,7 @@ void test_Select_tc_selectDeleteParent( { corto_int16 ret = 0; corto_iter iter; - corto_result *item; + corto_record *item; corto_object o = corto_resolve(NULL, "a"); ret = corto_select("a/*").iter( &iter ); @@ -227,7 +227,7 @@ void test_Select_tc_selectDeletePrevious( { corto_int16 ret = 0; corto_iter iter; - corto_result *item; + corto_record *item; corto_object o = corto_resolve(NULL, "a/ab01234567890"); ret = corto_select("a/*").iter( &iter ); @@ -259,7 +259,7 @@ void test_Select_tc_selectEmptyParentAst( test_Select this) { corto_iter it; - corto_result *r; + corto_record *r; corto_int16 ret = corto_select("*").from("").iter(&it); test_assert(ret == 0); @@ -478,7 +478,7 @@ void test_Select_tc_selectIdentifier( test_Select this) { corto_ll results = NULL; - corto_result *item; + corto_record *item; corto_object a = corto_resolve(NULL, "a"); test_assert(a != NULL); @@ -518,7 +518,7 @@ void test_Select_tc_selectInvertCase( test_assert(ret == 0); test_assert(corto_iter_hasNext(&it)); - corto_result *r = corto_iter_next(&it); + corto_record *r = corto_iter_next(&it); test_assert(r != NULL); test_assertstr(r->id, "abc"); test_assertstr(r->parent, "."); @@ -537,7 +537,7 @@ void test_Select_tc_selectInvertCaseFilter( test_assert(ret == 0); test_assert(corto_iter_hasNext(&it)); - corto_result *r = corto_iter_next(&it); + corto_record *r = corto_iter_next(&it); test_assert(r != NULL); test_assertstr(r->id, "Abab"); test_assertstr(r->parent, "."); @@ -555,7 +555,7 @@ void test_Select_tc_selectInvertCaseScope( test_assert(ret == 0); test_assert(corto_iter_hasNext(&it)); - corto_result *r = corto_iter_next(&it); + corto_record *r = corto_iter_next(&it); test_assert(r != NULL); test_assertstr(r->id, "abc"); test_assertstr(r->parent, "."); @@ -1009,7 +1009,7 @@ void test_Select_tc_selectOffsetTree( void test_Select_tc_selectOrder( test_Select this) { - corto_result *item; + corto_record *item; corto_iter iter; corto_int16 ret = corto_select("a//*").iter( &iter ); @@ -1143,7 +1143,7 @@ void test_Select_tc_selectParent( test_Select this) { corto_ll results = NULL; - corto_result *item; + corto_record *item; corto_object a = corto_resolve(NULL, "a"); test_assert(a != NULL); @@ -1183,7 +1183,7 @@ void test_Select_tc_selectParentWithSink( test_assert(ret == 0); test_assert(corto_iter_hasNext(&it)); - corto_result *r = corto_iter_next(&it); + corto_record *r = corto_iter_next(&it); test_assert(r != NULL); test_assertstr(r->id, ""); test_assertstr(r->parent, ".."); @@ -1215,7 +1215,7 @@ void test_Select_tc_selectScopedIdentifier( test_Select this) { corto_ll results = NULL; - corto_result *item; + corto_record *item; results = test_Select_collect(NULL, "a/b", 0, 0); test_assert(results != NULL); @@ -1233,7 +1233,7 @@ void test_Select_tc_selectScopedParent( test_Select this) { corto_ll results = NULL; - corto_result *item; + corto_record *item; results = test_Select_collect(NULL, "a/..", 0, 0); test_assert(results != NULL); @@ -1251,7 +1251,7 @@ void test_Select_tc_selectScopedThis( test_Select this) { corto_ll results = NULL; - corto_result *item; + corto_record *item; results = test_Select_collect(NULL, "a/.", 0, 0); test_assert(results != NULL); @@ -1350,7 +1350,7 @@ void test_Select_tc_selectThis( test_Select this) { corto_ll results = NULL; - corto_result *item; + corto_record *item; corto_object a = corto_resolve(NULL, "a"); test_assert(a != NULL); @@ -1412,7 +1412,7 @@ void test_Select_tc_selectTreeDeleteCurrent( test_Select this) { corto_iter iter; - corto_result *item; + corto_record *item; corto_object o = corto_resolve(NULL, "a/ab_ab"); corto_int16 ret = corto_select("a//*").iter( &iter ); @@ -1443,7 +1443,7 @@ void test_Select_tc_selectTreeDeleteCurrent( void test_Select_tc_selectTreeDeleteFirst( test_Select this) { - corto_result *item; + corto_record *item; corto_iter iter; corto_object o = corto_resolve(NULL, "a/ab01234567890"); @@ -1472,7 +1472,7 @@ void test_Select_tc_selectTreeDeleteGrandparent( test_Select this) { corto_iter iter; - corto_result *item; + corto_record *item; corto_object o = corto_resolve(NULL, "a"); corto_int16 ret = corto_select("a//*").iter( &iter ); @@ -1542,7 +1542,7 @@ void test_Select_tc_selectTreeDeleteNext( test_Select this) { corto_iter iter; - corto_result *item; + corto_record *item; corto_object o = corto_resolve(NULL, "a/ab_ab"); corto_int16 ret = corto_select("a/*").iter( &iter ); @@ -1570,7 +1570,7 @@ void test_Select_tc_selectTreeDeleteParent( test_Select this) { corto_iter iter; - corto_result *item; + corto_record *item; corto_object o = corto_resolve(NULL, "a"); corto_int16 ret = corto_select("a/*").iter( &iter ); @@ -1594,7 +1594,7 @@ void test_Select_tc_selectTreeDeletePrevious( test_Select this) { corto_iter iter; - corto_result *item; + corto_record *item; corto_object o = corto_resolve(NULL, "a/ab01234567890"); corto_int16 ret = corto_select("a/*").iter( &iter ); @@ -1754,7 +1754,7 @@ void test_Select_tc_selectFromPartialMatchedElement( test_assert(corto_select("*").from("data/hello").iter(&it) == 0); test_assert(corto_iter_hasNext(&it)); - corto_result *r = corto_iter_next(&it); + corto_record *r = corto_iter_next(&it); test_assertstr(r->id, "a"); test_assertstr(r->parent, "."); test_assertstr(r->type, "void"); @@ -1844,7 +1844,7 @@ void test_Select_tc_selectTreeUnknown( test_assert(ret == 0); test_assert(corto_iter_hasNext(&it) == 1); - corto_result *r = corto_iter_next(&it); + corto_record *r = corto_iter_next(&it); test_assertstr(r->id, "world"); test_assertstr(r->parent, "bar/hello"); test_assertstr(r->type, "void"); @@ -1869,7 +1869,7 @@ void test_Select_tc_selectIdYieldUnknown( int16_t ret = corto_select("bar").from("foo").yield_unknown().iter(&it); test_assert(ret == 0); - corto_result *r; + corto_record *r; test_assert(corto_iter_hasNext(&it) != 0); r = corto_iter_next(&it); test_assert(r != NULL); @@ -1897,7 +1897,7 @@ void test_Select_tc_selectScopeYieldUnknown( int16_t ret = corto_select("/").from("data").yield_unknown().iter(&it); test_assert(ret == 0); - corto_result *r; + corto_record *r; test_assert(corto_iter_hasNext(&it) != 0); r = corto_iter_next(&it); test_assert(r != NULL); @@ -1925,7 +1925,7 @@ void test_Select_tc_selectThisYieldUnknown( int16_t ret = corto_select(".").from("foo").yield_unknown().iter(&it); test_assert(ret == 0); - corto_result *r; + corto_record *r; test_assert(corto_iter_hasNext(&it) != 0); r = corto_iter_next(&it); test_assert(r != NULL); @@ -1958,7 +1958,7 @@ void test_Select_tc_selectTreeYieldUnknown( int16_t ret = corto_select("//").from("data").yield_unknown().iter(&it); test_assert(ret == 0); - corto_result *r; + corto_record *r; test_assert(corto_iter_hasNext(&it) != 0); r = corto_iter_next(&it); test_assert(r != NULL); diff --git a/test/vstore/src/SelectContentType.c b/test/vstore/src/SelectContentType.c index d6cdb225..619027b8 100644 --- a/test/vstore/src/SelectContentType.c +++ b/test/vstore/src/SelectContentType.c @@ -31,7 +31,7 @@ void test_SelectContentType_tc_selectBinaryFromJson( test_SelectContentType this) { corto_iter iter; - corto_result *result; + corto_record *result; test_Point *p; corto_int16 ret = @@ -81,7 +81,7 @@ void test_SelectContentType_tc_selectBinaryFromObjects( test_SelectContentType this) { corto_iter iter; - corto_result *result; + corto_record *result; test_Point *p; corto_int16 ret = corto_select("obj/*").format("binary/corto").iter( &iter ); @@ -129,7 +129,7 @@ void test_SelectContentType_tc_selectBinaryFromObjects( void test_SelectContentType_tc_selectBinaryFromString( test_SelectContentType this) { - corto_result *result; + corto_record *result; corto_iter iter; test_Point *p; @@ -179,7 +179,7 @@ void test_SelectContentType_tc_selectJsonFromJson( test_SelectContentType this) { corto_iter iter; - corto_result *result; + corto_record *result; corto_string json; corto_int16 ret = corto_select("json/*").format("text/json").iter( &iter ); @@ -192,7 +192,7 @@ void test_SelectContentType_tc_selectJsonFromJson( test_assert(!strcmp(result->id, "a")); test_assert(!strcmp(result->parent, "/json")); test_assert(!strcmp(result->type, "/test/Point")); - json = corto_result_get_text(result); + json = corto_record_get_text(result); test_assert(json != NULL); test_assert(!strcmp(json, "{\"x\":10,\"y\":20}")); @@ -203,7 +203,7 @@ void test_SelectContentType_tc_selectJsonFromJson( test_assert(!strcmp(result->id, "b")); test_assert(!strcmp(result->parent, "/json")); test_assert(!strcmp(result->type, "/test/Point")); - json = corto_result_get_text(result); + json = corto_record_get_text(result); test_assert(json != NULL); test_assert(!strcmp(json, "{\"x\":30,\"y\":40}")); @@ -214,7 +214,7 @@ void test_SelectContentType_tc_selectJsonFromJson( test_assert(!strcmp(result->id, "c")); test_assert(!strcmp(result->parent, "/json")); test_assert(!strcmp(result->type, "/test/Point")); - json = corto_result_get_text(result); + json = corto_record_get_text(result); test_assert(json != NULL); test_assert(!strcmp(json, "{\"x\":50,\"y\":60}")); @@ -225,7 +225,7 @@ void test_SelectContentType_tc_selectJsonFromObjects( test_SelectContentType this) { corto_iter iter; - corto_result *result; + corto_record *result; corto_string json; corto_int16 ret = corto_select("obj/*").format("text/json").iter( &iter ); @@ -238,7 +238,7 @@ void test_SelectContentType_tc_selectJsonFromObjects( test_assert(!strcmp(result->id, "a")); test_assert(!strcmp(result->parent, "/obj")); test_assert(!strcmp(result->type, "/test/Point")); - json = corto_result_get_text(result); + json = corto_record_get_text(result); test_assert(json != NULL); test_assert(!strcmp(json, "{\"x\":10,\"y\":20}")); @@ -249,7 +249,7 @@ void test_SelectContentType_tc_selectJsonFromObjects( test_assert(!strcmp(result->id, "b")); test_assert(!strcmp(result->parent, "/obj")); test_assert(!strcmp(result->type, "/test/Point")); - json = corto_result_get_text(result); + json = corto_record_get_text(result); test_assert(json != NULL); test_assert(!strcmp(json, "{\"x\":30,\"y\":40}")); @@ -260,7 +260,7 @@ void test_SelectContentType_tc_selectJsonFromObjects( test_assert(!strcmp(result->id, "c")); test_assert(!strcmp(result->parent, "/obj")); test_assert(!strcmp(result->type, "/test/Point")); - json = corto_result_get_text(result); + json = corto_record_get_text(result); test_assert(json != NULL); test_assert(!strcmp(json, "{\"x\":50,\"y\":60}")); @@ -270,7 +270,7 @@ void test_SelectContentType_tc_selectJsonFromObjects( void test_SelectContentType_tc_selectJsonFromString( test_SelectContentType this) { - corto_result *result; + corto_record *result; corto_string json; corto_iter iter; @@ -284,7 +284,7 @@ void test_SelectContentType_tc_selectJsonFromString( test_assert(!strcmp(result->id, "a")); test_assert(!strcmp(result->parent, "/str")); test_assert(!strcmp(result->type, "/test/Point")); - json = corto_result_get_text(result); + json = corto_record_get_text(result); test_assert(json != NULL); test_assert(!strcmp(json, "{\"x\":10,\"y\":20}")); @@ -295,7 +295,7 @@ void test_SelectContentType_tc_selectJsonFromString( test_assert(!strcmp(result->id, "b")); test_assert(!strcmp(result->parent, "/str")); test_assert(!strcmp(result->type, "/test/Point")); - json = corto_result_get_text(result); + json = corto_record_get_text(result); test_assert(json != NULL); test_assert(!strcmp(json, "{\"x\":30,\"y\":40}")); @@ -306,7 +306,7 @@ void test_SelectContentType_tc_selectJsonFromString( test_assert(!strcmp(result->id, "c")); test_assert(!strcmp(result->parent, "/str")); test_assert(!strcmp(result->type, "/test/Point")); - json = corto_result_get_text(result); + json = corto_record_get_text(result); test_assert(json != NULL); test_assert(!strcmp(json, "{\"x\":50,\"y\":60}")); @@ -317,7 +317,7 @@ void test_SelectContentType_tc_selectStringFromJson( test_SelectContentType this) { corto_iter iter; - corto_result *result; + corto_record *result; corto_string str; corto_int16 ret = corto_select("json/*").format("text/corto").iter( &iter ); @@ -330,7 +330,7 @@ void test_SelectContentType_tc_selectStringFromJson( test_assert(!strcmp(result->id, "a")); test_assert(!strcmp(result->parent, "/json")); test_assert(!strcmp(result->type, "/test/Point")); - str = corto_result_get_text(result); + str = corto_record_get_text(result); test_assert(str != NULL); test_assert(!strcmp(str, "{10,20}")); @@ -341,7 +341,7 @@ void test_SelectContentType_tc_selectStringFromJson( test_assert(!strcmp(result->id, "b")); test_assert(!strcmp(result->parent, "/json")); test_assert(!strcmp(result->type, "/test/Point")); - str = corto_result_get_text(result); + str = corto_record_get_text(result); test_assert(str != NULL); test_assert(!strcmp(str, "{30,40}")); @@ -352,7 +352,7 @@ void test_SelectContentType_tc_selectStringFromJson( test_assert(!strcmp(result->id, "c")); test_assert(!strcmp(result->parent, "/json")); test_assert(!strcmp(result->type, "/test/Point")); - str = corto_result_get_text(result); + str = corto_record_get_text(result); test_assert(str != NULL); test_assert(!strcmp(str, "{50,60}")); @@ -363,7 +363,7 @@ void test_SelectContentType_tc_selectStringFromObjects( test_SelectContentType this) { corto_iter iter; - corto_result *result; + corto_record *result; corto_string str; corto_int16 ret = corto_select("obj/*").format("text/corto").iter( &iter ); @@ -376,7 +376,7 @@ void test_SelectContentType_tc_selectStringFromObjects( test_assert(!strcmp(result->id, "a")); test_assert(!strcmp(result->parent, "/obj")); test_assert(!strcmp(result->type, "/test/Point")); - str = corto_result_get_text(result); + str = corto_record_get_text(result); test_assert(str != NULL); test_assert(!strcmp(str, "{10,20}")); @@ -387,7 +387,7 @@ void test_SelectContentType_tc_selectStringFromObjects( test_assert(!strcmp(result->id, "b")); test_assert(!strcmp(result->parent, "/obj")); test_assert(!strcmp(result->type, "/test/Point")); - str = corto_result_get_text(result); + str = corto_record_get_text(result); test_assert(str != NULL); test_assert(!strcmp(str, "{30,40}")); @@ -398,7 +398,7 @@ void test_SelectContentType_tc_selectStringFromObjects( test_assert(!strcmp(result->id, "c")); test_assert(!strcmp(result->parent, "/obj")); test_assert(!strcmp(result->type, "/test/Point")); - str = corto_result_get_text(result); + str = corto_record_get_text(result); test_assert(str != NULL); test_assert(!strcmp(str, "{50,60}")); @@ -409,7 +409,7 @@ void test_SelectContentType_tc_selectStringFromString( test_SelectContentType this) { corto_iter iter; - corto_result *result; + corto_record *result; corto_string str; corto_int16 ret = corto_select("str/*").format("text/corto").iter( &iter ); @@ -422,7 +422,7 @@ void test_SelectContentType_tc_selectStringFromString( test_assert(!strcmp(result->id, "a")); test_assert(!strcmp(result->parent, "/str")); test_assert(!strcmp(result->type, "/test/Point")); - str = corto_result_get_text(result); + str = corto_record_get_text(result); test_assert(str != NULL); test_assert(!strcmp(str, "{10,20}")); @@ -433,7 +433,7 @@ void test_SelectContentType_tc_selectStringFromString( test_assert(!strcmp(result->id, "b")); test_assert(!strcmp(result->parent, "/str")); test_assert(!strcmp(result->type, "/test/Point")); - str = corto_result_get_text(result); + str = corto_record_get_text(result); test_assert(str != NULL); test_assert(!strcmp(str, "{30,40}")); @@ -444,7 +444,7 @@ void test_SelectContentType_tc_selectStringFromString( test_assert(!strcmp(result->id, "c")); test_assert(!strcmp(result->parent, "/str")); test_assert(!strcmp(result->type, "/test/Point")); - str = corto_result_get_text(result); + str = corto_record_get_text(result); test_assert(str != NULL); test_assert(!strcmp(str, "{50,60}")); @@ -463,7 +463,7 @@ void test_SelectContentType_tc_selectTypeWithConstruct( test_assertint(test_ContentTypeTest_get_construct_called_count(), 0); corto_iter iter; - corto_result *result; + corto_record *result; corto_string str; corto_int16 ret = corto_select("data/*").format("text/corto").iter( &iter ); test_assert(ret == 0); @@ -475,7 +475,7 @@ void test_SelectContentType_tc_selectTypeWithConstruct( test_assertstr(result->id, "a"); test_assertstr(result->parent, "/data"); test_assertstr(result->type, "/test/ContentTypeTest"); - str = corto_result_get_text(result); + str = corto_record_get_text(result); test_assert(str != NULL); test_assertstr(str, "{10,20}"); @@ -486,7 +486,7 @@ void test_SelectContentType_tc_selectTypeWithConstruct( test_assertstr(result->id, "b"); test_assertstr(result->parent, "/data"); test_assertstr(result->type, "/test/ContentTypeTest"); - str = corto_result_get_text(result); + str = corto_record_get_text(result); test_assert(str != NULL); test_assertstr(str, "{30,40}"); @@ -497,7 +497,7 @@ void test_SelectContentType_tc_selectTypeWithConstruct( test_assertstr(result->id, "c"); test_assertstr(result->parent, "/data"); test_assertstr(result->type, "/test/ContentTypeTest"); - str = corto_result_get_text(result); + str = corto_record_get_text(result); test_assert(str != NULL); test_assertstr(str, "{50,60}"); diff --git a/test/vstore/src/SelectContentTypeRefs.c b/test/vstore/src/SelectContentTypeRefs.c index 4a7edda5..18fc6e26 100644 --- a/test/vstore/src/SelectContentTypeRefs.c +++ b/test/vstore/src/SelectContentTypeRefs.c @@ -33,7 +33,7 @@ void test_SelectContentTypeRefs_tc_selectIdWithRefsFromNested1( corto_set_ref(&refs->null_ref, NULL); corto_iter it; - corto_result *r; + corto_record *r; corto_select("refs").from("data").format("text/json").iter(&it); test_assert(corto_iter_hasNext(&it)); @@ -81,7 +81,7 @@ void test_SelectContentTypeRefs_tc_selectIdWithRefsFromNested2( corto_set_ref(&refs->null_ref, NULL); corto_iter it; - corto_result *r; + corto_record *r; corto_select("refs").from("data/foo").format("text/json").iter(&it); test_assert(corto_iter_hasNext(&it)); @@ -129,7 +129,7 @@ void test_SelectContentTypeRefs_tc_selectIdWithRefsFromRoot( corto_set_ref(&refs->null_ref, NULL); corto_iter it; - corto_result *r; + corto_record *r; corto_select("refs").format("text/json").iter(&it); test_assert(corto_iter_hasNext(&it)); @@ -177,7 +177,7 @@ void test_SelectContentTypeRefs_tc_selectScopeNestedWithRefsFromNested1( corto_set_ref(&refs->null_ref, NULL); corto_iter it; - corto_result *r; + corto_record *r; corto_select("grandparent/parent/refs").from("data").format("text/json").iter(&it); test_assert(corto_iter_hasNext(&it)); @@ -225,7 +225,7 @@ void test_SelectContentTypeRefs_tc_selectScopeNestedWithRefsFromNested2( corto_set_ref(&refs->null_ref, NULL); corto_iter it; - corto_result *r; + corto_record *r; corto_select("grandparent/parent/refs").from("data/foo").format("text/json").iter(&it); test_assert(corto_iter_hasNext(&it)); @@ -273,7 +273,7 @@ void test_SelectContentTypeRefs_tc_selectScopeNestedWithRefsFromRoot( corto_set_ref(&refs->null_ref, NULL); corto_iter it; - corto_result *r; + corto_record *r; corto_select("grandparent/parent/").format("text/json").iter(&it); test_assert(corto_iter_hasNext(&it)); @@ -321,7 +321,7 @@ void test_SelectContentTypeRefs_tc_selectScopeWithRefsFromNested1( corto_set_ref(&refs->null_ref, NULL); corto_iter it; - corto_result *r; + corto_record *r; corto_select("parent/refs").from("data").format("text/json").iter(&it); test_assert(corto_iter_hasNext(&it)); @@ -369,7 +369,7 @@ void test_SelectContentTypeRefs_tc_selectScopeWithRefsFromNested2( corto_set_ref(&refs->null_ref, NULL); corto_iter it; - corto_result *r; + corto_record *r; corto_select("parent/refs").from("data/foo").format("text/json").iter(&it); test_assert(corto_iter_hasNext(&it)); @@ -417,7 +417,7 @@ void test_SelectContentTypeRefs_tc_selectScopeWithRefsFromRoot( corto_set_ref(&refs->null_ref, NULL); corto_iter it; - corto_result *r; + corto_record *r; corto_select("parent/").format("text/json").iter(&it); test_assert(corto_iter_hasNext(&it)); @@ -467,7 +467,7 @@ void test_SelectContentTypeRefs_tc_selectThisWithRefsFromNested1( corto_set_ref(&refs->null_ref, NULL); corto_iter it; - corto_result *r; + corto_record *r; corto_select(".").from("data/refs").format("text/json").iter(&it); test_assert(corto_iter_hasNext(&it)); @@ -517,7 +517,7 @@ void test_SelectContentTypeRefs_tc_selectThisWithRefsFromNested2( corto_set_ref(&refs->null_ref, NULL); corto_iter it; - corto_result *r; + corto_record *r; corto_select(".").from("data/parent/refs").format("text/json").iter(&it); test_assert(corto_iter_hasNext(&it)); @@ -567,7 +567,7 @@ void test_SelectContentTypeRefs_tc_selectThisWithRefsFromRoot( corto_set_ref(&refs->null_ref, NULL); corto_iter it; - corto_result *r; + corto_record *r; corto_select(".").from("refs").format("text/json").iter(&it); test_assert(corto_iter_hasNext(&it)); @@ -615,7 +615,7 @@ void test_SelectContentTypeRefs_tc_selectTreeNestedWithRefsFromNested1( corto_set_ref(&refs->null_ref, NULL); corto_iter it; - corto_result *r; + corto_record *r; corto_select("//refs").from("data").format("text/json").iter(&it); test_assert(corto_iter_hasNext(&it)); @@ -663,7 +663,7 @@ void test_SelectContentTypeRefs_tc_selectTreeNestedWithRefsFromNested2( corto_set_ref(&refs->null_ref, NULL); corto_iter it; - corto_result *r; + corto_record *r; corto_select("//refs").from("data/foo").format("text/json").iter(&it); test_assert(corto_iter_hasNext(&it)); @@ -711,7 +711,7 @@ void test_SelectContentTypeRefs_tc_selectTreeNestedWithRefsFromRoot( corto_set_ref(&refs->null_ref, NULL); corto_iter it; - corto_result *r; + corto_record *r; corto_select("//refs_obj").format("text/json").iter(&it); test_assert(corto_iter_hasNext(&it)); @@ -759,7 +759,7 @@ void test_SelectContentTypeRefs_tc_selectTreeWithRefsFromNested1( corto_set_ref(&refs->null_ref, NULL); corto_iter it; - corto_result *r; + corto_record *r; corto_select("//refs").from("data").format("text/json").iter(&it); test_assert(corto_iter_hasNext(&it)); @@ -807,7 +807,7 @@ void test_SelectContentTypeRefs_tc_selectTreeWithRefsFromNested2( corto_set_ref(&refs->null_ref, NULL); corto_iter it; - corto_result *r; + corto_record *r; corto_select("//refs").from("data/foo").format("text/json").iter(&it); test_assert(corto_iter_hasNext(&it)); @@ -855,7 +855,7 @@ void test_SelectContentTypeRefs_tc_selectTreeWithRefsFromRoot( corto_set_ref(&refs->null_ref, NULL); corto_iter it; - corto_result *r; + corto_record *r; corto_select("//refs_obj").format("text/json").iter(&it); test_assert(corto_iter_hasNext(&it)); diff --git a/test/vstore/src/SelectHistory.c b/test/vstore/src/SelectHistory.c index 51b534b0..f275c276 100644 --- a/test/vstore/src/SelectHistory.c +++ b/test/vstore/src/SelectHistory.c @@ -12,7 +12,7 @@ void test_SelectHistory_tc_selectAll( test_SelectHistory this) { corto_iter it; - corto_result *r; + corto_record *r; corto_sample *s; corto_int16 ret = corto_select("*") @@ -110,7 +110,7 @@ void test_SelectHistory_tc_selectJson( test_SelectHistory this) { corto_iter it; - corto_result *r; + corto_record *r; corto_sample *s; corto_int16 ret = corto_select("*") @@ -192,7 +192,7 @@ void test_SelectHistory_tc_selectNowToDepth( test_SelectHistory this) { corto_iter it; - corto_result *r; + corto_record *r; corto_sample *s; corto_int16 ret = corto_select("*") @@ -274,7 +274,7 @@ void test_SelectHistory_tc_selectSampleToDepth( test_SelectHistory this) { corto_iter it; - corto_result *r; + corto_record *r; corto_sample *s; corto_int16 ret = corto_select("*") diff --git a/test/vstore/src/SelectMount.c b/test/vstore/src/SelectMount.c index 5e4aebb2..a90f80d6 100644 --- a/test/vstore/src/SelectMount.c +++ b/test/vstore/src/SelectMount.c @@ -19,7 +19,7 @@ void test_SelectMount_setup( void test_SelectMount_tc_selectGrandparentFromVirtualScope( test_SelectMount this) { - corto_result *result; + corto_record *result; corto_iter iter; corto_int16 ret = corto_select("../..").from("/a/xyz").iter( &iter ); @@ -40,7 +40,7 @@ void test_SelectMount_tc_selectGrandparentFromVirtualScope( void test_SelectMount_tc_selectInvertCase( test_SelectMount this) { - corto_result *result; + corto_record *result; corto_iter iter; corto_int16 ret = corto_select("XYZ").from("/a").iter( &iter ); @@ -61,7 +61,7 @@ void test_SelectMount_tc_selectInvertCase( void test_SelectMount_tc_selectInvertCaseFilter( test_SelectMount this) { - corto_result *result; + corto_record *result; corto_iter iter; corto_int16 ret = corto_select("XY?").from("/a").iter( &iter ); @@ -82,7 +82,7 @@ void test_SelectMount_tc_selectInvertCaseFilter( void test_SelectMount_tc_selectInvertCaseScope( test_SelectMount this) { - corto_result *result; + corto_record *result; corto_iter iter; corto_int16 ret = corto_select("xyz").from("/A").iter( &iter ); @@ -212,7 +212,7 @@ void test_SelectMount_tc_selectIteratorRelease( void test_SelectMount_tc_selectParentFromScope( test_SelectMount this) { - corto_result *result; + corto_record *result; corto_iter iter; corto_int16 ret = corto_select("..").from("/a").iter( &iter ); @@ -233,7 +233,7 @@ void test_SelectMount_tc_selectParentFromScope( void test_SelectMount_tc_selectParentFromVirtualScope( test_SelectMount this) { - corto_result *result; + corto_record *result; corto_iter iter; corto_int16 ret = corto_select("..").from("/a/xyz").iter( &iter ); @@ -253,7 +253,7 @@ void test_SelectMount_tc_selectParentFromVirtualScope( void test_SelectMount_tc_selectScope( test_SelectMount this) { - corto_result *result; + corto_record *result; corto_iter iter; corto_int16 ret = corto_select("a/*").from("/").iter( &iter ); @@ -290,7 +290,7 @@ void test_SelectMount_tc_selectScope( void test_SelectMount_tc_selectScopeFilter( test_SelectMount this) { - corto_result *result; + corto_record *result; corto_iter iter; corto_int16 ret = corto_select("a/*z").from("/").iter( &iter ); @@ -320,7 +320,7 @@ void test_SelectMount_tc_selectScopeFilter( void test_SelectMount_tc_selectScopeFilterFromScope( test_SelectMount this) { - corto_result *result; + corto_record *result; corto_iter iter; corto_int16 ret = corto_select("*z").from("/a").iter( &iter ); @@ -349,7 +349,7 @@ void test_SelectMount_tc_selectScopeFilterFromScope( void test_SelectMount_tc_selectScopeFilterFromVirtualScope( test_SelectMount this) { - corto_result *result; + corto_record *result; corto_iter iter; corto_int16 ret = corto_select("*c").from("/a/xyz").iter( &iter ); @@ -378,7 +378,7 @@ void test_SelectMount_tc_selectScopeFilterFromVirtualScope( void test_SelectMount_tc_selectScopeFromScope( test_SelectMount this) { - corto_result *result; + corto_record *result; corto_iter iter; corto_int16 ret = corto_select("*") @@ -425,25 +425,25 @@ void test_SelectMount_tc_selectScopeFromVirtualMount( test_assert(!corto_select("data/*").format("text/corto").iter(&it)); test_assert(corto_iter_hasNext(&it)); - corto_result *r = corto_iter_next(&it); + corto_record *r = corto_iter_next(&it); test_assertstr(r->id, "a"); test_assertstr(r->parent, "/data"); test_assertstr(r->type, "int32"); - test_assertstr(corto_result_get_text(r), "10"); + test_assertstr(corto_record_get_text(r), "10"); test_assert(corto_iter_hasNext(&it)); r = corto_iter_next(&it); test_assertstr(r->id, "b"); test_assertstr(r->parent, "/data"); test_assertstr(r->type, "string"); - test_assertstr(corto_result_get_text(r), "Hello World"); + test_assertstr(corto_record_get_text(r), "Hello World"); test_assert(corto_iter_hasNext(&it)); r = corto_iter_next(&it); test_assertstr(r->id, "c"); test_assertstr(r->parent, "/data"); test_assertstr(r->type, "float64"); - test_assertstr(corto_result_get_text(r), "10.5"); + test_assertstr(corto_record_get_text(r), "10.5"); test_assert(!corto_iter_hasNext(&it)); @@ -452,7 +452,7 @@ void test_SelectMount_tc_selectScopeFromVirtualMount( void test_SelectMount_tc_selectScopeFromVirtualScope( test_SelectMount this) { - corto_result *result; + corto_record *result; corto_iter iter; corto_int16 ret = corto_select("*").from("/a/xyz").iter( &iter ); @@ -488,7 +488,7 @@ void test_SelectMount_tc_selectScopeFromVirtualScope( void test_SelectMount_tc_selectScopeMixed( test_SelectMount this) { - corto_result *result; + corto_record *result; corto_iter iter; /* Create additional three objects in scope of a */ @@ -557,7 +557,7 @@ void test_SelectMount_tc_selectScopeMixed( void test_SelectMount_tc_selectScopeNested( test_SelectMount this) { - corto_result *result; + corto_record *result; corto_iter iter; corto_int16 ret = corto_select("a/xyz/*").from("/").iter( &iter ); @@ -594,7 +594,7 @@ void test_SelectMount_tc_selectScopeNested( void test_SelectMount_tc_selectScopeNestedDirty( test_SelectMount this) { - corto_result *result; + corto_record *result; corto_iter iter; corto_int16 ret = corto_select("a/../a/./xyz/./*").from("/").iter( &iter ); @@ -631,7 +631,7 @@ void test_SelectMount_tc_selectScopeNestedDirty( void test_SelectMount_tc_selectScopeNestedDirtyFromScope( test_SelectMount this) { - corto_result *result; + corto_record *result; corto_iter iter; corto_int16 ret = corto_select("../a/./xyz/./*").from("/a").iter( &iter ); @@ -668,7 +668,7 @@ void test_SelectMount_tc_selectScopeNestedDirtyFromScope( void test_SelectMount_tc_selectScopeNestedDirtyFromVirtualScope( test_SelectMount this) { - corto_result *result; + corto_record *result; corto_iter iter; corto_int16 ret = corto_select("../../a/../a/./xyz/./abc/*").from("/a/xyz").iter( &iter ); @@ -697,7 +697,7 @@ void test_SelectMount_tc_selectScopeNestedDirtyFromVirtualScope( void test_SelectMount_tc_selectScopeNestedFromScope( test_SelectMount this) { - corto_result *result; + corto_record *result; corto_iter iter; corto_int16 ret = corto_select("xyz/*").from("/a").iter( &iter ); @@ -734,7 +734,7 @@ void test_SelectMount_tc_selectScopeNestedFromScope( void test_SelectMount_tc_selectScopeNestedFromVirtualScope( test_SelectMount this) { - corto_result *result; + corto_record *result; corto_iter iter; corto_int16 ret = corto_select("abc/*").from("/a/xyz").iter( &iter ); @@ -763,7 +763,7 @@ void test_SelectMount_tc_selectScopeNestedFromVirtualScope( void test_SelectMount_tc_selectSingle( test_SelectMount this) { - corto_result *result; + corto_record *result; corto_iter iter; corto_int16 ret = corto_select("a/xyz").from("/").iter( &iter ); @@ -784,7 +784,7 @@ void test_SelectMount_tc_selectSingle( void test_SelectMount_tc_selectSingleFromScope( test_SelectMount this) { - corto_result *result; + corto_record *result; corto_iter iter; corto_int16 ret = corto_select("xyz").from("/a").iter( &iter ); @@ -805,7 +805,7 @@ void test_SelectMount_tc_selectSingleFromScope( void test_SelectMount_tc_selectSingleFromScopeTree( test_SelectMount this) { - corto_result *result; + corto_record *result; corto_iter iter; corto_int16 ret = corto_select("//foo").from("/a").iter( &iter ); @@ -826,7 +826,7 @@ void test_SelectMount_tc_selectSingleFromScopeTree( void test_SelectMount_tc_selectSingleFromVirtualScope( test_SelectMount this) { - corto_result *result; + corto_record *result; corto_iter iter; corto_int16 ret = corto_select("bc").from("/a/xyz").iter( &iter ); @@ -847,7 +847,7 @@ void test_SelectMount_tc_selectSingleFromVirtualScope( void test_SelectMount_tc_selectSingleNested( test_SelectMount this) { - corto_result *result; + corto_record *result; corto_iter iter; corto_int16 ret = corto_select("a/xyz/abc").from("/").iter( &iter ); @@ -868,7 +868,7 @@ void test_SelectMount_tc_selectSingleNested( void test_SelectMount_tc_selectSingleNestedFromScope( test_SelectMount this) { - corto_result *result; + corto_record *result; corto_iter iter; corto_int16 ret = corto_select("xyz/bc").from("/a").iter( &iter ); @@ -889,7 +889,7 @@ void test_SelectMount_tc_selectSingleNestedFromScope( void test_SelectMount_tc_selectSingleNestedFromScopeTree( test_SelectMount this) { - corto_result *result; + corto_record *result; corto_iter iter; corto_int16 ret = corto_select("xyz//foo").from("/a").iter( &iter ); @@ -910,7 +910,7 @@ void test_SelectMount_tc_selectSingleNestedFromScopeTree( void test_SelectMount_tc_selectSingleNestedFromVirtualScope( test_SelectMount this) { - corto_result *result; + corto_record *result; corto_iter iter; corto_int16 ret = corto_select("abc/foo").from("/a/xyz").iter( &iter ); @@ -931,7 +931,7 @@ void test_SelectMount_tc_selectSingleNestedFromVirtualScope( void test_SelectMount_tc_selectSingleTree( test_SelectMount this) { - corto_result *result; + corto_record *result; corto_iter iter; corto_int16 ret = corto_select("//a").from("/a").iter( &iter ); @@ -960,7 +960,7 @@ void test_SelectMount_tc_selectSingleTree( void test_SelectMount_tc_selectSingleTree2( test_SelectMount this) { - corto_result *result; + corto_record *result; corto_iter iter; corto_int16 ret = corto_select("//foo").from("/a").iter( &iter ); @@ -981,7 +981,7 @@ void test_SelectMount_tc_selectSingleTree2( void test_SelectMount_tc_selectSingleTree3( test_SelectMount this) { - corto_result *result; + corto_record *result; corto_iter iter; corto_int16 ret = corto_select("//hello").from("/").iter( &iter ); @@ -1002,7 +1002,7 @@ void test_SelectMount_tc_selectSingleTree3( void test_SelectMount_tc_selectTree( test_SelectMount this) { - corto_result *result; + corto_record *result; corto_iter iter; corto_int16 ret = corto_select("//").from("/a").iter( &iter ); @@ -1139,7 +1139,7 @@ void test_SelectMount_tc_selectTreeEmptyNestedScope( test_assert(ret == 0); test_assert(corto_iter_hasNext(&it)); - corto_result *r = corto_iter_next(&it); + corto_record *r = corto_iter_next(&it); test_assert(r != NULL); test_assertstr(r->id, "mount"); test_assert(corto_iter_hasNext(&it)); @@ -1176,7 +1176,7 @@ void test_SelectMount_tc_selectTreeEmptyScope( test_assert(ret == 0); test_assert(corto_iter_hasNext(&it)); - corto_result *r = corto_iter_next(&it); + corto_record *r = corto_iter_next(&it); test_assert(r != NULL); test_assertstr(r->id, "mount"); test_assert(!corto_iter_hasNext(&it)); @@ -1192,7 +1192,7 @@ void test_SelectMount_tc_selectTreeEmptyScope( void test_SelectMount_tc_selectTreeFromNestedScope( test_SelectMount this) { - corto_result *result; + corto_record *result; corto_iter iter; corto_int16 ret = corto_select("//").from("/a/xyz/abc").iter( &iter ); @@ -1237,7 +1237,7 @@ void test_SelectMount_tc_selectTreeFromNestedScope( void test_SelectMount_tc_selectTreeFromScope( test_SelectMount this) { - corto_result *result; + corto_record *result; corto_iter iter; corto_int16 ret = corto_select("//").from("/a/xyz").iter( &iter ); @@ -1306,7 +1306,7 @@ void test_SelectMount_tc_selectTreeFromScope( void test_SelectMount_tc_selectTreeFromVirtualNestedScope( test_SelectMount this) { - corto_result *result; + corto_record *result; corto_iter iter; corto_int16 ret = corto_select("xyz/abc//").from("/a").iter( &iter ); @@ -1351,7 +1351,7 @@ void test_SelectMount_tc_selectTreeFromVirtualNestedScope( void test_SelectMount_tc_selectTreeFromVirtualScope( test_SelectMount this) { - corto_result *result; + corto_record *result; corto_iter iter; corto_int16 ret = corto_select("xyz//").from("/a").iter( &iter ); @@ -1420,7 +1420,7 @@ void test_SelectMount_tc_selectTreeFromVirtualScope( void test_SelectMount_tc_selectVirtualGrandparentFromVirtualScope( test_SelectMount this) { - corto_result *result; + corto_record *result; corto_iter iter; corto_int16 ret = corto_select("../..").from("/a/xyz/abc/foo").iter( &iter ); @@ -1441,7 +1441,7 @@ void test_SelectMount_tc_selectVirtualGrandparentFromVirtualScope( void test_SelectMount_tc_selectVirtualParentFromVirtualScope( test_SelectMount this) { - corto_result *result; + corto_record *result; corto_iter iter; corto_int16 ret = corto_select("..").from("/a/xyz/abc/foo").iter( &iter ); @@ -1492,7 +1492,7 @@ void test_SelectMount_tc_selectFromPartialMatchedElement( test_assert(corto_select("*").from("/a/x").iter(&it) == 0); test_assert(corto_iter_hasNext(&it)); - corto_result *r = corto_iter_next(&it); + corto_record *r = corto_iter_next(&it); test_assertstr(r->id, "a"); test_assertstr(r->parent, "."); test_assertstr(r->type, "uint32"); @@ -1523,7 +1523,7 @@ void test_SelectMount_tc_selectFromRootNoInitialSlashInFrom( corto_iter it; corto_select("*").from("data").iter(&it); - corto_result *r; + corto_record *r; test_assert(corto_iter_hasNext(&it)); test_assert ((r = corto_iter_next(&it)) != NULL); @@ -1562,7 +1562,7 @@ void test_SelectMount_tc_selectScopeFromInitialSlashInMountResult( test_assert(corto_select("*").from("data").iter(&it) == 0); test_assert(corto_iter_hasNext(&it) == true); - corto_result *r = corto_iter_next(&it); + corto_record *r = corto_iter_next(&it); test_assert(r != NULL); test_assertstr(r->id, "foo"); test_assertstr(r->parent, "."); @@ -1587,7 +1587,7 @@ void test_SelectMount_tc_selectTreeFromInitialSlashInMountResult( test_assert(corto_select("//").from("data").iter(&it) == 0); test_assert(corto_iter_hasNext(&it) == true); - corto_result *r = corto_iter_next(&it); + corto_record *r = corto_iter_next(&it); test_assert(r != NULL); test_assertstr(r->id, "foo"); test_assertstr(r->parent, "."); diff --git a/test/vstore/src/SelectSink.c b/test/vstore/src/SelectSink.c index 55c74874..64b749d3 100644 --- a/test/vstore/src/SelectSink.c +++ b/test/vstore/src/SelectSink.c @@ -25,7 +25,7 @@ void test_SelectSink_tc_selectLoaderCortoScope( corto_iter it; test_assert(corto_select("/").from("corto").type("package").iter(&it) == 0); - corto_result *r; + corto_record *r; test_assert(corto_iter_hasNext(&it)); r = corto_iter_next(&it); test_assert(r != NULL); @@ -73,7 +73,7 @@ void test_SelectSink_tc_selectLoaderCortoSingle( corto_iter it; test_assert(corto_select("r").from("corto").type("package").iter(&it) == 0); - corto_result *r; + corto_record *r; test_assert(corto_iter_hasNext(&it)); r = corto_iter_next(&it); test_assert(r != NULL); @@ -97,7 +97,7 @@ void test_SelectSink_tc_selectLoaderCortoTree( corto_iter it; test_assert(corto_select("//").from("corto").type("package").iter(&it) == 0); - corto_result *r; + corto_record *r; test_assert(corto_iter_hasNext(&it)); r = corto_iter_next(&it); test_assert(r != NULL); @@ -152,7 +152,7 @@ void test_SelectSink_tc_selectLoaderNestedScope( corto_iter it; test_assert(corto_select("corto/").type("package").iter(&it) == 0); - corto_result *r; + corto_record *r; test_assert(corto_iter_hasNext(&it)); r = corto_iter_next(&it); test_assert(r != NULL); @@ -200,7 +200,7 @@ void test_SelectSink_tc_selectLoaderNestedSingle( corto_iter it; test_assert(corto_select("corto/native").type("package").iter(&it) == 0); - corto_result *r; + corto_record *r; test_assert(corto_iter_hasNext(&it)); r = corto_iter_next(&it); test_assert(r != NULL); @@ -224,7 +224,7 @@ void test_SelectSink_tc_selectLoaderNestedSingleVirtual( corto_iter it; test_assert(corto_select("corto/r").type("package").iter(&it) == 0); - corto_result *r; + corto_record *r; test_assert(corto_iter_hasNext(&it)); r = corto_iter_next(&it); test_assert(r != NULL); @@ -248,7 +248,7 @@ void test_SelectSink_tc_selectLoaderNestedTree( corto_iter it; test_assert(corto_select("corto//").type("package").iter(&it) == 0); - corto_result *r; + corto_record *r; test_assert(corto_iter_hasNext(&it)); r = corto_iter_next(&it); test_assert(r != NULL); @@ -302,7 +302,7 @@ void test_SelectSink_tc_selectLoaderRootScope( corto_iter it; test_assert(corto_select("/").type("package").iter(&it) == 0); - corto_result *r; + corto_record *r; test_assert(corto_iter_hasNext(&it)); r = corto_iter_next(&it); test_assert(r != NULL); @@ -336,7 +336,7 @@ void test_SelectSink_tc_selectLoaderRootSingle( corto_iter it; test_assert(corto_select("p").type("package").iter(&it) == 0); - corto_result *r; + corto_record *r; test_assert(corto_iter_hasNext(&it)); r = corto_iter_next(&it); test_assert(r != NULL); @@ -360,7 +360,7 @@ void test_SelectSink_tc_selectLoaderRootTree( corto_iter it; test_assert(corto_select("//").type("package").iter(&it) == 0); - corto_result *r; + corto_record *r; test_assert(corto_iter_hasNext(&it)); r = corto_iter_next(&it); test_assert(r != NULL); @@ -482,7 +482,7 @@ void test_SelectSink_tc_selectMixedScope( test_SelectSink this) { corto_iter iter; - corto_result *result; + corto_record *result; /* Create actual objects */ corto_object mount = corto_resolve(root_o, "mount"); @@ -533,7 +533,7 @@ void test_SelectSink_tc_selectMixedScopeNested1( test_SelectSink this) { corto_iter iter; - corto_result *result; + corto_record *result; /* Create actual objects */ corto_object mount = corto_resolve(root_o, "mount"); @@ -585,7 +585,7 @@ void test_SelectSink_tc_selectMixedScopeNested2( test_SelectSink this) { corto_iter iter; - corto_result *result; + corto_record *result; /* Create actual objects */ corto_object mount = corto_resolve(root_o, "mount"); @@ -638,7 +638,7 @@ void test_SelectSink_tc_selectMountInResult( test_SelectSink this) { corto_iter iter; - corto_result *result; + corto_record *result; corto_int16 ret = corto_select("x").from("/mount").iter( &iter ); test_assert(ret == 0); @@ -663,7 +663,7 @@ void test_SelectSink_tc_selectScope( test_SelectSink this) { corto_iter iter; - corto_result *result; + corto_record *result; corto_int16 ret = corto_select("*").from("/mount").iter( &iter ); test_assert(ret == 0); @@ -699,13 +699,13 @@ void test_SelectSink_tc_selectScope( void test_SelectSink_tc_selectScopeWithType( test_SelectSink this) { - corto_result r1 = { + corto_record r1 = { .id = "root", .parent = ".", .type = "int32", .flags = 0 }; - corto_result r2 = { + corto_record r2 = { .id = "obj", .parent = ".", .type = "float32", @@ -716,7 +716,7 @@ void test_SelectSink_tc_selectScopeWithType( corto_iter it; corto_select("root/obj").type("float32").iter(&it); test_assert(corto_iter_hasNext(&it)); - corto_result *r = corto_iter_next(&it); + corto_record *r = corto_iter_next(&it); test_assert(r != NULL); test_assertstr(r->id, "obj"); test_assertstr(r->parent, "/root"); @@ -729,13 +729,13 @@ void test_SelectSink_tc_selectScopeWithType( void test_SelectSink_tc_selectScopeWithTypeFromTreeMount( test_SelectSink this) { - corto_result r1 = { + corto_record r1 = { .id = "root", .parent = ".", .type = "int32", .flags = 0 }; - corto_result r2 = { + corto_record r2 = { .id = "obj", .parent = ".", .type = "float32", @@ -746,7 +746,7 @@ void test_SelectSink_tc_selectScopeWithTypeFromTreeMount( corto_iter it; corto_select("root/obj").type("float32").iter(&it); test_assert(corto_iter_hasNext(&it)); - corto_result *r = corto_iter_next(&it); + corto_record *r = corto_iter_next(&it); test_assert(r != NULL); test_assertstr(r->id, "obj"); test_assertstr(r->parent, "/root"); @@ -760,7 +760,7 @@ void test_SelectSink_tc_selectSingle( test_SelectSink this) { corto_iter iter; - corto_result *result; + corto_record *result; corto_int16 ret = corto_select("x").from("/mount").iter( &iter ); test_assert(ret == 0); @@ -781,7 +781,7 @@ void test_SelectSink_tc_selectSingleTypeFilter( test_SelectSink this) { corto_iter iter; - corto_result *result; + corto_record *result; // Select single object of the package type corto_int16 ret = corto_select("//native*").iter( &iter ); @@ -803,7 +803,7 @@ void test_SelectSink_tc_selectSingleVirtualNested1( test_SelectSink this) { corto_iter iter; - corto_result *result; + corto_record *result; corto_int16 ret = corto_select("x/a").from("/mount").iter( &iter ); test_assert(ret == 0); @@ -830,7 +830,7 @@ void test_SelectSink_tc_selectSingleVirtualNested2( test_SelectSink this) { corto_iter iter; - corto_result *result; + corto_record *result; corto_int16 ret = corto_select("x/a/k").from("/mount").iter( &iter ); test_assert(ret == 0); @@ -850,7 +850,7 @@ void test_SelectSink_tc_selectSingleVirtualNested2( void test_SelectSink_tc_selectSingleWithType( test_SelectSink this) { - corto_result r1 = { + corto_record r1 = { .id = "a", .parent = ".", .type = "int32", @@ -862,7 +862,7 @@ void test_SelectSink_tc_selectSingleWithType( corto_iter it; corto_select("a").type("int32").iter(&it); test_assert(corto_iter_hasNext(&it)); - corto_result *r = corto_iter_next(&it); + corto_record *r = corto_iter_next(&it); test_assert(r != NULL); test_assertstr(r->id, "a"); test_assertstr(r->parent, ""); @@ -874,7 +874,7 @@ void test_SelectSink_tc_selectSingleWithType( void test_SelectSink_tc_selectSingleWithTypeFromTreeMount( test_SelectSink this) { - corto_result r1 = { + corto_record r1 = { .id = "a", .parent = ".", .type = "int32", @@ -886,7 +886,7 @@ void test_SelectSink_tc_selectSingleWithTypeFromTreeMount( corto_iter it; corto_select("a").type("int32").iter(&it); test_assert(corto_iter_hasNext(&it)); - corto_result *r = corto_iter_next(&it); + corto_record *r = corto_iter_next(&it); test_assert(r != NULL); test_assertstr(r->id, "a"); test_assertstr(r->parent, ""); @@ -898,19 +898,19 @@ void test_SelectSink_tc_selectSingleWithTypeFromTreeMount( void test_SelectSink_tc_selectTreeWithType( test_SelectSink this) { - corto_result r1 = { + corto_record r1 = { .id = "root", .parent = ".", .type = "int32", .flags = 0 }; - corto_result r2 = { + corto_record r2 = { .id = "obj", .parent = ".", .type = "float32", .flags = CORTO_RESULT_LEAF }; - corto_result r3 = { + corto_record r3 = { .id = "nested", .parent = ".", .type = "float32", @@ -923,7 +923,7 @@ void test_SelectSink_tc_selectTreeWithType( corto_iter it; corto_select("//obj").type("float32").iter(&it); test_assert(corto_iter_hasNext(&it)); - corto_result *r = corto_iter_next(&it); + corto_record *r = corto_iter_next(&it); test_assert(r != NULL); test_assertstr(r->id, "obj"); test_assertstr(r->parent, "/root"); @@ -944,19 +944,19 @@ void test_SelectSink_tc_selectTreeWithType( void test_SelectSink_tc_selectTreeWithTypeFromTreeMount( test_SelectSink this) { - corto_result r1 = { + corto_record r1 = { .id = "root", .parent = ".", .type = "int32", .flags = 0 }; - corto_result r2 = { + corto_record r2 = { .id = "obj", .parent = ".", .type = "float32", .flags = CORTO_RESULT_LEAF }; - corto_result r3 = { + corto_record r3 = { .id = "nested", .parent = ".", .type = "float32", @@ -969,7 +969,7 @@ void test_SelectSink_tc_selectTreeWithTypeFromTreeMount( corto_iter it; corto_select("//obj").type("float32").iter(&it); test_assert(corto_iter_hasNext(&it)); - corto_result *r = corto_iter_next(&it); + corto_record *r = corto_iter_next(&it); test_assert(r != NULL); test_assertstr(r->id, "obj"); test_assertstr(r->parent, "/root"); @@ -991,7 +991,7 @@ void test_SelectSink_tc_selectVirtualScopeNested1( test_SelectSink this) { corto_iter iter; - corto_result *result; + corto_record *result; /* Create an actual scope */ corto_object mount = corto_resolve(root_o, "mount"); @@ -1034,7 +1034,7 @@ void test_SelectSink_tc_selectVirtualScopeNested2( test_SelectSink this) { corto_iter iter; - corto_result *result; + corto_record *result; /* Create an actual scope */ corto_object mount = corto_resolve(root_o, "mount"); @@ -1078,7 +1078,7 @@ void test_SelectSink_tc_selectVirtualScopeVirtualNested1( test_SelectSink this) { corto_iter iter; - corto_result *result; + corto_record *result; corto_int16 ret = corto_select("x/a/*").from("/mount").iter( &iter ); test_assert(ret == 0); @@ -1115,7 +1115,7 @@ void test_SelectSink_tc_selectVirtualScopeVirtualNested2( test_SelectSink this) { corto_iter iter; - corto_result *result; + corto_record *result; corto_int16 ret = corto_select("x/a/k/*").from("/mount").iter( &iter ); test_assert(ret == 0); @@ -1152,7 +1152,7 @@ void test_SelectSink_tc_selectVirtualSingleNested1( test_SelectSink this) { corto_iter iter; - corto_result *result; + corto_record *result; corto_object mount = corto_resolve(root_o, "mount"); corto_int32__create_auto(mount, x, 0); @@ -1178,7 +1178,7 @@ void test_SelectSink_tc_selectVirtualSingleNested2( test_SelectSink this) { corto_iter iter; - corto_result *result; + corto_record *result; corto_object mount = corto_resolve(root_o, "mount"); corto_int32__create_auto(mount, x, 0); diff --git a/test/vstore/src/SelectSinkNoOnRequest.c b/test/vstore/src/SelectSinkNoOnRequest.c index 560c4bbf..ab6ba787 100644 --- a/test/vstore/src/SelectSinkNoOnRequest.c +++ b/test/vstore/src/SelectSinkNoOnRequest.c @@ -19,7 +19,7 @@ void test_SelectSinkNoOnRequest_setup( void test_SelectSinkNoOnRequest_tc_selectScope( test_SelectSinkNoOnRequest this) { - corto_result *result; + corto_record *result; corto_iter iter; corto_int16 ret = corto_select("*").from("/mount").iter( &iter ); @@ -48,7 +48,7 @@ void test_SelectSinkNoOnRequest_tc_selectScope( void test_SelectSinkNoOnRequest_tc_selectSingle( test_SelectSinkNoOnRequest this) { - corto_result *result; + corto_record *result; corto_iter iter; corto_int16 ret = corto_select("x").from("/mount").iter( &iter ); diff --git a/test/vstore/src/SelectSinkWithType.c b/test/vstore/src/SelectSinkWithType.c index 3f15d0d5..b6645601 100644 --- a/test/vstore/src/SelectSinkWithType.c +++ b/test/vstore/src/SelectSinkWithType.c @@ -19,7 +19,7 @@ void test_SelectSinkWithType_tc_selectMixedScope( test_SelectSinkWithType this) { corto_iter iter; - corto_result *result; + corto_record *result; /* Create actual objects */ corto_object mount = corto_resolve(root_o, "mount"); @@ -79,7 +79,7 @@ void test_SelectSinkWithType_tc_selectMixedScopeNested1( test_SelectSinkWithType this) { corto_iter iter; - corto_result *result; + corto_record *result; /* Create actual objects */ corto_object mount = corto_resolve(root_o, "mount"); @@ -139,7 +139,7 @@ void test_SelectSinkWithType_tc_selectMixedScopeNested2( test_SelectSinkWithType this) { corto_iter iter; - corto_result *result; + corto_record *result; /* Create actual objects */ corto_object mount = corto_resolve(root_o, "mount"); @@ -200,7 +200,7 @@ void test_SelectSinkWithType_tc_selectMount( test_SelectSinkWithType this) { corto_iter iter; - corto_result *result; + corto_record *result; corto_int16 ret = corto_select("mount").from("/").iter( &iter ); @@ -225,7 +225,7 @@ void test_SelectSinkWithType_tc_selectMountFromParent( corto_release(mount); corto_iter iter; - corto_result *result; + corto_record *result; corto_int16 ret = corto_select("..").from("/mount/x").iter( &iter ); test_assert(ret == 0); @@ -245,7 +245,7 @@ void test_SelectSinkWithType_tc_selectMountFromVirtualParent( test_SelectSinkWithType this) { corto_iter iter; - corto_result *result; + corto_record *result; corto_int16 ret = corto_select("..").from("/mount/x").iter( &iter ); test_assert(ret == 0); @@ -280,7 +280,7 @@ void test_SelectSinkWithType_tc_selectSingleNoMatch( test_SelectSinkWithType this) { corto_iter iter; - corto_result *result; + corto_record *result; corto_object mount = corto_resolve(root_o, "mount"); corto_float32__create_auto(mount, test, 0); diff --git a/test/vstore/src/SimpleMount.c b/test/vstore/src/SimpleMount.c index b4185c8b..ad6a0771 100644 --- a/test/vstore/src/SimpleMount.c +++ b/test/vstore/src/SimpleMount.c @@ -2,11 +2,11 @@ #include -corto_resultIter test_SimpleMount_on_query( +corto_recordIter test_SimpleMount_on_query( test_SimpleMount this, corto_query *query) { - corto_result r = (corto_result) { + corto_record r = (corto_record) { .id = "foo", .parent = ".", .type = "int32", diff --git a/test/vstore/src/SinkMount.c b/test/vstore/src/SinkMount.c index 31586eb2..e7612a27 100644 --- a/test/vstore/src/SinkMount.c +++ b/test/vstore/src/SinkMount.c @@ -16,8 +16,8 @@ int16_t test_SinkMount_construct( corto_string type = this->type ? this->type : "int32"; // First tier - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "x", NULL, ".", @@ -26,8 +26,8 @@ int16_t test_SinkMount_construct( FALSE ); - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "y", NULL, ".", @@ -36,8 +36,8 @@ int16_t test_SinkMount_construct( FALSE ); - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "z", NULL, ".", @@ -47,8 +47,8 @@ int16_t test_SinkMount_construct( ); // Second tier - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "a", NULL, "x", @@ -57,8 +57,8 @@ int16_t test_SinkMount_construct( FALSE ); - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "b", NULL, "x", @@ -67,8 +67,8 @@ int16_t test_SinkMount_construct( FALSE ); - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "c", NULL, "x", @@ -78,8 +78,8 @@ int16_t test_SinkMount_construct( ); // Third tier - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "k", NULL, "x/a", @@ -88,8 +88,8 @@ int16_t test_SinkMount_construct( FALSE ); - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "l", NULL, "x/a", @@ -98,8 +98,8 @@ int16_t test_SinkMount_construct( FALSE ); - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "m", NULL, "x/a", @@ -109,8 +109,8 @@ int16_t test_SinkMount_construct( ); // Fourth tier - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "n", NULL, "x/a/k", @@ -119,8 +119,8 @@ int16_t test_SinkMount_construct( FALSE ); - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "o", NULL, "x/a/k", @@ -129,8 +129,8 @@ int16_t test_SinkMount_construct( FALSE ); - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "p", NULL, "x/a/k", @@ -148,12 +148,12 @@ int16_t test_SinkMount_construct( /* Custom release function */ static void test_SinkMount_iterRelease(corto_iter *iter) { corto_ll_iter_s *data = iter->ctx; - corto_resultList__clear(data->list); + corto_recordList__clear(data->list); corto_ll_free(data->list); corto_ll_iterRelease(iter); } -corto_resultIter test_SinkMount_on_query( +corto_recordIter test_SinkMount_on_query( test_SinkMount this, corto_query *query) { @@ -161,11 +161,11 @@ corto_resultIter test_SinkMount_on_query( corto_ll data = corto_ll_new(); /* Filter items by parent */ - corto_resultIter__foreach(iter, e) { + corto_recordIter__foreach(iter, e) { if (!fnmatch(query->from, e.parent, 0)) { if (!fnmatch(query->select, e.id, 0)) { - corto_result__assign( - corto_resultList__append_alloc(data), + corto_record__assign( + corto_recordList__append_alloc(data), e.id, e.id, e.parent, @@ -198,7 +198,7 @@ int16_t test_SinkMount_on_resume( corto_object o = *object; /* Find object. Do proper error handling, so testcases are easy to debug */ - corto_resultIter__foreach(iter, e) { + corto_recordIter__foreach(iter, e) { if (!strcmp(parent, e.parent)) { if (!strcmp(id, e.id)) { corto_type t = corto_resolve(NULL, e.type); diff --git a/test/vstore/src/StringReplicator.c b/test/vstore/src/StringReplicator.c index 23ad7701..5a80d8ca 100644 --- a/test/vstore/src/StringReplicator.c +++ b/test/vstore/src/StringReplicator.c @@ -22,20 +22,20 @@ int16_t test_StringReplicator_construct( /* Custom release function */ void test_StringReplicator_iterRelease(corto_iter *iter) { corto_ll_iter_s *data = iter->ctx; - corto_resultList__clear(data->list); + corto_recordList__clear(data->list); corto_ll_free(data->list); corto_ll_iterRelease(iter); } -corto_resultIter test_StringReplicator_on_query( +corto_recordIter test_StringReplicator_on_query( test_StringReplicator this, corto_query *query) { corto_ll data = corto_ll_new(); /* Create top level objects */ - corto_result__assign( - corto_resultList__append_alloc(data), + corto_record__assign( + corto_recordList__append_alloc(data), "a", NULL, ".", @@ -43,8 +43,8 @@ corto_resultIter test_StringReplicator_on_query( (corto_word)corto_strdup("{10,20}"), CORTO_RESULT_LEAF ); - corto_result__assign( - corto_resultList__append_alloc(data), + corto_record__assign( + corto_recordList__append_alloc(data), "b", NULL, ".", @@ -52,8 +52,8 @@ corto_resultIter test_StringReplicator_on_query( (corto_word)corto_strdup("{30,40}"), CORTO_RESULT_LEAF ); - corto_result__assign( - corto_resultList__append_alloc(data), + corto_record__assign( + corto_recordList__append_alloc(data), "c", NULL, ".", diff --git a/test/vstore/src/Subscribe.c b/test/vstore/src/Subscribe.c index 94188d75..c2001ff8 100644 --- a/test/vstore/src/Subscribe.c +++ b/test/vstore/src/Subscribe.c @@ -81,7 +81,7 @@ void subscribeResultTest(corto_subscriber_event *e) { test_Subscribe this = e->instance; this->triggered = TRUE; - corto_ptr_copy(&this->result, corto_result_o, &e->data); + corto_ptr_copy(&this->result, corto_record_o, &e->data); } void test_Subscribe_tc_subscribeFromEmpty( diff --git a/test/vstore/src/SubscribeContentType.c b/test/vstore/src/SubscribeContentType.c index 2f38c700..82eb4fec 100644 --- a/test/vstore/src/SubscribeContentType.c +++ b/test/vstore/src/SubscribeContentType.c @@ -192,22 +192,22 @@ void json(corto_subscriber_event *e) { switch(this->eventsReceived) { case 1: test_assertstr(e->data.id, "a"); - json = corto_result_get_text(&e->data); + json = corto_record_get_text(&e->data); test_assertstr(json, "{\"x\":10,\"y\":20}"); break; case 2: test_assertstr(e->data.id, "b"); - json = corto_result_get_text(&e->data); + json = corto_record_get_text(&e->data); test_assertstr(json, "{\"x\":30,\"y\":40}"); break; case 3: test_assertstr(e->data.id, "c"); - json = corto_result_get_text(&e->data); + json = corto_record_get_text(&e->data); test_assertstr(json, "{\"x\":50,\"y\":60}"); break; case 4: test_assertstr(e->data.id, "c"); - json = corto_result_get_text(&e->data); + json = corto_record_get_text(&e->data); test_assertstr(json, "{\"x\":70,\"y\":80}"); break; } @@ -340,22 +340,22 @@ void string(corto_subscriber_event *e) { switch(this->eventsReceived) { case 1: test_assertstr(e->data.id, "a"); - json = corto_result_get_text(&e->data); + json = corto_record_get_text(&e->data); test_assertstr(json, "{10,20}"); break; case 2: test_assertstr(e->data.id, "b"); - json = corto_result_get_text(&e->data); + json = corto_record_get_text(&e->data); test_assertstr(json, "{30,40}"); break; case 3: test_assertstr(e->data.id, "c"); - json = corto_result_get_text(&e->data); + json = corto_record_get_text(&e->data); test_assertstr(json, "{50,60}"); break; case 4: test_assertstr(e->data.id, "c"); - json = corto_result_get_text(&e->data); + json = corto_record_get_text(&e->data); test_assertstr(json, "{70,80}"); break; } diff --git a/test/vstore/src/VirtualMount.c b/test/vstore/src/VirtualMount.c index aa962311..2221232a 100644 --- a/test/vstore/src/VirtualMount.c +++ b/test/vstore/src/VirtualMount.c @@ -12,8 +12,8 @@ int16_t test_VirtualMount_construct( corto_mount_set_format(this, "text/corto"); /* Populate the mount with some demo data */ - corto_result__assign( - corto_resultList__append_alloc(this->data), + corto_record__assign( + corto_recordList__append_alloc(this->data), "a", /* id */ NULL, /* name */ ".", /* parent */ @@ -22,8 +22,8 @@ int16_t test_VirtualMount_construct( TRUE /* is node a leaf */ ); - corto_result__assign( - corto_resultList__append_alloc(this->data), + corto_record__assign( + corto_recordList__append_alloc(this->data), "b", /* id */ NULL, /* name */ ".", /* parent */ @@ -32,8 +32,8 @@ int16_t test_VirtualMount_construct( TRUE /* is node a leaf */ ); - corto_result__assign( - corto_resultList__append_alloc(this->data), + corto_record__assign( + corto_recordList__append_alloc(this->data), "c", /* id */ NULL, /* name */ ".", /* parent */ @@ -45,7 +45,7 @@ int16_t test_VirtualMount_construct( return corto_super_construct(this); } -corto_resultIter test_VirtualMount_on_query( +corto_recordIter test_VirtualMount_on_query( test_VirtualMount this, corto_query *query) { diff --git a/test/vstore/src/VirtualSinkMount.c b/test/vstore/src/VirtualSinkMount.c index f9c3e5eb..0878e38b 100644 --- a/test/vstore/src/VirtualSinkMount.c +++ b/test/vstore/src/VirtualSinkMount.c @@ -12,8 +12,8 @@ int16_t test_VirtualSinkMount_construct( corto_mount(this)->ownership = CORTO_LOCAL_SOURCE; // First tier - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "x", NULL, ".", @@ -22,8 +22,8 @@ int16_t test_VirtualSinkMount_construct( FALSE ); - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "y", NULL, ".", @@ -32,8 +32,8 @@ int16_t test_VirtualSinkMount_construct( FALSE ); - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "z", NULL, ".", @@ -43,8 +43,8 @@ int16_t test_VirtualSinkMount_construct( ); // Second tier - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "a", NULL, "x", @@ -53,8 +53,8 @@ int16_t test_VirtualSinkMount_construct( FALSE ); - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "b", NULL, "x", @@ -63,8 +63,8 @@ int16_t test_VirtualSinkMount_construct( FALSE ); - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "c", NULL, "x", @@ -74,8 +74,8 @@ int16_t test_VirtualSinkMount_construct( ); // Third tier - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "k", NULL, "x/a", @@ -84,8 +84,8 @@ int16_t test_VirtualSinkMount_construct( FALSE ); - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "l", NULL, "x/a", @@ -94,8 +94,8 @@ int16_t test_VirtualSinkMount_construct( FALSE ); - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "m", NULL, "x/a", @@ -105,8 +105,8 @@ int16_t test_VirtualSinkMount_construct( ); // Fourth tier - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "n", NULL, "x/a/k", @@ -115,8 +115,8 @@ int16_t test_VirtualSinkMount_construct( FALSE ); - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "o", NULL, "x/a/k", @@ -125,8 +125,8 @@ int16_t test_VirtualSinkMount_construct( FALSE ); - corto_result__assign( - corto_resultList__append_alloc(this->items), + corto_record__assign( + corto_recordList__append_alloc(this->items), "p", NULL, "x/a/k", @@ -142,12 +142,12 @@ int16_t test_VirtualSinkMount_construct( /* Custom release function */ static void test_VirtualSinkMount_iterRelease(corto_iter *iter) { corto_ll_iter_s *data = iter->ctx; - corto_resultList__clear(data->list); + corto_recordList__clear(data->list); corto_ll_free(data->list); corto_ll_iterRelease(iter); } -corto_resultIter test_VirtualSinkMount_on_query( +corto_recordIter test_VirtualSinkMount_on_query( test_VirtualSinkMount this, corto_query *query) { @@ -155,11 +155,11 @@ corto_resultIter test_VirtualSinkMount_on_query( corto_ll data = corto_ll_new(); /* Filter items by parent */ - corto_resultIter__foreach(iter, e) { + corto_recordIter__foreach(iter, e) { if (!fnmatch(query->from, e.parent, 0)) { if (!fnmatch(query->select, e.id, 0)) { - corto_result__assign( - corto_resultList__append_alloc(data), + corto_record__assign( + corto_recordList__append_alloc(data), e.id, e.id, e.parent,