Subversion Repositories Kolibri OS

Rev

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

  1. // -------------------------------------------------------------
  2. // KWINE is a fork of program PELoad written by 0CodErr
  3. // author of fork - rgimad
  4. //-------------------------------------------------------------
  5. #include "stddef.h"
  6. #include <stdarg.h>
  7. #include "msvcrt.dll.h"
  8.  
  9. #include "string.h"
  10. #include "conio.h"
  11. #include "stdio.h"
  12. #include "stdlib.h"
  13. #include "time.h"
  14.  
  15. #include "string.c"
  16. #include "conio.c"
  17. #include "stdio.c"
  18. #include "stdlib.c"
  19. #include "time.c"
  20.  
  21. // note: by default all function in c are cdecl :D
  22.  
  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";
  37. const char sz_putchar[] = "putchar";
  38.  
  39. //string
  40. const char sz_strlen[] = "strlen";
  41. const char sz_strcmp[] = "strcmp";
  42. const char sz_strcat[] = "strcat";
  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";
  50.  
  51. // stdlib
  52. const char sz_srand[] = "srand";
  53. const char sz_rand[] = "rand";
  54. const char sz_malloc[] = "malloc";
  55. const char sz_free[] = "free";
  56. const char sz_realloc[] = "realloc";
  57. //const char sz_[] = "";
  58.  
  59. // time
  60. const char sz_time[] = "time";
  61. const char sz_mktime[] = "mktime";
  62. const char sz_localtime[] = "localtime";
  63. const char sz_difftime[] = "difftime";
  64.  
  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},
  75.         {sz_putchar, (void*)putchar},
  76.  
  77.         {sz_strlen, (void*)strlen},
  78.         {sz_strcmp, (void*)strcmp},
  79.         {sz_strcat, (void*)strcat},
  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},
  87.  
  88.         {sz_srand, (void*)srand},
  89.         {sz_rand, (void*)rand},
  90.         {sz_malloc, (void*)malloc},
  91.         {sz_free, (void*)free},
  92.         {sz_realloc, (void*)realloc},
  93.  
  94.         {sz_time, (void*)time},
  95.         {sz_mktime, (void*)mktime},
  96.         {sz_localtime, (void*)localtime},
  97.         {sz_difftime, (void*)difftime},
  98.  
  99.  
  100.         {NULL, NULL},
  101. };
  102.  
  103.  
  104. int lib_init()
  105. {
  106.         con_init_console_dll();
  107. }
  108.