MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / Register_ListFuncs

Function Register_ListFuncs

src/arithmetic/list_funcs/list_funcs.c:751–888  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

749}
750
751void Register_ListFuncs() {
752 SIType *types;
753 SIType ret_type;
754 AR_FuncDesc *func_desc;
755
756 types = array_new(SIType, 1);
757 array_append(types, SI_ALL);
758 ret_type = T_ARRAY;
759 func_desc = AR_FuncDescNew("tolist", AR_TOLIST, 0, VAR_ARG_LEN, types, ret_type, true, true);
760 AR_RegFunc(func_desc);
761
762 types = array_new(SIType, 1);
763 array_append(types, T_ARRAY | T_NULL);
764 ret_type = T_ARRAY | T_NULL;
765 func_desc = AR_FuncDescNew("toBooleanList", AR_TOBOOLEANLIST, 1, 1, types, ret_type, false, true);
766 AR_RegFunc(func_desc);
767
768 types = array_new(SIType, 1);
769 array_append(types, T_ARRAY | T_NULL);
770 ret_type = T_ARRAY | T_NULL;
771 func_desc = AR_FuncDescNew("toFloatList", AR_TOFLOATLIST, 1, 1, types, ret_type, false, true);
772 AR_RegFunc(func_desc);
773
774 types = array_new(SIType, 1);
775 array_append(types, T_ARRAY | T_NULL);
776 ret_type = T_ARRAY | T_NULL;
777 func_desc = AR_FuncDescNew("toIntegerList", AR_TOINTEGERLIST, 1, 1, types, ret_type, false, true);
778 AR_RegFunc(func_desc);
779
780 types = array_new(SIType, 1);
781 array_append(types, T_ARRAY | T_NULL);
782 ret_type = T_ARRAY | T_NULL;
783 func_desc = AR_FuncDescNew("toStringList", AR_TOSTRINGLIST, 1, 1, types, ret_type, false, true);
784 AR_RegFunc(func_desc);
785
786 types = array_new(SIType, 2);
787 array_append(types, T_ARRAY | T_MAP | SI_GRAPHENTITY | T_NULL);
788 array_append(types, T_INT64 | T_STRING | T_NULL);
789 ret_type = SI_ALL;
790 func_desc = AR_FuncDescNew("subscript", AR_SUBSCRIPT, 2, 2, types, ret_type, true, true);
791 AR_RegFunc(func_desc);
792
793 types = array_new(SIType, 3);
794 array_append(types, T_ARRAY | T_NULL);
795 array_append(types, T_INT64 | T_NULL);
796 array_append(types, T_INT64 | T_NULL);
797 ret_type = T_ARRAY | T_NULL;
798 func_desc = AR_FuncDescNew("slice", AR_SLICE, 3, 3, types, ret_type, true, true);
799 AR_RegFunc(func_desc);
800
801 types = array_new(SIType, 3);
802 array_append(types, T_INT64);
803 array_append(types, T_INT64);
804 array_append(types, T_INT64);
805 ret_type = T_ARRAY | T_NULL;
806 func_desc = AR_FuncDescNew("range", AR_RANGE, 2, 3, types, ret_type, false, true);
807 AR_RegFunc(func_desc);
808

Callers 1

AR_RegisterFuncsFunction · 0.85

Calls 3

AR_FuncDescNewFunction · 0.85
AR_RegFuncFunction · 0.85

Tested by

no test coverage detected