private static extern unsafe Result FindUniqueItemsKeywords(IntPtr instance, char *patternBegin, ulong count, int *output, ulong outputCount, KeywordsMatch matching, uint offset, ref FindUniqueItemsResult itemsResult, ref FindUniqueItemsKeywordsTimings timings);
public static unsafe R <FindUniqueItemsResult, LocalStr> FindUniqueItemsKeywords(IntPtr instance, char[] pattern, int[] output, KeywordsMatch matching, uint offset) { var result = new FindUniqueItemsResult(); var timings = new FindUniqueItemsKeywordsTimings(); fixed(char *patternPtr = pattern) fixed(int *outputPtr = output) { var res = FindUniqueItemsKeywords(instance, patternPtr, (ulong)pattern.LongLength, outputPtr, (ulong)output.LongLength, matching, offset, ref result, ref timings); if (res != Result.Ok) { return(FormatError(res)); } Log.Info($"Find unique items keywords timings: parse: {timings.Parse}ns, find: {timings.Find}ns, unique: {timings.Unique}ns"); return(result); } }
public R <(int[] items, FindUniqueItemsResult result), LocalStr> FindUniqueItemsKeywords(char[] pattern, int count, KeywordsMatch matching, uint offset) { var items = new int[count]; var res = FindUniqueItemsKeywords(instance, pattern, items, matching, offset); if (!res.Ok) { return(res.Error); } return(items, res.Value); }