Returns the ASCII character having the binary equivalent to A. If A is larger than 256 the result is equivalent to chr(A % 256).
| 1432 | // Returns the ASCII character having the binary equivalent to A. |
| 1433 | // If A is larger than 256 the result is equivalent to chr(A % 256). |
| 1434 | FORCE_INLINE |
| 1435 | const char* chr_int64(gdv_int64 context, gdv_int64 in, gdv_int32* out_len) { |
| 1436 | in = in % 256; |
| 1437 | *out_len = 1; |
| 1438 | |
| 1439 | char* ret = reinterpret_cast<char*>(gdv_fn_context_arena_malloc(context, *out_len)); |
| 1440 | if (ret == nullptr) { |
| 1441 | gdv_fn_context_set_error_msg(context, "Could not allocate memory for output string"); |
| 1442 | *out_len = 0; |
| 1443 | return ""; |
| 1444 | } |
| 1445 | ret[0] = char(in); |
| 1446 | return ret; |
| 1447 | } |
| 1448 | |
| 1449 | FORCE_INLINE |
| 1450 | const char* convert_fromUTF8_binary(gdv_int64 context, const char* bin_in, gdv_int32 len, |