Rev 4364 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
3584 | sourcerer | 1 | #include |
2 | #include |
||
3 | #include |
||
4 | |||
5043 | ashmew2 | 5 | #ifdef DBG |
6 | #undef DBG |
||
7 | #endif |
||
8 | #define DBG(s) __menuet__debug_out(s) /* For the debug messages in BOARD */ |
||
9 | //#define DBG(s) LOG((s)) /* So that we see debug in Netsurf's LOG files */ |
||
3584 | sourcerer | 10 | |
11 | /* |
||
12 | long int __divdi3(long int a, long int b) { |
||
5043 | ashmew2 | 13 | //DBG("divdi3\n"); |
3584 | sourcerer | 14 | return 0;} |
15 | */ |
||
16 | |||
17 | /* |
||
18 | long long int __divdi3(long long int a, long long int b) { |
||
5043 | ashmew2 | 19 | DBG("divdi3\n"); |
3584 | sourcerer | 20 | return a/b;} |
21 | */ |
||
22 | |||
23 | |||
24 | char * locale_charset(){ |
||
5043 | ashmew2 | 25 | DBG("Charset is US\n"); |
3584 | sourcerer | 26 | return "US-ASCII";} |
27 | |||
28 | float strtof(const char* str, char** endptr){ |
||
5043 | ashmew2 | 29 | DBG("STRTOOOF\n"); |
3584 | sourcerer | 30 | return 0.0f;} |
31 | |||
32 | |||
33 | char *realpath(const char *path, char *resolved_path){ |
||
34 | char zuup[1024]; |
||
35 | int i; |
||
36 | char *zoo; |
||
37 | char *boo; |
||
38 | char n, s; |
||
39 | |||
40 | if (resolved_path==0) { |
||
5043 | ashmew2 | 41 | DBG("ResPath is null"); |
3584 | sourcerer | 42 | resolved_path=malloc(strlen(path)+1); |
43 | } |
||
44 | |||
45 | zoo=resolved_path; |
||
46 | boo=path; |
||
47 | memcpy(zoo,boo,strlen(boo)); |
||
48 | zoo[strlen(boo)]=0; |
||
49 | |||
50 | |||
51 | for (i=0; i |
||
52 | n=*path; |
||
53 | path++; |
||
54 | s=*path; |
||
55 | |||
56 | if ((n=='/' && s!='/') || (n!='/') ) { |
||
57 | *resolved_path=n; |
||
58 | resolved_path++; |
||
59 | |||
60 | } |
||
61 | } |
||
62 | *resolved_path=0; |
||
63 | |||
64 | |||
65 | |||
5043 | ashmew2 | 66 | DBG("Real path is... \n"); |
3584 | sourcerer | 67 | sprintf (zuup, "A:%s\n", boo); |
5043 | ashmew2 | 68 | DBG(zuup); |
3584 | sourcerer | 69 | sprintf (zuup, "B:%s\n", zoo); |
5043 | ashmew2 | 70 | DBG(zuup); |
3584 | sourcerer | 71 | |
72 | //memcpy(resolved_path, path, strlen(path)); |
||
73 | |||
74 | |||
75 | |||
76 | |||
77 | |||
78 | return zoo; |
||
79 | } |
||
80 | |||
81 | #include |
||
82 | #include |
||
83 | |||
84 | int inet_aton(const char *cp, struct in_addr *inp){ |
||
5043 | ashmew2 | 85 | DBG("No IP\n"); |
3584 | sourcerer | 86 | return 0; |
87 | } |
||
88 | |||
89 | #include |
||
90 | |||
91 | void va_copy(va_list dest, va_list src){ //WHAA |
||
92 | dest=src; |
||
5043 | ashmew2 | 93 | DBG("Some shit...\n"); |
3584 | sourcerer | 94 | } |
95 | |||
96 | |||
97 | |||
98 | void timeradd(struct timeval *a, struct timeval *b, |
||
99 | struct timeval *res){ |
||
100 | |||
101 | (res)->tv_sec = (a)->tv_sec + (b)->tv_sec; |
||
102 | (res)->tv_usec = (a)->tv_usec + (b)->tv_usec; |
||
103 | if ((res)->tv_usec >= 1000000) { |
||
104 | (res)->tv_sec++; |
||
105 | (res)->tv_usec -= 1000000; |
||
106 | } |
||
5043 | ashmew2 | 107 | //DBG("Timeradd\n"); |
3584 | sourcerer | 108 | } |
109 | |||
110 | void timersub(struct timeval *a, struct timeval *b, |
||
111 | struct timeval *res){ |
||
112 | |||
113 | res->tv_sec=a->tv_sec - b->tv_sec; |
||
114 | res->tv_usec=a->tv_usec - b->tv_usec; |
||
115 | if ((res)->tv_usec < 0) { |
||
116 | (res)->tv_sec--; |
||
117 | (res)->tv_usec += 1000000; |
||
118 | } |
||
5043 | ashmew2 | 119 | // DBG("Timersub\n"); |
3584 | sourcerer | 120 | } |
121 | |||
122 | |||
123 | |||
124 | int timerisset(struct timeval *tvp){ |
||
125 | |||
5043 | ashmew2 | 126 | //DBG("Timer is set?\n"); |
3584 | sourcerer | 127 | |
128 | return ((tvp)->tv_sec || (tvp)->tv_usec); |
||
129 | |||
130 | } |
||
131 | |||
132 | int timercmp(struct timeval *a, struct timeval *b, int z){ |
||
133 | |||
5043 | ashmew2 | 134 | //DBG("Timercmp is a MACRO \n"); |
3584 | sourcerer | 135 | |
136 | if (a->tv_sec > b->tv_sec) return 1; //was 1 |
||
137 | return 0;} |
||
138 | |||
139 | int wctomb(char *s, int wchar){ |
||
140 | |||
5043 | ashmew2 | 141 | DBG("wctomb\n"); |
3584 | sourcerer | 142 | return 0;} |
143 | |||
144 | int wcrtomb(char * s, int wc, int * ps){ |
||
5043 | ashmew2 | 145 | DBG("wcrtomb\n"); |
3584 | sourcerer | 146 | return 0; |
147 | } |
||
148 | |||
149 | int mbrtowc(int * pwc, const char * s, |
||
150 | int n, int * ps){ |
||
5043 | ashmew2 | 151 | DBG("mbrtowc\n"); |
3584 | sourcerer | 152 | return 0;} |
153 | |||
154 | int johab_hangul_decompose( const char * s){ |
||
5043 | ashmew2 | 155 | DBG("hanguul?\n"); |
3584 | sourcerer | 156 | return 0;}> |