You.i Engine
YiPredefPS4.h
Go to the documentation of this file.
1 // © You i Labs Inc. 2000-2017. All rights reserved.
2 #ifndef _YI_PREDEF_PS4_H_
3 #define _YI_PREDEF_PS4_H_
4 
5 #include <stdio.h>
6 #include <stdlib.h>
7 #include <ctype.h>
8 #include <string.h>
9 #include <unistd.h> // for usleep() for upcoming gcc 4.7
10 
11 #include <queue>
12 #include <stack>
13 #include <vector>
14 #include <map>
15 #include <hash_map>
16 #include <list>
17 #include <sstream>
18 #include <iostream>
19 #include <fstream>
20 #include <algorithm>
21 #include <functional>
22 
23 #include <kernel.h>
24 
30 // platform-dependant functions
31 // memory
32 #define YI_SYSTEM_FREE(a) free(a)
33 #define YI_SYSTEM_MALLOC(a) malloc(a)
34 #define YI_SYSTEM_REALLOC(a, b) realloc(a, b)
35 #define YI_MEMCMP(a, b, c) memcmp(a, b, c)
36 #define YI_MEMMOVE(a, b, c) memmove(a, b, c)
37 #define YI_MEMCOPY(a, b, c) memcpy(a, b, c)
38 #define YI_MEMSET(a, b, c) memset(a, b, c)
39 
40 // multi-byte string
41 // NOTE: To be used only when absolutely required.
42 // Wide strings are preferred
43 #define YI_STRCAT(a, b) strcat(a, b)
44 #define YI_STRCHR(a, b) strchr(a, b)
45 #define YI_STRCMP(a, b) strcmp(a, b)
46 #define YI_STRCPY(a, b) strcpy(a, b)
47 #define YI_STRLEN(a) strlen(a)
48 #define YI_STRREV(a) STRREV(a)
49 #define YI_STRNCMP(a, b, c) strncmp(a, b, c)
50 #define YI_STRNICMP(a, b, c) strncmp(a, b, c)
51 #define YI_STRNCAT(a, b, c) strncat(a, b, c)
52 #define YI_STRNCPY(a, b, c) strncpy(a, b, c)
53 #define YI_STRRCHR(a, b) strrchr(a, b)
54 #define YI_STRTOUL(a, b, c) strtoul(a, b, c)
55 #define YI_VSNPRINTF(a, b, c, d) vsnprintf(a, b, c, d)
56 #define YI_STRICMP(a, b) strcasecmp(a, b)
57 #define YI_SPRINTF sprintf
58 #define YI_SNPRINTF snprintf
59 #define YI_ATOI(a) atoi(a)
60 #define YI_ATOF(a) atof(a)
61 
62 // wide string
63 #define YI_WCSCPY WCSCPY
64 #define YI_WCSNCPY WCSNCPY
65 #define YI_WCSLEN WCSLEN
66 #define YI_WCSREV WCSREV
67 #define YI_WCSCMP WCSCMP
68 #define YI_WCSNCMP WCSNCMP
69 #define YI_WCSICMP WCSICMP
70 #define YI_WCSNICMP WCSNICMP
71 #define YI_WCSCAT WCSCAT
72 #define YI_WCSNCAT WCSNCAT
73 #define YI_WCSSTR WCSSTR
74 #define YI_WCSCHR WCSCHR
75 #define YI_SWPRINTF swprintf
76 
77 #define YI_SLEEP(x) sceKernelUsleep((x)*1000)
78 #define YI_USLEEP(x) sceKernelUsleep(x)
79 
80 //File handling
81 #define YI_FILE FILE
82 #define YI_FREAD (int32_t) fread
83 #define YI_FWRITE fwrite
84 #define YI_FGETC fgetc
85 #define YI_FPUTC fputc
86 
87 #define YI_HAS_VIRTUAL_KEYBOARD 1
88 
93 #endif // _YI_PREDEF_PS4_H_