| 49 | const char symlink_header_bytes[SYMLINK_HEADER_SIZE] = {0xF1, 0x1E, 0x00, 0x00}; |
| 50 | |
| 51 | int allocateReadFile(const char *file, void **buffer) { |
| 52 | SceUID fd = sceIoOpen(file, SCE_O_RDONLY, 0); |
| 53 | if (fd < 0) |
| 54 | return fd; |
| 55 | |
| 56 | int size = sceIoLseek32(fd, 0, SCE_SEEK_END); |
| 57 | sceIoLseek32(fd, 0, SCE_SEEK_SET); |
| 58 | |
| 59 | *buffer = malloc(size); |
| 60 | if (!*buffer) { |
| 61 | sceIoClose(fd); |
| 62 | return VITASHELL_ERROR_NO_MEMORY; |
| 63 | } |
| 64 | |
| 65 | int read = sceIoRead(fd, *buffer, size); |
| 66 | sceIoClose(fd); |
| 67 | |
| 68 | return read; |
| 69 | } |
| 70 | |
| 71 | int ReadFile(const char *file, void *buf, int size) { |
| 72 | SceUID fd = sceIoOpen(file, SCE_O_RDONLY, 0); |
no outgoing calls
no test coverage detected