Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
32 lines (23 sloc) 580 Bytes
#include <stdio.h>
#include <stdlib.h>
#include "hfsplus.h"
void hfs_panic(const char *hfs_panicString) {
fprintf(stderr, "%s\n", hfs_panicString);
exit(1);
}
void printUnicode(HFSUniStr255 *str) {
int i;
for (i = 0; i < str->length; i++) {
printf("%c", (char)(str->unicode[i] & 0xff));
}
}
char *unicodeToAscii(HFSUniStr255 *str) {
int i;
char *toReturn;
toReturn = (char *)malloc(sizeof(char) * (str->length + 1));
for (i = 0; i < str->length; i++) {
toReturn[i] = (char)(str->unicode[i] & 0xff);
}
toReturn[i] = '\0';
return toReturn;
}