Subversion Repositories Kolibri OS

Rev

Rev 7880 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
7873 rgimad 1
// -------------------------------------------------------------
2
// KWINE is a fork of program PELoad written by 0CodErr
3
// author of fork - rgimad
4
//-------------------------------------------------------------
5
#include "stddef.h"
6
#include 
7
#include "msvcrt.dll.h"
8
 
7894 rgimad 9
#include "string.h"
10
#include "conio.h"
11
#include "stdio.h"
12
#include "stdlib.h"
13
#include "time.h"
14
 
7873 rgimad 15
#include "string.c"
16
#include "conio.c"
17
#include "stdio.c"
18
#include "stdlib.c"
7880 rgimad 19
#include "time.c"
7873 rgimad 20
 
7894 rgimad 21
// note: by default all function in c are cdecl :D
7880 rgimad 22
 
7873 rgimad 23
typedef struct
24
{
25
	char *name;
26
	void *f;
27
} export_t;
28
 
29
// conio
30
const char sz__getch[] = "_getch";
31
const char sz__kbhit[] = "_kbhit";
32
 
33
// stdio
34
const char sz_printf[] = "printf";
35
const char sz_puts[] = "puts";
36
const char sz_gets[] = "gets";
7894 rgimad 37
const char sz_putchar[] = "putchar";
7873 rgimad 38
 
39
//string
40
const char sz_strlen[] = "strlen";
41
const char sz_strcmp[] = "strcmp";
42
const char sz_strcat[] = "strcat";
7894 rgimad 43
const char sz_strchr[] = "strchr";
44
const char sz_strrchr[] = "strrchr";
45
const char sz_strcpy[] = "strcpy";
46
const char sz_strncpy[] = "strncpy";
47
const char sz_memset[] = "memset";
48
const char sz_memcpy[] = "memcpy";
49
const char sz_memcmp[] = "memcmp";
7873 rgimad 50
 
51
// stdlib
7894 rgimad 52
const char sz_srand[] = "srand";
53
const char sz_rand[] = "rand";
7873 rgimad 54
const char sz_malloc[] = "malloc";
55
const char sz_free[] = "free";
56
const char sz_realloc[] = "realloc";
57
//const char sz_[] = "";
58
 
7880 rgimad 59
// time
60
const char sz_time[] = "time";
7894 rgimad 61
const char sz_mktime[] = "mktime";
62
const char sz_localtime[] = "localtime";
63
const char sz_difftime[] = "difftime";
7880 rgimad 64
 
7873 rgimad 65
 
66
//uint32_t EXPORTS[] __asm__("EXPORTS") =
67
export_t EXPORTS[] =
68
{
69
	{sz__getch, (void*)_getch},
70
	{sz__kbhit, (void*)_kbhit},
71
 
72
	{sz_printf, (void*)printf},
73
	{sz_puts, (void*)puts},
74
	{sz_gets, (void*)gets},
7894 rgimad 75
	{sz_putchar, (void*)putchar},
7873 rgimad 76
 
77
	{sz_strlen, (void*)strlen},
78
	{sz_strcmp, (void*)strcmp},
79
	{sz_strcat, (void*)strcat},
7894 rgimad 80
	{sz_strchr, (void*)strchr},
81
	{sz_strrchr, (void*)strrchr},
82
	{sz_strcpy, (void*)strcpy},
83
	{sz_strncpy, (void*)strncpy},
84
	{sz_memset, (void*)memset},
85
	{sz_memcpy, (void*)memcpy},
86
	{sz_memcmp, (void*)memcmp},
7873 rgimad 87
 
7894 rgimad 88
	{sz_srand, (void*)srand},
89
	{sz_rand, (void*)rand},
7873 rgimad 90
	{sz_malloc, (void*)malloc},
91
	{sz_free, (void*)free},
92
	{sz_realloc, (void*)realloc},
7880 rgimad 93
 
94
	{sz_time, (void*)time},
7894 rgimad 95
	{sz_mktime, (void*)mktime},
96
	{sz_localtime, (void*)localtime},
97
	{sz_difftime, (void*)difftime},
7880 rgimad 98
 
7894 rgimad 99
 
7873 rgimad 100
	{NULL, NULL},
101
};
102
 
103
 
104
int lib_init()
105
{
106
	con_init_console_dll();
107
}