xref: /openbsd-src/gnu/usr.bin/perl/os2/OS2/OS2-ExtAttr/ExtAttr.xs (revision b39c515898423c8d899e35282f4b395f7cad3298)
1*b39c5158Smillert #ifdef __cplusplus
2*b39c5158Smillert extern "C" {
3*b39c5158Smillert #endif
4*b39c5158Smillert #include "EXTERN.h"
5*b39c5158Smillert #include "perl.h"
6*b39c5158Smillert #include "XSUB.h"
7*b39c5158Smillert #ifdef __cplusplus
8*b39c5158Smillert }
9*b39c5158Smillert #endif
10*b39c5158Smillert 
11*b39c5158Smillert #include "myea.h"
12*b39c5158Smillert 
13*b39c5158Smillert SV *
my_eadvalue(pTHX_ _ead ead,int index)14*b39c5158Smillert my_eadvalue(pTHX_ _ead ead, int index)
15*b39c5158Smillert {
16*b39c5158Smillert     SV *sv;
17*b39c5158Smillert     int size = _ead_value_size(ead, index);
18*b39c5158Smillert     const char *p;
19*b39c5158Smillert 
20*b39c5158Smillert     if (size == -1) {
21*b39c5158Smillert 	Perl_die(aTHX_ "Error getting size of EA: %s", strerror(errno));
22*b39c5158Smillert     }
23*b39c5158Smillert     p = _ead_get_value(ead, index);
24*b39c5158Smillert     return  newSVpv(p, size);
25*b39c5158Smillert }
26*b39c5158Smillert 
27*b39c5158Smillert #define my_eadreplace(ead, index, sv, flag)	\
28*b39c5158Smillert 	_ead_replace((ead), (index), flag, SvPVX(sv), SvCUR(sv))
29*b39c5158Smillert 
30*b39c5158Smillert #define my_eadadd(ead, name, sv, flag)	\
31*b39c5158Smillert 	_ead_add((ead), (name), flag, SvPVX(sv), SvCUR(sv))
32*b39c5158Smillert 
33*b39c5158Smillert 
34*b39c5158Smillert MODULE = OS2::ExtAttr		PACKAGE = OS2::ExtAttr	PREFIX = my_ead
35*b39c5158Smillert 
36*b39c5158Smillert SV *
37*b39c5158Smillert my_eadvalue(ead, index)
38*b39c5158Smillert 	_ead	ead
39*b39c5158Smillert 	int	index
40*b39c5158Smillert     CODE:
41*b39c5158Smillert 	RETVAL = my_eadvalue(aTHX_ ead, index);
42*b39c5158Smillert     OUTPUT:
43*b39c5158Smillert 	RETVAL
44*b39c5158Smillert 
45*b39c5158Smillert int
46*b39c5158Smillert my_eadreplace(ead, index, sv, flag = 0)
47*b39c5158Smillert 	_ead	ead
48*b39c5158Smillert 	int	index
49*b39c5158Smillert 	SV *	sv
50*b39c5158Smillert 	int	flag
51*b39c5158Smillert 
52*b39c5158Smillert int
53*b39c5158Smillert my_eadadd(ead, name, sv, flag = 0)
54*b39c5158Smillert 	_ead	ead
55*b39c5158Smillert 	char *	name
56*b39c5158Smillert 	SV *	sv
57*b39c5158Smillert 	int	flag
58*b39c5158Smillert 
59*b39c5158Smillert MODULE = OS2::ExtAttr		PACKAGE = OS2::ExtAttr	PREFIX = _ea
60*b39c5158Smillert 
61*b39c5158Smillert 
62*b39c5158Smillert void
63*b39c5158Smillert _ea_free(ptr)
64*b39c5158Smillert 	struct _ea *	ptr
65*b39c5158Smillert 
66*b39c5158Smillert int
67*b39c5158Smillert _ea_get(dst, path, handle, name)
68*b39c5158Smillert 	struct _ea *	dst
69*b39c5158Smillert 	char *	path
70*b39c5158Smillert 	int	handle
71*b39c5158Smillert 	char *	name
72*b39c5158Smillert 
73*b39c5158Smillert int
74*b39c5158Smillert _ea_put(src, path, handle, name)
75*b39c5158Smillert 	struct _ea *	src
76*b39c5158Smillert 	char *	path
77*b39c5158Smillert 	int	handle
78*b39c5158Smillert 	char *	name
79*b39c5158Smillert 
80*b39c5158Smillert int
81*b39c5158Smillert _ea_remove(path, handle, name)
82*b39c5158Smillert 	char *	path
83*b39c5158Smillert 	int	handle
84*b39c5158Smillert 	char *	name
85*b39c5158Smillert 
86*b39c5158Smillert MODULE = OS2::ExtAttr		PACKAGE = OS2::ExtAttr	PREFIX = _ead
87*b39c5158Smillert 
88*b39c5158Smillert int
89*b39c5158Smillert _ead_add(ead, name, flags, value, size)
90*b39c5158Smillert 	_ead	ead
91*b39c5158Smillert 	char *	name
92*b39c5158Smillert 	int	flags
93*b39c5158Smillert 	void *	value
94*b39c5158Smillert 	int	size
95*b39c5158Smillert 
96*b39c5158Smillert void
97*b39c5158Smillert _ead_clear(ead)
98*b39c5158Smillert 	_ead	ead
99*b39c5158Smillert 
100*b39c5158Smillert int
101*b39c5158Smillert _ead_copy(dst_ead, src_ead, src_index)
102*b39c5158Smillert 	_ead	dst_ead
103*b39c5158Smillert 	_ead	src_ead
104*b39c5158Smillert 	int	src_index
105*b39c5158Smillert 
106*b39c5158Smillert int
107*b39c5158Smillert _ead_count(ead)
108*b39c5158Smillert 	_ead	ead
109*b39c5158Smillert 
110*b39c5158Smillert _ead
111*b39c5158Smillert _ead_create()
112*b39c5158Smillert 
113*b39c5158Smillert int
114*b39c5158Smillert _ead_delete(ead, index)
115*b39c5158Smillert 	_ead	ead
116*b39c5158Smillert 	int	index
117*b39c5158Smillert 
118*b39c5158Smillert void
119*b39c5158Smillert _ead_destroy(ead)
120*b39c5158Smillert 	_ead	ead
121*b39c5158Smillert 
122*b39c5158Smillert int
123*b39c5158Smillert _ead_fea2list_size(ead)
124*b39c5158Smillert 	_ead	ead
125*b39c5158Smillert 
126*b39c5158Smillert void *
127*b39c5158Smillert _ead_fea2list_to_fealist(src)
128*b39c5158Smillert 	void *	src
129*b39c5158Smillert 
130*b39c5158Smillert void *
131*b39c5158Smillert _ead_fealist_to_fea2list(src)
132*b39c5158Smillert 	void *	src
133*b39c5158Smillert 
134*b39c5158Smillert int
135*b39c5158Smillert _ead_find(ead, name)
136*b39c5158Smillert 	_ead	ead
137*b39c5158Smillert 	char *	name
138*b39c5158Smillert 
139*b39c5158Smillert const void *
140*b39c5158Smillert _ead_get_fea2list(ead)
141*b39c5158Smillert 	_ead	ead
142*b39c5158Smillert 
143*b39c5158Smillert int
144*b39c5158Smillert _ead_get_flags(ead, index)
145*b39c5158Smillert 	_ead	ead
146*b39c5158Smillert 	int	index
147*b39c5158Smillert 
148*b39c5158Smillert const char *
149*b39c5158Smillert _ead_get_name(ead, index)
150*b39c5158Smillert 	_ead	ead
151*b39c5158Smillert 	int	index
152*b39c5158Smillert 
153*b39c5158Smillert const void *
154*b39c5158Smillert _ead_get_value(ead, index)
155*b39c5158Smillert 	_ead	ead
156*b39c5158Smillert 	int	index
157*b39c5158Smillert 
158*b39c5158Smillert int
159*b39c5158Smillert _ead_name_len(ead, index)
160*b39c5158Smillert 	_ead	ead
161*b39c5158Smillert 	int	index
162*b39c5158Smillert 
163*b39c5158Smillert int
164*b39c5158Smillert _ead_read(ead, path, handle, flags)
165*b39c5158Smillert 	_ead	ead
166*b39c5158Smillert 	char *	path
167*b39c5158Smillert 	int	handle
168*b39c5158Smillert 	int	flags
169*b39c5158Smillert 
170*b39c5158Smillert int
171*b39c5158Smillert _ead_replace(ead, index, flags, value, size)
172*b39c5158Smillert 	_ead	ead
173*b39c5158Smillert 	int	index
174*b39c5158Smillert 	int	flags
175*b39c5158Smillert 	void *	value
176*b39c5158Smillert 	int	size
177*b39c5158Smillert 
178*b39c5158Smillert void
179*b39c5158Smillert _ead_sort(ead)
180*b39c5158Smillert 	_ead	ead
181*b39c5158Smillert 
182*b39c5158Smillert int
183*b39c5158Smillert _ead_use_fea2list(ead, src)
184*b39c5158Smillert 	_ead	ead
185*b39c5158Smillert 	void *	src
186*b39c5158Smillert 
187*b39c5158Smillert int
188*b39c5158Smillert _ead_value_size(ead, index)
189*b39c5158Smillert 	_ead	ead
190*b39c5158Smillert 	int	index
191*b39c5158Smillert 
192*b39c5158Smillert int
193*b39c5158Smillert _ead_write(ead, path, handle, flags)
194*b39c5158Smillert 	_ead	ead
195*b39c5158Smillert 	char *	path
196*b39c5158Smillert 	int	handle
197*b39c5158Smillert 	int	flags
198