MCPcopy Create free account
hub / github.com/ashvardanian/StringZilla / sz_py_export_strings_as_u64tape

Function sz_py_export_strings_as_u64tape

python/stringzilla.c:581–601  ·  view source on GitHub ↗

* @brief Helper function to export a `Strs` object into `sz_sequence_u64tape_t` components. */

Source from the content-addressed store, hash-verified

579 * @brief Helper function to export a `Strs` object into `sz_sequence_u64tape_t` components.
580 */
581SZ_DYNAMIC sz_bool_t sz_py_export_strings_as_u64tape(PyObject *object, sz_cptr_t *data, sz_u64_t const **offsets,
582 sz_size_t *count) {
583
584 if (!data || !offsets || !count) return sz_false_k;
585 if (!PyObject_TypeCheck(object, &StrsType)) return sz_false_k;
586 Strs *strs = (Strs *)object;
587
588 if (strs->layout == STRS_U64_TAPE) {
589 *data = strs->data.u64_tape.data;
590 *offsets = strs->data.u64_tape.offsets;
591 *count = strs->data.u64_tape.count;
592 return sz_true_k;
593 }
594 else if (strs->layout == STRS_U64_TAPE_VIEW) {
595 *data = strs->data.u64_tape_view.data;
596 *offsets = strs->data.u64_tape_view.offsets;
597 *count = strs->data.u64_tape_view.count;
598 return sz_true_k;
599 }
600 else { return sz_false_k; }
601}
602
603static sz_bool_t sz_py_replace_u32_tape_allocator(Strs *strs, sz_memory_allocator_t *old_allocator,
604 sz_memory_allocator_t *allocator) {

Callers 5

NeedlemanWunsch_callFunction · 0.85
SmithWaterman_callFunction · 0.85
Fingerprints_callFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…