8 #include <disktool_common.h>
11 int main(int argc, char *argv[])
16 for( int i = 1; i < argc; i ++ )
18 if( strcmp("--image", argv[i]) == 0 || strcmp("-i", argv[i]) == 0 ) {
21 fprintf(stderr, "--image/-i takes 2 arguments (ident and path)\n");
25 if( DiskTool_MountImage(argv[i+1], argv[i+2]) ) {
26 fprintf(stderr, "Unable to mount '%s' as '%s'\n", argv[i+2], argv[i+1]);
36 // NOTE: This is in a native compiled file because it needs access to the real errno macro
37 int *Threads_GetErrno(void)
42 // TODO: Move into a helper lib?
43 void itoa(char *buf, uint64_t num, int base, int minLength, char pad)
45 char fmt[] = "%0ll*x";
48 case 8: fmt[5] = 'o'; break;
49 case 10: fmt[5] = 'd'; break;
50 case 16: fmt[5] = 'x'; break;
54 sprintf(buf, fmt+1, minLength, num);
57 sprintf(buf, fmt, minLength, num);
61 int strpos(const char *Str, char Ch)
63 const char *r = strchr(Str, Ch);