lldesqlc.h 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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: lldesqlc.h
  19. * CCid: %W% %E% %U%
  20. * Author: Craig Freedman
  21. * Created: Mon Aug 19 1996
  22. * Description: External include file for the ESQL/C interface
  23. * of the LOB Locator DataBlade
  24. *
  25. ***************************************************************************/
  26. EXEC SQL ifndef IXIlldesqlc_h;
  27. EXEC SQL define IXIlldesqlc_h;
  28. /* ESQL/C macro for the LLD_Locator row type */
  29. /* add lo_reserved field to LLD_Locator_EC! */
  30. EXEC SQL define LLD_Locator_EC (lo_protocol char(LLD_PROTOCOL_LEN), lo_pointer LLD_Lob, lo_location lvarchar(LLD_LOCATOR_LEN));
  31. /* values for the type field of lld_lob_t */
  32. #define LLD_BLOB 0
  33. #define LLD_CLOB 1
  34. /* values for the lld_open flags argument */
  35. #define LLD_RDONLY 1 /* open LOB for read-only access */
  36. #define LLD_WRONLY 2 /* open LOB for write-only access */
  37. #define LLD_RDWR 4 /* open LOB for read-write access */
  38. #define LLD_TRUNC 8 /* truncate LOB to zero length */
  39. #define LLD_APPEND 16 /* open LOB for appending (seek to end) */
  40. #define LLD_SEQ 32 /* open LOB for sequential access only */
  41. #define LLD_NOBUFFER 64 /* open LOB for lite io */
  42. /* values for the lld_seek whence argument */
  43. #define LLD_SEEK_CUR LO_SEEK_CUR /* seek relative to current position */
  44. #define LLD_SEEK_SET LO_SEEK_SET /* seek relative to beginning of LOB */
  45. #define LLD_SEEK_END LO_SEEK_END /* seek relative to end of LOB */
  46. /* LLD_Locator field sizes */
  47. EXEC SQL define LLD_PROTOCOL_LEN 18;
  48. EXEC SQL define LLD_LOCATOR_LEN 1024;
  49. /* error codes */
  50. #define LLD_E_OK 0 /* no error */
  51. #define LLD_E_SQL -1 /* SQL error (ESQL/C only) */
  52. #define LLD_E_INTERNAL -2 /* internal LLD error */
  53. #define LLD_E_ERRNO -3 /* OS error */
  54. #define LLD_E_ROW -4 /* invalid ROW type */
  55. #define LLD_E_PROTOCOL -5 /* invalid lo_protocol value */
  56. #define LLD_E_LOCATION -6 /* invalid lo_location value */
  57. #define LLD_E_EXISTS -7 /* attempt to (re)create an existing LOB */
  58. #define LLD_E_NOTEXIST -8 /* attempt to open a non-existing LOB */
  59. #define LLD_E_FLAGS -9 /* invalid open flags combination */
  60. #define LLD_E_LLDIO -10 /* corrupted LLD_IO structure */
  61. #define LLD_E_RDONLY -11 /* attempt to write a read-only LOB */
  62. #define LLD_E_WRONLY -12 /* attempt to read a write-only LOB */
  63. #define LLD_E_SEQ -13 /* attempt to seek a sequential-only LOB */
  64. #define LLD_E_WHENCE -14 /* invalid whence (seek) value */
  65. #define LLD_E_OFFSET -15 /* attempt to seek to an invalid offset */
  66. #define LLD_E_MEMORY -101 /* out of memory */
  67. #define LLD_E_SERRNO -102 /* server OS error */
  68. /* IFXLOB user defined base type */
  69. typedef struct
  70. {
  71. ifx_lo_t lo; /* smartblob pointer */
  72. int type; /* LLD_BLOB or LLD_CLOB */
  73. } lld_lob_t;
  74. /* the LLD_IO structure is opaque */
  75. typedef struct LLD_IO LLD_IO;
  76. /* function prototypes */
  77. /* ROW LLD_Locator_EC */ ifx_collection_t* lld_create
  78. (/* ROW LLD_Locator_EC */ ifx_collection_t* lob,
  79. int* error);
  80. int lld_create_client (char* path,
  81. int* error);
  82. LLD_IO* lld_open (/* ROW LLD_Locator_EC */ ifx_collection_t* lob,
  83. int flags,
  84. int* error);
  85. LLD_IO* lld_open_client (char* path,
  86. int flags,
  87. int* error);
  88. int lld_read (LLD_IO* io,
  89. void* buffer,
  90. int bytes,
  91. int* error);
  92. int lld_write (LLD_IO* io,
  93. void* buffer,
  94. int bytes,
  95. int* error);
  96. int lld_seek (LLD_IO* io,
  97. ifx_int8_t* offset,
  98. int whence,
  99. ifx_int8_t* new_offset,
  100. int* error);
  101. int lld_tell (LLD_IO* io,
  102. ifx_int8_t* new_offset,
  103. int* error);
  104. int lld_close (LLD_IO* io,
  105. int* error);
  106. int lld_delete (/* ROW LLD_Locator_EC */ ifx_collection_t* lob,
  107. int* error);
  108. int lld_delete_client (char* path,
  109. int* error);
  110. /* ROW LLD_Locator_EC */ ifx_collection_t* lld_copy
  111. (/* ROW LLD_Locator_EC */ ifx_collection_t* src,
  112. /* ROW LLD_Locator_EC */ ifx_collection_t* dest,
  113. int* error);
  114. /* row LLD_Locator_EC */ ifx_collection_t* lld_from_client
  115. (char* src,
  116. /* ROW LLD_Locator_EC */ ifx_collection_t* dest,
  117. int* error);
  118. int lld_to_client (/* ROW LLD_Locator_EC */ ifx_collection_t* src,
  119. char* dest,
  120. int* error);
  121. char* lld_sqlstate (int error);
  122. EXEC SQL endif;