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

Function sz_py_export_strings_as_u32tape

python/stringzilla.c:556–576  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

554 * @brief Helper function to export a `Strs` object into `sz_sequence_u32tape_t` components.
555 */
556SZ_DYNAMIC sz_bool_t sz_py_export_strings_as_u32tape(PyObject *object, sz_cptr_t *data, sz_u32_t const **offsets,
557 sz_size_t *count) {
558
559 if (!data || !offsets || !count) return sz_false_k;
560 if (!PyObject_TypeCheck(object, &StrsType)) return sz_false_k;
561 Strs *strs = (Strs *)object;
562
563 if (strs->layout == STRS_U32_TAPE) {
564 *data = strs->data.u32_tape.data;
565 *offsets = strs->data.u32_tape.offsets;
566 *count = strs->data.u32_tape.count;
567 return sz_true_k;
568 }
569 else if (strs->layout == STRS_U32_TAPE_VIEW) {
570 *data = strs->data.u32_tape_view.data;
571 *offsets = strs->data.u32_tape_view.offsets;
572 *count = strs->data.u32_tape_view.count;
573 return sz_true_k;
574 }
575 else { return sz_false_k; }
576}
577
578/**
579 * @brief Helper function to export a `Strs` object into `sz_sequence_u64tape_t` components.

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…