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