Subversion Repositories Kolibri OS

Rev

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

  1. format elf
  2. use32                                   ; Tell compiler to use 32 bit instructions
  3.  
  4. ; ELF section
  5. section '.text' executable
  6.  
  7.  
  8. include '../../../../../proc32.inc'
  9. include '../../../../../macros.inc'
  10. purge section,mov,add,sub
  11.        
  12. include '../../../../../dll.inc'
  13.  
  14.        
  15. public init_libimg as 'kolibri_libimg_init'
  16. ;;; Returns 0 on success. -1 on failure.
  17.  
  18. proc init_libimg
  19. local retval dd ?
  20.         mov [retval], eax
  21.         pusha
  22.         mcall 68, 11
  23.         test eax, eax
  24.         jnz @f
  25.                 mov [retval], -1
  26.                 jmp exit_init_libimg
  27. @@:    
  28.         stdcall dll.Load, @IMPORT
  29.         test eax, eax
  30.         jz      exit_init_libimg
  31.                 mov [retval], -1
  32. exit_init_libimg:      
  33.         popa
  34.         mov eax, [retval]
  35.         ret
  36. endp   
  37.  
  38. ; ELF section
  39. section '.data' writeable
  40.  
  41. @IMPORT:
  42. library lib_libimg,     'libimg.obj'
  43.  
  44. import lib_libimg, \
  45.         libimg_init, 'lib_init' , \
  46.         img_is_img, 'img_is_img' , \
  47.         img_info, 'img_info' , \
  48.         img_from_file, 'img_from_file', \
  49.         img_to_file, 'img_to_file', \
  50.         img_from_rgb, 'img_from_rgb', \
  51.         img_to_rgb, 'img_to_rgb', \
  52.         img_to_rgb2, 'img_to_rgb2', \
  53.         img_decode, 'img_decode', \
  54.         img_encode, 'img_encode', \
  55.         img_create, 'img_create', \
  56.         img_destroy, 'img_destroy', \
  57.         img_destroy_layer, 'img_destroy_layer', \
  58.         img_count, 'img_count', \
  59.         img_lock_bits, 'img_lock_bits', \
  60.         img_unlock_bits, 'img_unlock_bits', \
  61.         img_flip, 'img_flip', \
  62.         img_flip_layer, 'img_flip_layer', \
  63.         img_rotate, 'img_rotate', \
  64.         img_rotate_layer, 'img_rotate_layer', \
  65.         img_draw, 'img_draw'
  66.        
  67. public libimg_init as  'libimg_init'
  68. ;       public img_is_img as  '_img_is_img'
  69. ;public img_info as  '_img_info'
  70. ;public img_from_file as  '_img_from_file'
  71. ;public img_to_file as  '_img_to_file'
  72. ;public img_from_rgb as  '_img_from_rgb'
  73. public img_to_rgb as  'img_to_rgb'
  74. public img_to_rgb2 as  'img_to_rgb2'
  75. public img_decode as  'img_decode'
  76. public img_encode as  'img_encode'
  77. public img_create as  'img_create'
  78. public img_destroy as  'img_destroy'
  79. public img_destroy_layer as  'img_destroy_layer'
  80. public img_count as  'img_count'
  81. ;public img_lock_bits as  '_img_lock_bits'
  82. ;public img_unlock_bits as  '_img_unlock_bits'
  83. public img_flip as  'img_flip'
  84. public img_flip_layer as  'img_flip_layer'
  85. public img_rotate as  'img_rotate'
  86. public img_rotate_layer as  'img_rotate_layer'
  87. public img_draw as  'img_draw'
  88.