lldsapi.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. /***************************************************************************
  2. *
  3. * INFORMIX SOFTWARE, INC.
  4. *
  5. * PROPRIETARY DATA
  6. *
  7. * THIS DOCUMENT CONTAINS TRADE SECRET DATA WHICH IS THE PROPERTY OF
  8. * INFORMIX SOFTWARE, INC. THIS DOCUMENT IS SUBMITTED TO RECIPIENT IN
  9. * CONFIDENCE. INFORMATION CONTAINED HEREIN MAY NOT BE USED, COPIED OR
  10. * DISCLOSED IN WHOLE OR IN PART EXCEPT AS PERMITTED BY WRITTEN AGREEMENT
  11. * SIGNED BY AN OFFICER OF INFORMIX SOFTWARE, INC.
  12. *
  13. * THIS MATERIAL IS ALSO COPYRIGHTED AS AN UNPUBLISHED WORK UNDER
  14. * SECTIONS 104 AND 408 OF TITLE 17 OF THE UNITED STATES CODE.
  15. * UNAUTHORIZED USE, COPYING OR OTHER REPRODUCTION IS PROHIBITED BY LAW.
  16. *
  17. *
  18. * Title: lldsapi.h
  19. * CCid: %W% %E% %U%
  20. * Author: Craig Freedman
  21. * Created: Wed Jul 31 1996
  22. * Description: External include file for the server API interface
  23. * of the LOB Locator DataBlade
  24. *
  25. ***************************************************************************/
  26. #ifndef IXIlldsapi_h
  27. #define IXIlldsapi_h
  28. #include <mi.h>
  29. /* values for the type field of lld_lob_t */
  30. #define LLD_BLOB 0
  31. #define LLD_CLOB 1
  32. /* values for the lld_open flags argument */
  33. #define LLD_RDONLY 1 /* open LOB for read-only access */
  34. #define LLD_WRONLY 2 /* open LOB for write-only access */
  35. #define LLD_RDWR 4 /* open LOB for read-write access */
  36. #define LLD_TRUNC 8 /* truncate LOB to zero length */
  37. #define LLD_APPEND 16 /* open LOB for appending (seek to end) */
  38. #define LLD_SEQ 32 /* open LOB for sequential access only */
  39. #define LLD_NOBUFFER 64 /* open LOB for lite io */
  40. #define LLD_DEFERRED 128 /* Open the LOB only when needed to conserve FDs */
  41. /* In deferred open mode an lld is opened only when the functions lld_read,
  42. * lld_write or lld_seek need it. The file or blob opened in deferred mode
  43. * is actually opened transparently to the caller except that lld_read etc may
  44. * fail (and return the error code) where lld_open would have failed.
  45. */
  46. /* values for the lld_seek whence argument */
  47. #define LLD_SEEK_CUR MI_LO_SEEK_CUR /* seek relative to current position */
  48. #define LLD_SEEK_SET MI_LO_SEEK_SET /* seek relative to beginning of LOB */
  49. #define LLD_SEEK_END MI_LO_SEEK_END /* seek relative to end of LOB */
  50. /* LLD_Locator field sizes */
  51. #define LLD_PROTOCOL_LEN 18
  52. /* error codes */
  53. #define LLD_E_OK 0 /* no error */
  54. #define LLD_E_EXCEPTION -1 /* MI_Exception handled (DataBlade API only) */
  55. #define LLD_E_INTERNAL -2 /* internal LLD error */
  56. #define LLD_E_ERRNO -3 /* OS error */
  57. #define LLD_E_ROW -4 /* invalid MI_ROW type */
  58. #define LLD_E_PROTOCOL -5 /* invalid lo_protocol value */
  59. #define LLD_E_LOCATION -6 /* invalid lo_location value */
  60. #define LLD_E_EXISTS -7 /* attempt to (re)create an existing LOB */
  61. #define LLD_E_NOTEXIST -8 /* attempt to open a non-existing LOB */
  62. #define LLD_E_FLAGS -9 /* invalid open flags combination */
  63. #define LLD_E_LLDIO -10 /* corrupted LLD_IO structure */
  64. #define LLD_E_RDONLY -11 /* attempt to write a read-only LOB */
  65. #define LLD_E_WRONLY -12 /* attempt to read a write-only LOB */
  66. #define LLD_E_SEQ -13 /* attempt to seek a sequential-only LOB */
  67. #define LLD_E_WHENCE -14 /* invalid whence (seek) value */
  68. #define LLD_E_OFFSET -15 /* attempt to seek to an invalid offset */
  69. /* IFXLOB user defined base type */
  70. typedef struct
  71. {
  72. MI_LO_HANDLE lo; /* smartblob pointer */
  73. mi_integer type; /* LLD_BLOB or LLD_CLOB */
  74. } lld_lob_t;
  75. /* the LLD_IO structure is opaque */
  76. typedef struct LLD_IO LLD_IO;
  77. /* function prototypes */
  78. /* LLD_Locator */ MI_ROW* lld_create (MI_CONNECTION* conn,
  79. /* LLD_Locator */ MI_ROW* lob,
  80. mi_integer* error);
  81. mi_integer lld_create_client (MI_CONNECTION* conn,
  82. mi_string* path,
  83. mi_integer* error);
  84. LLD_IO* lld_open (MI_CONNECTION* conn,
  85. /* LLD_Locator */ MI_ROW* lob,
  86. mi_integer flags,
  87. mi_integer* error);
  88. LLD_IO* lld_open_client (MI_CONNECTION* conn,
  89. mi_string* path,
  90. mi_integer flags,
  91. mi_integer* error);
  92. mi_integer lld_read (MI_CONNECTION* conn,
  93. LLD_IO* io,
  94. void* buffer,
  95. mi_integer bytes,
  96. mi_integer* error);
  97. mi_integer lld_write (MI_CONNECTION* conn,
  98. LLD_IO* io,
  99. void* buffer,
  100. mi_integer bytes,
  101. mi_integer* error);
  102. mi_integer lld_seek (MI_CONNECTION* conn,
  103. LLD_IO* io,
  104. mi_int8* offset,
  105. mi_integer whence,
  106. mi_int8* new_offset,
  107. mi_integer* error);
  108. mi_integer lld_tell (MI_CONNECTION* conn,
  109. LLD_IO* io,
  110. mi_int8* new_offset,
  111. mi_integer* error);
  112. mi_integer lld_close (MI_CONNECTION* conn,
  113. LLD_IO* io,
  114. mi_integer* error);
  115. mi_integer lld_delete (MI_CONNECTION* conn,
  116. /* LLD_Locator */ MI_ROW* lob,
  117. mi_integer* error);
  118. mi_integer lld_delete_client (MI_CONNECTION* conn,
  119. mi_string* path,
  120. mi_integer* error);
  121. /* LLD_Locator */ MI_ROW* lld_copy (MI_CONNECTION* conn,
  122. /* LLD_Locator */ MI_ROW* src,
  123. /* LLD_Locator */ MI_ROW* dest,
  124. mi_integer* error);
  125. /* LLD_Locator */ MI_ROW* lld_from_client (MI_CONNECTION* conn,
  126. mi_string* src,
  127. /* LLD_Locator */ MI_ROW* dest,
  128. mi_integer* error);
  129. mi_integer lld_to_client (MI_CONNECTION* conn,
  130. /* LLD_Locator */ MI_ROW* src,
  131. mi_string* dest,
  132. mi_integer* error);
  133. mi_string* lld_sqlstate (mi_integer error);
  134. mi_integer lld_error_raise (MI_CONNECTION* conn,
  135. mi_integer error);
  136. #endif