summaryrefslogtreecommitdiff
path: root/os2/OS2/ExtAttr/ExtAttr.xs
blob: 1f4e203cec92141b0398c962d1af8ea3dcd6daa1 (plain)
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
#ifdef __cplusplus
extern "C" {
#endif
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#ifdef __cplusplus
}
#endif

#include "myea.h"

SV *
my_eadvalue(pTHX_ _ead ead, int index)
{
    SV *sv;
    int size = _ead_value_size(ead, index);
    const char *p;

    if (size == -1) {
	Perl_die(aTHX_ "Error getting size of EA: %s", strerror(errno));
    }
    p = _ead_get_value(ead, index);
    return  newSVpv(p, size);
}

#define my_eadreplace(ead, index, sv, flag)	\
	_ead_replace((ead), (index), flag, SvPVX(sv), SvCUR(sv))

#define my_eadadd(ead, name, sv, flag)	\
	_ead_add((ead), (name), flag, SvPVX(sv), SvCUR(sv))


MODULE = OS2::ExtAttr		PACKAGE = OS2::ExtAttr	PREFIX = my_ead

SV *
my_eadvalue(ead, index)
	_ead	ead
	int	index
    CODE:
	RETVAL = my_eadvalue(aTHX_ ead, index);
    OUTPUT:
	RETVAL

int
my_eadreplace(ead, index, sv, flag = 0)
	_ead	ead
	int	index
	SV *	sv
	int	flag

int
my_eadadd(ead, name, sv, flag = 0)
	_ead	ead
	char *	name
	SV *	sv
	int	flag

MODULE = OS2::ExtAttr		PACKAGE = OS2::ExtAttr	PREFIX = _ea


void
_ea_free(ptr)
	struct _ea *	ptr

int
_ea_get(dst, path, handle, name)
	struct _ea *	dst
	char *	path
	int	handle
	char *	name

int
_ea_put(src, path, handle, name)
	struct _ea *	src
	char *	path
	int	handle
	char *	name

int
_ea_remove(path, handle, name)
	char *	path
	int	handle
	char *	name

MODULE = OS2::ExtAttr		PACKAGE = OS2::ExtAttr	PREFIX = _ead

int
_ead_add(ead, name, flags, value, size)
	_ead	ead
	char *	name
	int	flags
	void *	value
	int	size

void
_ead_clear(ead)
	_ead	ead

int
_ead_copy(dst_ead, src_ead, src_index)
	_ead	dst_ead
	_ead	src_ead
	int	src_index

int
_ead_count(ead)
	_ead	ead

_ead
_ead_create()

int
_ead_delete(ead, index)
	_ead	ead
	int	index

void
_ead_destroy(ead)
	_ead	ead

int
_ead_fea2list_size(ead)
	_ead	ead

void *
_ead_fea2list_to_fealist(src)
	void *	src

void *
_ead_fealist_to_fea2list(src)
	void *	src

int
_ead_find(ead, name)
	_ead	ead
	char *	name

const void *
_ead_get_fea2list(ead)
	_ead	ead

int
_ead_get_flags(ead, index)
	_ead	ead
	int	index

const char *
_ead_get_name(ead, index)
	_ead	ead
	int	index

const void *
_ead_get_value(ead, index)
	_ead	ead
	int	index

int
_ead_name_len(ead, index)
	_ead	ead
	int	index

int
_ead_read(ead, path, handle, flags)
	_ead	ead
	char *	path
	int	handle
	int	flags

int
_ead_replace(ead, index, flags, value, size)
	_ead	ead
	int	index
	int	flags
	void *	value
	int	size

void
_ead_sort(ead)
	_ead	ead

int
_ead_use_fea2list(ead, src)
	_ead	ead
	void *	src

int
_ead_value_size(ead, index)
	_ead	ead
	int	index

int
_ead_write(ead, path, handle, flags)
	_ead	ead
	char *	path
	int	handle
	int	flags