Subversion Repositories Kolibri OS

Rev

Rev 4364 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

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