File: pyregf_multi_string.h

package info (click to toggle)
libregf 20201007-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 13,520 kB
  • sloc: ansic: 205,673; sh: 6,206; makefile: 1,569; python: 389; cpp: 88; sed: 16
file content (90 lines) | stat: -rw-r--r-- 2,279 bytes parent folder | download
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/*
 * Python object definition of the sequence and iterator object of a multi string
 *
 * Copyright (C) 2009-2020, Joachim Metz <joachim.metz@gmail.com>
 *
 * Refer to AUTHORS for acknowledgements.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */

#if !defined( _PYREGF_MULTI_STRING_H )
#define _PYREGF_MULTI_STRING_H

#include <common.h>
#include <types.h>

#include "pyregf_libregf.h"
#include "pyregf_python.h"

#if defined( __cplusplus )
extern "C" {
#endif

typedef struct pyregf_multi_string pyregf_multi_string_t;

struct pyregf_multi_string
{
	/* Python object initialization
	 */
	PyObject_HEAD

	/* The libregf multi string
	 */
	libregf_multi_string_t *multi_string;

	/* The parent object
	 */
	PyObject *parent_object;

	/* The current index
	 */
	int current_index;

	/* The number of items
	 */
	int number_of_items;
};

extern PyTypeObject pyregf_multi_string_type_object;

PyObject *pyregf_multi_string_new(
           libregf_multi_string_t *multi_string,
           PyObject *parent_object );

int pyregf_multi_string_init(
     pyregf_multi_string_t *sequence_object );

void pyregf_multi_string_free(
      pyregf_multi_string_t *sequence_object );

Py_ssize_t pyregf_multi_string_len(
            pyregf_multi_string_t *sequence_object );

PyObject *pyregf_multi_string_getitem(
           pyregf_multi_string_t *sequence_object,
           Py_ssize_t item_index );

PyObject *pyregf_multi_string_iter(
           pyregf_multi_string_t *sequence_object );

PyObject *pyregf_multi_string_iternext(
           pyregf_multi_string_t *sequence_object );

#if defined( __cplusplus )
}
#endif

#endif /* !defined( _PYREGF_MULTI_STRING_H ) */