Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. format coff
  2. use32                                   ; Tell compiler to use 32 bit instructions
  3.  
  4. ;section '.export'
  5.  
  6. section '.text'
  7.  
  8. include '../../../../proc32.inc'
  9. include '../../../../macros.inc'
  10. include '../../../../debug-fdo.inc'
  11. include '../../../../dll.inc'
  12.  
  13.  
  14. public mbedtls_init
  15. ;;; Returns 0 on success. -1 on failure.
  16.  
  17. __DEBUG__       = 1
  18. __DEBUG_LEVEL__ = 2
  19.  
  20.  
  21. mbedtls_init:
  22.         pushad
  23.         stdcall dll.Load, @IMPORT
  24.         ;int3
  25.         test    eax, eax
  26.         jnz     .error
  27.        
  28.         popad
  29.         mov eax, 0
  30.         ret
  31.  
  32. .error:
  33.         popad
  34.         mov eax, -1
  35.         ret
  36.  
  37. gmtime:
  38.         jmp [localtime]
  39.  
  40. ;include_debug_strings
  41.  
  42. section '.data'
  43.  
  44. align 4
  45. @IMPORT:
  46. library libc, 'libc.obj', networklib, 'network.obj'
  47. import  libc, \
  48.         memcmp,           'memcmp', \
  49.         printf,           'printf', \
  50.         free,             'free', \
  51.         strlen,           'strlen', \
  52.         _strcmp,          'strcmp', \
  53.         strstr,           'strstr', \
  54.         rand,             'rand', \
  55.         vsnprintf,        'vsnprintf', \
  56.         socket,           'socket', \
  57.         connect,          'connect', \
  58.         close      ,      'close', \
  59.         recv,             'recv', \
  60.         send,             'send', \
  61.         time,             'time', \
  62.         strncmp,          'strncmp', \
  63.         strncpy,          'strncpy', \
  64.         calloc,           'calloc' , \
  65.         snprintf,         'snprintf', \
  66.         localtime,        'localtime'
  67.  
  68. import networklib, \
  69.         inet_addr, 'inet_addr', \
  70.         inet_ntoa, 'inet_ntoa', \
  71.         getaddrinfo, 'getaddrinfo', \
  72.         freeaddrinfo, 'freeaddrinfo'
  73.        
  74. public inet_addr
  75. public inet_ntoa
  76. public getaddrinfo
  77. public freeaddrinfo
  78.  
  79. public rand
  80. public memcmp
  81. public printf
  82. public calloc
  83. public free
  84. public strlen
  85. public _strcmp as 'strcmp'
  86. public strstr
  87. public gmtime
  88. public vsnprintf
  89. public socket
  90. public connect
  91. public close
  92. public recv
  93. public send
  94. public time
  95. public strncmp
  96. public strncpy
  97. public snprintf
  98.