| 1 | /*=========================================================================== |
| 2 | * |
| 3 | * PUBLIC DOMAIN NOTICE |
| 4 | * National Center for Biotechnology Information |
| 5 | * |
| 6 | * This software/database is a "United States Government Work" under the |
| 7 | * terms of the United States Copyright Act. It was written as part of |
| 8 | * the author's official duties as a United States Government employee and |
| 9 | * thus cannot be copyrighted. This software/database is freely available |
| 10 | * to the public for use. The National Library of Medicine and the U.S. |
| 11 | * Government have not placed any restriction on its use or reproduction. |
| 12 | * |
| 13 | * Although all reasonable efforts have been taken to ensure the accuracy |
| 14 | * and reliability of the software and data, the NLM and the U.S. |
| 15 | * Government do not and cannot warrant the performance or results that |
| 16 | * may be obtained by using this software or data. The NLM and the U.S. |
| 17 | * Government disclaim all warranties, express or implied, including |
| 18 | * warranties of performance, merchantability or fitness for any particular |
| 19 | * purpose. |
| 20 | * |
| 21 | * Please cite the author in any work or product based on this material. |
| 22 | * |
| 23 | * =========================================================================== |
| 24 | * |
| 25 | */ |
| 26 | #include <vdb/extern.h>cxx . . $ `<file>/interfaces/vdb/extern.h`/ |
| 27 | |
| 28 | #include <klib/rc.h>cxx . . $ `<file>/interfaces/klib/rc.h`/ |
| 29 | #include <vdb/table.h>cxx . . $ `<file>/interfaces/vdb/table.h`/ |
| 30 | #include <vdb/xform.h>cxx . . $ `<file>/interfaces/vdb/xform.h`/ |
| 31 | #include <kdb/meta.h>cxx . . $ `<file>/interfaces/kdb/meta.h`/ |
| 32 | #include <klib/data-buffer.h>cxx . . $ `<file>/interfaces/klib/data-buffer.h`/ |
| 33 | |
| 34 | #define WRITE_SIDEcxx . . $ `libs/sraxf/set-rna-flag.c:34:9`! 1 |
| 35 | #include "rna-flag-common.c"cxx . . $ `<file>/libs/sraxf/rna-flag-common.c`/ |
| 36 | |
| 37 | static |
| 38 | rc_tcxx . . $ rc_t# CCcxx . . $ `interfaces/kfc/callconv.h:44:11`! set_rna_flagcxx . . $ set_rna_flag(c7f02ef3aabbc98b).(void *Self, const VXformInfocxx . . $ VXformInfo# *info, int64_tcxx . . $ int64_t# row_id, |
| 39 | VRowResultcxx . . $ VRowResult# *rslt, uint32_tcxx . . $ uint32_t# argc, const VRowDatacxx . . $ VRowData# argv[]) |
| 40 | { |
| 41 | struct Selfcxx . . $ Self# *const self = Self; |
| 42 | rc_tcxx . . $ rc_t# rc = 0; |
| 43 | uint32_tcxx . . $ uint32_t# const row_len = (uint32_tcxx . . $ uint32_t#) argv[0]. ucxx . . $ VRowData#u. . datacxx . . $ VRowData#$anonymous_type_1#data. . elem_countcxx . . $ VRowData#$anonymous_type_1#$anonymous_type_2#elem_count.; |
| 44 | uint8_tcxx . . $ uint8_t# const *seq = argv[0]. ucxx . . $ VRowData#u. . datacxx . . $ VRowData#$anonymous_type_1#data. . basecxx . . $ VRowData#$anonymous_type_1#$anonymous_type_2#base.; |
| 45 | |
| 46 | assertcxx . . $ `<external>/4398592474888995393/assert.h:118:11`!(argv[0].u.data.elem_bits == 8); |
| 47 | seq += argv[0]. ucxx . . $ VRowData#u. . datacxx . . $ VRowData#$anonymous_type_1#data. . first_elemcxx . . $ VRowData#$anonymous_type_1#$anonymous_type_2#first_elem.; |
| 48 | |
| 49 | rslt -> datacxx . . $ VRowResult#data. -> elem_bitscxx . . $ KDataBuffer#elem_bits. = 8; |
| 50 | rslt -> elem_countcxx . . $ VRowResult#elem_count. = row_len; |
| 51 | rc = KDataBufferResizecxx . . $ KDataBufferResize(daabdf243431d3e4).(rslt -> datacxx . . $ VRowResult#data., row_len); |
| 52 | if (rc == 0) |
| 53 | rc = self->functioncxx . . $ Self#function.(self, rslt->datacxx . . $ VRowResult#data.->basecxx . . $ KDataBuffer#base., seq, row_len); |
| 54 | |
| 55 | return rc; |
| 56 | } |
| 57 | |
| 58 | /* setRnaFlag |
| 59 | * if metadata(RNA)is not set and in_read contains u/U, set metadata(RNA)to true |
| 60 | * if metadata(RNA)is not set and in_read contains t/T, set metadata(RNA)to false |
| 61 | * otherwise, do nothing |
| 62 | * return in_read |
| 63 | * |
| 64 | * extern function INSDC:dna:text NCBI:SRA:setRnaFlag(INSDC:dna:text in_read); |
| 65 | */ |
| 66 | VTRANSFACT_IMPLcxx . . $ `interfaces/vdb/xform.h:791:9`!(NCBI_SRA_setRnaFlag, 1, 0, 0)(const void *Self, const VXfactInfocxx . . $ VXfactInfo# *info, |
| 67 | VFuncDesccxx . . $ VFuncDesc# *rslt, const VFactoryParamscxx . . $ VFactoryParams# *cp, const VFunctionParamscxx . . $ VFunctionParams# *dp) |
| 68 | { |
| 69 | KMetadatacxx . . $ KMetadata# *meta = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 70 | rc_tcxx . . $ rc_t# rc = VTableOpenMetadataUpdatecxx . . $ VTableOpenMetadataUpdate(dfe13e82c2c71dd7).((VTablecxx . . $ VTable#*)info->tblcxx . . $ VXfactInfo#tbl., & meta); |
| 71 | if (rc == 0) { |
| 72 | rc = makeSelfcxx . . $ makeSelf(9a89feca3d415c13).(rslt, meta); |
| 73 | if (rc == 0) |
| 74 | rslt->ucxx . . $ VFuncDesc#u..rfcxx . . $ VFuncDesc#$anonymous_type_7#rf. = set_rna_flagcxx . . $ set_rna_flag(c7f02ef3aabbc98b).; |
| 75 | } |
| 76 | return rc; |
| 77 | } |