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

Function Register_StringFuncs

src/arithmetic/string_funcs/string_funcs.c:734–877  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

732}
733
734void Register_StringFuncs() {
735 SIType *types;
736 SIType ret_type;
737 AR_FuncDesc *func_desc;
738
739 types = array_new(SIType, 2);
740 array_append(types, (T_STRING | T_NULL));
741 array_append(types, T_INT64 | T_NULL);
742 ret_type = T_STRING | T_NULL;
743 func_desc = AR_FuncDescNew("left", AR_LEFT, 2, 2, types, ret_type, false, true);
744 AR_RegFunc(func_desc);
745
746 types = array_new(SIType, 1);
747 array_append(types, (T_STRING | T_NULL));
748 ret_type = T_STRING | T_NULL;
749 func_desc = AR_FuncDescNew("ltrim", AR_LTRIM, 1, 1, types, ret_type, false, true);
750 AR_RegFunc(func_desc);
751
752 types = array_new(SIType, 2);
753 array_append(types, (T_STRING | T_NULL));
754 array_append(types, T_INT64 | T_NULL);
755 ret_type = T_STRING | T_NULL;
756 func_desc = AR_FuncDescNew("right", AR_RIGHT, 2, 2, types, ret_type, false, true);
757 AR_RegFunc(func_desc);
758
759 types = array_new(SIType, 1);
760 array_append(types, (T_STRING | T_NULL));
761 ret_type = T_STRING | T_NULL;
762 func_desc = AR_FuncDescNew("rtrim", AR_RTRIM, 1, 1, types, ret_type, false, true);
763 AR_RegFunc(func_desc);
764
765 types = array_new(SIType, 1);
766 array_append(types, (T_STRING | T_ARRAY | T_NULL));
767 ret_type = T_STRING | T_ARRAY | T_NULL;
768 func_desc = AR_FuncDescNew("reverse", AR_REVERSE, 1, 1, types, ret_type, false, true);
769 AR_RegFunc(func_desc);
770
771 types = array_new(SIType, 3);
772 array_append(types, (T_STRING | T_NULL));
773 array_append(types, T_INT64);
774 array_append(types, T_INT64);
775 ret_type = T_STRING | T_NULL;
776 func_desc = AR_FuncDescNew("substring", AR_SUBSTRING, 2, 3, types, ret_type, false, true);
777 AR_RegFunc(func_desc);
778
779 types = array_new(SIType, 2);
780 array_append(types, (T_ARRAY | T_NULL));
781 array_append(types, T_STRING);
782 ret_type = T_STRING | T_NULL;
783 func_desc = AR_FuncDescNew("string.join", AR_JOIN, 1, 2, types, ret_type, false, true);
784 AR_RegFunc(func_desc);
785
786 types = array_new(SIType, 2);
787 array_append(types, (T_STRING | T_NULL));
788 array_append(types, (T_STRING | T_NULL));
789 ret_type = T_ARRAY | T_NULL;
790 func_desc = AR_FuncDescNew("string.matchRegEx", AR_MATCHREGEX, 2, 2, types, ret_type, false, true);
791 AR_RegFunc(func_desc);

Callers 1

AR_RegisterFuncsFunction · 0.85

Calls 2

AR_FuncDescNewFunction · 0.85
AR_RegFuncFunction · 0.85

Tested by

no test coverage detected