DiskTool - Side project to use the VFS for image manipulation
[tpg/acess2.git] / Tools / DiskTool / src / main.c
1 /*
2  */
3 #include <stdlib.h>
4 #include <stdio.h>
5 #include <errno.h>
6 #include <stdint.h>
7 #include <string.h>
8
9 // === CODE ===
10 int main(int argc, char *argv[])
11 {
12         return 0;
13 }
14
15 int *Threads_GetErrno(void)
16 {
17         return &errno;
18 }
19
20 // TODO: Move into a helper lib?
21 extern void itoa(char *buf, uint64_t num, int base, int minLength, char pad)
22 {
23         char fmt[] = "%0ll*x";
24         switch(base)
25         {
26         case  8:        fmt[5] = 'o';   break;
27         case 10:        fmt[5] = 'd';   break;
28         case 16:        fmt[5] = 'x';   break;
29         }
30         if(pad != '0') {
31                 fmt[1] = '%';
32                 sprintf(buf, fmt+1, minLength, num);
33         }
34         else {
35                 sprintf(buf, fmt, minLength, num);
36         }
37 }
38
39 int strpos(const char *Str, char Ch)
40 {
41         const char *r = strchr(Str, Ch);
42         if(!r)  return -1;
43         return r - Str;
44 }

UCC git Repository :: git.ucc.asn.au