File: XStringSetList_class.c

package info (click to toggle)
r-bioc-biostrings 2.42.1-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 14,652 kB
  • ctags: 721
  • sloc: ansic: 10,262; sh: 11; makefile: 2
file content (45 lines) | stat: -rw-r--r-- 1,334 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/****************************************************************************
 *             Low-level manipulation of XStringSetList objects             *
 *                            Author: H. Pag\`es                            *
 ****************************************************************************/
#include "Biostrings.h"
#include "IRanges_interface.h"
#include "S4Vectors_interface.h"


/****************************************************************************
 * C-level abstract getters.
 */

XStringSetList_holder _hold_XStringSetList(SEXP x)
{
	XStringSetList_holder x_holder;
	SEXP x_end;

	x_holder.classname = get_classname(x);
	x_end = get_PartitioningByEnd_end(get_CompressedList_partitioning(x));
	x_holder.length = LENGTH(x_end);
	x_holder.end = INTEGER(x_end);
	x_holder.unlistData_holder = _hold_XStringSet(
			get_CompressedList_unlistData(x));
	return x_holder;
}

int _get_length_from_XStringSetList_holder(
		const XStringSetList_holder *x_holder)
{
	return x_holder->length;
}

XStringSet_holder _get_elt_from_XStringSetList_holder(
		const XStringSetList_holder *x_holder, int i)
{
	int offset, length;

	offset = i == 0 ? 0 : x_holder->end[i - 1];
	length = x_holder->end[i] - offset;
	return _get_linear_subset_from_XStringSet_holder(
			&(x_holder->unlistData_holder),
			offset, length);
}