| 139 | file.line(`char** arg${ i } = XS->toStringHandle(the, mxArgv(${ i }));`); |
| 140 | } |
| 141 | writeResultConversion(file) { |
| 142 | if (this.name.startsWith("const ")) { |
| 143 | file.line("XS->fromStringX(the, mxResult, (txString)result);"); |
| 144 | } |
| 145 | else { |
| 146 | file.line("if (result) {"); |
| 147 | file.tab(1); |
| 148 | file.line("XS->fromString(the, mxResult, (txString)result);"); |
| 149 | file.line("free(result);"); |
| 150 | file.tab(-1); |
| 151 | file.line("} else {"); |
| 152 | file.tab(1); |
| 153 | file.line("XS->abort(the, XS_NOT_ENOUGH_MEMORY_EXIT);"); |
| 154 | file.tab(-1); |
| 155 | file.line("}"); |
| 156 | } |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | class UnsignedType extends Type { |