Advertisement
BigETI

b_io.inc

Apr 24th, 2013
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 5.91 KB | None | 0 0
  1. /*
  2.     Binary files I/O plugin's include made by BigETI © 2013
  3. */
  4. #if defined _B_IO_INCLUDED_
  5.     #endinput
  6. #endif
  7. #define _B_IO_INCLUDED_
  8. #define BIO_ENUM_ENUM                   enum _:
  9. #define BIO_ENUM_8<%0>                  %0
  10. #define BIO_ENUM_8A<%0>[%1]             %0[%1]
  11. #define BIO_ENUM_8T<%0><%1>             %0:%1
  12. #define BIO_ENUM_8TA<%0><%1>[%2]        %0:%1[%2]
  13. #define BIO_ENUM_8AT<%0><%1>[%2]        %0:%1[%2]
  14. #define BIO_ENUM_16<%0>                 %0,__%0_U
  15. #define BIO_ENUM_16A<%0>[%1]            %0[%1],__%0_U[%1]
  16. #define BIO_ENUM_16T<%0><%1>            %0:%1,__%1_U
  17. #define BIO_ENUM_16TA<%0><%1>[%2]       %0:%1[%2],__%1_U[%2]
  18. #define BIO_ENUM_16AT<%0><%1>[%2]       %0:%1[%2],__%1_U[%2]
  19. #define BIO_ENUM_24<%0>                 %0,__%0_U[2]
  20. #define BIO_ENUM_24A<%0>[%1]            %0[%1],__%0_U[(%1)*2]
  21. #define BIO_ENUM_24T<%0><%1>            %0:%1,__%1_U[2]
  22. #define BIO_ENUM_24TA<%0><%1>[%2]       %0:%1[%2],__%1_U[(%2)*2]
  23. #define BIO_ENUM_24AT<%0><%1>[%2]       %0:%1[%2],__%1_U[(%2)*2]
  24. #define BIO_ENUM_32<%0>                 %0,__%0_U[3]
  25. #define BIO_ENUM_32A<%0>[%1]            %0[%1],__%0_U[(%1)*3]
  26. #define BIO_ENUM_32T<%0><%1>            %0:%1,__%1_U[3]
  27. #define BIO_ENUM_32TA<%0><%1>[%2]       %0:%1[%2],__%1_U[(%2)*3]
  28. #define BIO_ENUM_32AT<%0><%1>[%2]       %0:%1[%2],__%1_U[(%2)*3]
  29. #define BIO_ENUM_F<%0>                  Float:%0,__%0_U[3]
  30. #define BIO_ENUM_FA<%0>[%1]             Float:%0[%1],__%0_U[(%1)*3]
  31. #define BIO_exist(%0)                   fexist(%0)
  32. #define BIO_read_f(%0,%1,%2)            Float:(BIO_read_32(%0,%1,%2))
  33. #define BIO_write_f(%0,%1,%2)           BIO_write_32(%0,Float:(%1),%2)
  34. #define BIO_read_f_arr(%0,%1,%2)        BIO_read_32_arr(%0,Float:%1,%2)
  35. #define BIO_write_f_arr(%0,%1,%2)       BIO_write_32_arr(%0,Float:%1,%2)
  36. #define BIO_INST_read_f(%0,%1)          Float:(BIO_read_INST_32(%0,%1))
  37. #define BIO_INST_write_f(%0,%1)         BIO_write_INST_32(Float:(%0),%1)
  38. #define BIO_INST_read_f_arr(%0,%1)      BIO_read_INST_32_arr(Float:%0,%1)
  39. #define BIO_INST_write_f_arr(%0,%1)     BIO_write_INST_32_arr(Float:%0,%1)
  40. enum b_io_mode
  41. {
  42.     b_io_mode_read,
  43.     b_io_mode_write,
  44.     b_io_mode_append,
  45.     b_io_mode_new,
  46.     b_io_mode_add,
  47.     b_io_mode_update
  48. };
  49. native BFile:BIO_open(const file_name[], b_io_mode:mode = b_io_mode_update);
  50. native BFile:BIO_temp();
  51. native BIO_close(BFile:file_handle);
  52. native BIO_read_8(BFile:file_handle, position = 0, seek_whence:whence = seek_current);
  53. native BIO_read_16(BFile:file_handle, position = 0, seek_whence:whence = seek_current);
  54. native BIO_read_24(BFile:file_handle, position = 0, seek_whence:whence = seek_current);
  55. native BIO_read_32(BFile:file_handle, position = 0, seek_whence:whence = seek_current);
  56. native BIO_write_8(BFile:file_handle, value, position = 0, seek_whence:whence = seek_current);
  57. native BIO_write_16(BFile:file_handle, value, position = 0, seek_whence:whence = seek_current);
  58. native BIO_write_24(BFile:file_handle, value, position = 0, seek_whence:whence = seek_current);
  59. native BIO_write_32(BFile:file_handle, value, position = 0, seek_whence:whence = seek_current);
  60. native BIO_read_8_arr(BFile:file_handle, bin_array[], bin_array_len = sizeof bin_array, position = 0, seek_whence:whence = seek_current);
  61. native BIO_read_16_arr(BFile:file_handle, bin_array[], bin_array_len = sizeof bin_array, position = 0, seek_whence:whence = seek_current);
  62. native BIO_read_24_arr(BFile:file_handle, bin_array[], bin_array_len = sizeof bin_array, position = 0, seek_whence:whence = seek_current);
  63. native BIO_read_32_arr(BFile:file_handle, bin_array[], bin_array_len = sizeof bin_array, position = 0, seek_whence:whence = seek_current);
  64. native BIO_write_8_arr(BFile:file_handle, const bin_array[], bin_array_len = sizeof bin_array, position = 0, seek_whence:whence = seek_current);
  65. native BIO_write_16_arr(BFile:file_handle, const bin_array[], bin_array_len = sizeof bin_array, position = 0, seek_whence:whence = seek_current);
  66. native BIO_write_24_arr(BFile:file_handle, const bin_array[], bin_array_len = sizeof bin_array, position = 0, seek_whence:whence = seek_current);
  67. native BIO_write_32_arr(BFile:file_handle, const bin_array[], bin_array_len = sizeof bin_array, position = 0, seek_whence:whence = seek_current);
  68. native bool:BIO_eof(BFile:file_handle);
  69. native bool:BIO_INST_open(const file_name[], b_io_mode:mode = b_io_mode_update);
  70. native bool:BIO_INST_temp();
  71. native bool:BIO_INST_close();
  72. native BIO_INST_read_8(position = 0, seek_whence:whence = seek_current);
  73. native BIO_INST_read_16(position = 0, seek_whence:whence = seek_current);
  74. native BIO_INST_read_24(position = 0, seek_whence:whence = seek_current);
  75. native BIO_INST_read_32(position = 0, seek_whence:whence = seek_current);
  76. native BIO_INST_write_8(value, position = 0, seek_whence:whence = seek_current);
  77. native BIO_INST_write_16(value, position = 0, seek_whence:whence = seek_current);
  78. native BIO_INST_write_24(value, position = 0, seek_whence:whence = seek_current);
  79. native BIO_INST_write_32(value, position = 0, seek_whence:whence = seek_current);
  80. native BIO_INST_read_8_arr(bin_array[], bin_array_len = sizeof bin_array, position = 0, seek_whence:whence = seek_current);
  81. native BIO_INST_read_16_arr(bin_array[], bin_array_len = sizeof bin_array, position = 0, seek_whence:whence = seek_current);
  82. native BIO_INST_read_24_arr(bin_array[], bin_array_len = sizeof bin_array, position = 0, seek_whence:whence = seek_current);
  83. native BIO_INST_read_32_arr(bin_array[], bin_array_len = sizeof bin_array, position = 0, seek_whence:whence = seek_current);
  84. native BIO_INST_write_8_arr(const bin_array[], bin_array_len = sizeof bin_array, position = 0, seek_whence:whence = seek_current);
  85. native BIO_INST_write_16_arr(const bin_array[], bin_array_len = sizeof bin_array, position = 0, seek_whence:whence = seek_current);
  86. native BIO_INST_write_24_arr(const bin_array[], bin_array_len = sizeof bin_array, position = 0, seek_whence:whence = seek_current);
  87. native BIO_INST_write_32_arr(const bin_array[], bin_array_len = sizeof bin_array, position = 0, seek_whence:whence = seek_current);
  88. native bool:BIO_INST_eof();
  89. #define BIO::           BIO_
  90. #define BIO_I::         BIO_INST_
  91. #define BIO_INST::      BIO_INST_
  92. #define BIO_INSTANT::   BIO_INST_
  93. #define BIO_E::         BIO_ENUM_
  94. #define BIO_ENUM::      BIO_ENUM_
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement