milo.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616
  1. /**************************************************************************
  2. *
  3. * Licensed Materials - Property of IBM and/or HCL
  4. *
  5. * IBM Informix Dynamic Server
  6. * (c) Copyright IBM Corporation 1996, 2004 All rights reserved.
  7. * (c) Copyright HCL Technologies Ltd. 2017. All Rights Reserved.
  8. *
  9. **************************************************************************/
  10. /***************************************************************************
  11. *
  12. * Title: milo.h
  13. * Description:
  14. * New Large Object Interface for MIAPI
  15. *
  16. ***************************************************************************
  17. */
  18. #ifndef _MILO_H_
  19. #define _MILO_H_
  20. #include "sqlhdr.h"
  21. #include "locator.h"
  22. /* Open Flags
  23. *
  24. * Use locator.h values + a couple of our own
  25. * ifx bits start from low-order, so libmi-specific bits start at high-order
  26. */
  27. #define MI_LO_APPEND LO_APPEND
  28. #define MI_LO_WRONLY LO_WRONLY
  29. #define MI_LO_RDONLY LO_RDONLY /* default */
  30. #define MI_LO_RDWR LO_RDWR
  31. #define MI_LO_DIRTY_READ LO_DIRTY_READ
  32. #define MI_LO_NODIRTY_READ LO_NODIRTY_READ
  33. #define MI_LO_RANDOM LO_RANDOM /* default is determined by optimizer */
  34. #define MI_LO_SEQUENTIAL LO_SEQUENTIAL /* default is determined by optimizer */
  35. #define MI_LO_FORWARD LO_FORWARD /* default */
  36. #define MI_LO_REVERSE LO_REVERSE
  37. #define MI_LO_BUFFER LO_BUFFER /* default */
  38. #define MI_LO_NOBUFFER LO_NOBUFFER
  39. #define MI_LO_LOCKALL LO_LOCKALL /* default */
  40. #define MI_LO_LOCKRANGE LO_LOCKRANGE
  41. #define MI_LO_TRUNC 0x10000000 /* truncate upon open */
  42. #define MI_LO_NOBUFFER_SIZE_THRESHOLD LO_NOBUFFER_SIZE_THRESHOLD
  43. #define MI_LO_OPEN_FLAGS \
  44. ( LO_APPEND | LO_WRONLY | LO_RDONLY | LO_RDWR | LO_DIRTY_READ \
  45. | LO_RANDOM | LO_SEQUENTIAL | LO_FORWARD | LO_REVERSE | LO_BUFFER \
  46. | LO_NOBUFFER | MI_LO_TRUNC | LO_LOCKALL | LO_LOCKRANGE )
  47. /* Symbolic constants for lo_lock and lo_unlock routines */
  48. #define MI_LO_SHARED_MODE LO_SHARED_MODE /* ISSLOCK */
  49. #define MI_LO_EXCLUSIVE_MODE LO_EXCLUSIVE_MODE /* ISXLOCK */
  50. #define MI_LO_CURRENT_END LO_CURRENT_END /* SB_CURR_LOEND */
  51. #define MI_LO_MAX_END LO_MAX_END /* SB_MAX_LOEND */
  52. /* Whence flags for seek */
  53. #define MI_LO_SEEK_SET LO_SEEK_SET /* Set curr. pos. to "offset" */
  54. #define MI_LO_SEEK_CUR LO_SEEK_CUR /* Set curr. pos. to current + "offset" */
  55. #define MI_LO_SEEK_END LO_SEEK_END /* Set curr. pos. to EOF + "offset" */
  56. /* File create & transfer flags
  57. *
  58. * Use values from locator.h + overload with file location
  59. * semantics.
  60. */
  61. #define MI_O_EXCL LO_O_EXCL /* fail if file exists */
  62. #define MI_O_APPEND LO_O_APPEND /* append to end of file */
  63. #define MI_O_TRUNC LO_O_TRUNC /* turncate to 0 if file exists */
  64. #define MI_O_RDWR LO_O_RDWR /* read/write (default) */
  65. #define MI_O_RDONLY LO_O_RDONLY /* read-only (from-flags only) */
  66. #define MI_O_WRONLY LO_O_WRONLY /* write-only (to-flags only) */
  67. #define MI_O_BINARY LO_O_BINARY /* write-only (to-flags only) */
  68. #define MI_O_TEXT LO_O_TEXT /* text-mode (default off)*/
  69. #define MI_O_CLIENT_FILE LO_CLIENT_FILE /* default: file is on client */
  70. #define MI_O_SERVER_FILE LO_SERVER_FILE /* file is on server */
  71. #define MI_ALT_NOBUFFER_CUROPEN LO_ALT_NOBUFFER_CUROPEN /* alter NOBUFFER flag in open flags */
  72. /* Filename Specification */
  73. #define MI_LO_WILDCARD '?'
  74. #define MI_LO_NOSUFFIX '!'
  75. /* multirep data */
  76. typedef mi_integer MI_MULTIREP_SIZE;
  77. #define MI_MULTIREP_SMALL 0
  78. #define MI_MULTIREP_LARGE 1
  79. #define mi_issmall_data(size) ((size) & MI_MULTIREP_LARGE ? MI_FALSE : MI_TRUE)
  80. #define mi_set_large(size) ((void) ((size) |= MI_MULTIREP_LARGE))
  81. /* Data Structures */
  82. /* Large Object handle: opaque struct of declared size */
  83. #define MI_LO_SIZE SB_LOCSIZE
  84. typedef struct mi_lo
  85. {
  86. char dummy[MI_LO_SIZE];
  87. } MI_LO_HANDLE;
  88. /* Descriptor for an open Large Object */
  89. typedef mi_integer MI_LO_FD;
  90. /*
  91. * MI_MUTLIREP_DATA -
  92. *
  93. * Allows user to represent data in a UDT as in-memory or as
  94. * a large object reference. Calling multirep interface with
  95. * MI_MULTIREP_SMALL/LARGE indicates which incarnation the
  96. * given multi-rep obejct is assuming.
  97. *
  98. * The mr_pin_addr is for the backwards compatible mi_large_object_pin/unpin
  99. * calls. It represents the address to reference 'pin'd large object data.
  100. * The caller is responsible for balancing pin/unpin calls. Failure to do
  101. * so can result in resource (i.e., memory) leakage.
  102. *
  103. * For convenience, #defines are given to allow programers to use
  104. *
  105. * MI_MULTIREP_DATA mr;
  106. * ...
  107. * my_mrlo_func(mr.mr_lo,...); // uses #define
  108. * my_mrdata_func(mr.mr_data,...);
  109. * my_mrpindata_func(mr.mr_pin_data,...); // uses #define
  110. */
  111. typedef union
  112. {
  113. void * mr_data;
  114. struct _mr_lo_struct
  115. {
  116. MI_LO_HANDLE mr_s_lo;
  117. void * mr_s_pin_addr;
  118. } mr_lo_struct;
  119. } MI_MULTIREP_DATA;
  120. #define mr_lo mr_lo_struct.mr_s_lo
  121. #define mr_lo_pin_data mr_lo_struct.mr_s_pin_addr
  122. #define MI_OLD_LO_IDENSIZE 18
  123. #define MI_LO_IDENSIZE 128
  124. /* stat type */
  125. #define MI_STATMAXLEN 256
  126. typedef struct mi_statretval
  127. {
  128. mi_unsigned_smallint stattype;
  129. mi_unsigned_smallint tid;
  130. mi_unsigned_integer xid;
  131. MI_MULTIREP_SIZE szind; /* MI_MULTIREP_SMALL or LARGE */
  132. mi_unsigned_integer align;
  133. union _statdata
  134. {
  135. MI_MULTIREP_DATA mr;
  136. mi_char buffer[MI_STATMAXLEN];
  137. } statdata;
  138. } mi_statret;
  139. #define mi_stat_buf statdata.buffer
  140. #define mi_stat_mr statdata.mr
  141. #define mi_stat_hdrsize (sizeof(mi_statret)-sizeof(union _statdata))
  142. /* MI_LO_SPEC -- Large Object create-time attributes
  143. * Always call mi_lo_spec_init() to allocate and initialize to default values
  144. * Call mi_lo_spec_free() to free.
  145. * The user-accessible fields are:
  146. * flags; estimated size in bytes; max size in bytes;
  147. * size of extent in kilobytes; sbspace name
  148. */
  149. typedef struct ifx_lo_create_spec_s MI_LO_SPEC;
  150. /* estimated size [bytes]
  151. * mi_integer // returns 0 or error
  152. * mi_lo_specget_estbytes (MI_LO_SPEC *cspec, mi_int8 *out);
  153. * mi_integer // returns 0 or error
  154. * mi_lo_specset_estbytes (MI_LO_SPEC *cspec, mi_int8 *val);
  155. */
  156. /* maximum size [bytes]
  157. * mi_integer // returns 0 or error
  158. * mi_lo_specget_maxbytes (MI_LO_SPEC *cspec, mi_int8 *out);
  159. * mi_integer // returns 0 or error
  160. * mi_lo_specset_maxbytes (MI_LO_SPEC *cspec, mi_int8 *val);
  161. */
  162. /* extent size [kilobytes]
  163. * mi_integer // returns the size
  164. * mi_lo_specget_extsz (MI_LO_SPEC *cspec);
  165. * mi_integer // returns 0 or error
  166. * mi_lo_specset_extsz (MI_LO_SPEC *cspec, mi_integer val);
  167. */
  168. /* sbspace name
  169. * mi_integer // returns 0 or error
  170. * mi_lo_specget_sbspace (MI_LO_SPEC *cspec, char *outbuf, int outbufsize);
  171. * mi_integer // returns 0 or error
  172. * mi_lo_specset_sbspace (MI_LO_SPEC *cspec, const char *val);
  173. */
  174. /* flags
  175. * mi_integer // returns the flags
  176. * mi_lo_specget_flags (MI_LO_SPEC *cspec);
  177. * mi_integer // returns 0 or error
  178. * mi_lo_specset_flags (MI_LO_SPEC *cspec, mi_integer flags);
  179. */
  180. /* the bitflags */
  181. #define MI_LO_ATTR_LOG LO_ATTR_LOG
  182. #define MI_LO_ATTR_NO_LOG LO_ATTR_NOLOG
  183. #define MI_LO_ATTR_DELAY_LOG LO_ATTR_DELAY_LOG
  184. #define MI_LO_ATTR_KEEP_LASTACCESS_TIME LO_ATTR_KEEP_LASTACCESS_TIME
  185. #define MI_LO_ATTR_NOKEEP_LASTACCESS_TIME LO_ATTR_NOKEEP_LASTACCESS_TIME
  186. #define MI_LO_ATTR_HIGH_INTEG LO_ATTR_HIGH_INTEG
  187. #define MI_LO_ATTR_MODERATE_INTEG LO_ATTR_MODERATE_INTEG
  188. /* (implemented directly by standard informix library) */
  189. #define mi_lo_specset_flags ifx_lo_specset_flags
  190. #define mi_lo_specset_def_open_flags ifx_lo_specset_def_open_flags
  191. #define mi_lo_specset_estbytes ifx_lo_specset_estbytes
  192. #define mi_lo_specset_maxbytes ifx_lo_specset_maxbytes
  193. #define mi_lo_specset_extsz ifx_lo_specset_extsz
  194. #define mi_lo_specset_sbspace ifx_lo_specset_sbspace
  195. #define mi_lo_specget_flags ifx_lo_specget_flags
  196. #define mi_lo_specget_def_open_flags ifx_lo_specget_def_open_flags
  197. #define mi_lo_specget_estbytes ifx_lo_specget_estbytes
  198. #define mi_lo_specget_maxbytes ifx_lo_specget_maxbytes
  199. #define mi_lo_specget_extsz ifx_lo_specget_extsz
  200. #define mi_lo_specget_sbspace ifx_lo_specget_sbspace
  201. /* MI_LO_STAT -- Large Object dynamic status
  202. * Allocated by mi_lo_stat(); call mi_lo_stat_free() to free.
  203. * Matches struct ifx_lo_stat from locator.h
  204. * The user-readable fields are:
  205. * current size in bytes; owner uid; last access time;
  206. * last modification time; last status change time;
  207. * reference count; UDT type code.
  208. */
  209. typedef struct ifx_lo_stat_s MI_LO_STAT;
  210. /* size --
  211. * mi_int8 * mi_lo_stat_size (MI_LO_STAT *stat, mi_int8 *out); // returns out
  212. * owner --
  213. * mi_integer mi_lo_stat_uid (MI_LO_STAT *stat);
  214. * access time --
  215. * mi_integer mi_lo_stat_atime (MI_LO_STAT *stat);
  216. * mod time --
  217. * mi_integer mi_lo_stat_mtime_sec (MI_LO_STAT *stat);
  218. * mi_integer mi_lo_stat_mtime_usec (MI_LO_STAT *stat);
  219. * status change time --
  220. * mi_integer mi_lo_stat_ctime (MI_LO_STAT *stat);
  221. * ref ct --
  222. * mi_integer mi_lo_stat_refcnt (MI_LO_STAT *stat);
  223. * get create spec from the stat --
  224. * MI_LO_SPEC * mi_lo_stat_cspec (MI_LO_STAT *stat);
  225. */
  226. /* (implemented directly by standard informix library) */
  227. #define mi_lo_stat_size ifx_lo_stat_size
  228. #define mi_lo_stat_uid ifx_lo_stat_uid
  229. #define mi_lo_stat_atime ifx_lo_stat_atime
  230. #define mi_lo_stat_mtime_sec ifx_lo_stat_mtime_sec
  231. #define mi_lo_stat_mtime_usec ifx_lo_stat_mtime_usec
  232. #define mi_lo_stat_ctime ifx_lo_stat_ctime
  233. #define mi_lo_stat_refcnt ifx_lo_stat_refcnt
  234. #define mi_lo_stat_cspec ifx_lo_stat_cspec
  235. /*
  236. ** This is the C binding for the lolist type. Used
  237. ** in the lohandles() support function.
  238. */
  239. typedef struct _mi_lolist
  240. {
  241. mi_integer lol_cnt; /* number of handles */
  242. MI_LO_HANDLE lol_handles[1]; /* array of lol_cnt handles */
  243. } MI_LO_LIST;
  244. /* Function Prototypes */
  245. EXTERNC_BEGIN
  246. /* constructor */
  247. MI_DECL
  248. mi_integer MI_PROC_EXPORT
  249. mi_lo_spec_init ARGS((MI_CONNECTION *conn, MI_LO_SPEC **cspecp));
  250. /* destructor */
  251. MI_DECL
  252. mi_integer MI_PROC_EXPORT
  253. mi_lo_spec_free ARGS((MI_CONNECTION *conn, MI_LO_SPEC *cspec));
  254. MI_DECL
  255. mi_integer MI_PROC_EXPORT
  256. mi_lo_colinfo_by_name ARGS((MI_CONNECTION *conn,
  257. const char *column_spec,
  258. MI_LO_SPEC *cspec));
  259. MI_DECL
  260. mi_integer MI_PROC_EXPORT
  261. mi_lo_colinfo_by_ids ARGS((MI_CONNECTION *conn,
  262. MI_ROW *row,
  263. mi_integer column_num,
  264. MI_LO_SPEC *cspec));
  265. MI_DECL
  266. mi_integer MI_PROC_EXPORT
  267. mi_lo_validate ARGS((MI_CONNECTION *conn,
  268. MI_LO_HANDLE *lohndl));
  269. MI_DECL
  270. mi_integer MI_PROC_EXPORT
  271. mi_lo_invalidate ARGS((MI_CONNECTION *conn,
  272. MI_LO_HANDLE *lohndl));
  273. /* Make a new large object; leave open for i/o.
  274. * Return value is LO descriptor.
  275. * Also returns LO handle: if (*hbuf) is a (MI_LO_HANDLE *) pointing
  276. * to a handle buffer, and copy the handle to the buffer.
  277. * Or, if input (*hbuf == 0), allocate a handle buffer, set (*hbuf) to
  278. * its address, and copy the handle to the buffer.
  279. */
  280. MI_DECL
  281. MI_LO_FD MI_PROC_EXPORT /* on error returns MI_ERROR */
  282. mi_lo_create ARGS((MI_CONNECTION *conn,
  283. MI_LO_SPEC *spec, /* in: attributes */
  284. mi_integer flags, /* in: i/o modes, LO_RDONLY etc */
  285. MI_LO_HANDLE **hbuf)); /* in/out - double indirection */
  286. MI_DECL
  287. MI_LO_FD MI_PROC_EXPORT /* on error returns MI_ERROR */
  288. mi_lo_copy ARGS((MI_CONNECTION *conn,
  289. MI_LO_HANDLE *srclo, /* in: source LO for copy */
  290. MI_LO_SPEC *spec, /* in: attributes */
  291. mi_integer flags, /* in: i/o modes, LO_RDONLY etc */
  292. MI_LO_HANDLE **destlo)); /* in/out - double indirection */
  293. /* open an existing lg obj for i/o */
  294. MI_DECL
  295. MI_LO_FD MI_PROC_EXPORT
  296. mi_lo_open ARGS((MI_CONNECTION *conn,
  297. MI_LO_HANDLE *loptr, /* in: establishes the LO to open */
  298. mi_integer flags)); /* in: access options */
  299. MI_DECL
  300. mi_integer MI_PROC_EXPORT
  301. mi_lo_close ARGS((MI_CONNECTION *conn, MI_LO_FD lofd));
  302. MI_DECL
  303. mi_integer MI_PROC_EXPORT
  304. mi_lo_release ARGS((MI_CONNECTION *conn,
  305. MI_LO_HANDLE *lohandle));
  306. MI_DECL
  307. mi_integer MI_PROC_EXPORT
  308. mi_lo_delete_immediate ARGS((MI_CONNECTION *conn,
  309. MI_LO_HANDLE *lohandle));
  310. MI_DECL
  311. mi_integer MI_PROC_EXPORT
  312. mi_lo_delete_immediate ARGS((MI_CONNECTION *conn,
  313. MI_LO_HANDLE *lohandle));
  314. /* 0 if equal, 1 if no equal, MI_ERROR on error */
  315. MI_DECL
  316. mi_integer MI_PROC_EXPORT
  317. mi_lo_ptr_cmp ARGS((MI_CONNECTION *conn,
  318. MI_LO_HANDLE *loptr1, MI_LO_HANDLE *loptr2));
  319. /* Lock routines */
  320. MI_DECL
  321. mi_integer MI_PROC_EXPORT /* returns MI_OK or MI_ERROR */
  322. mi_lo_lock ARGS((MI_CONNECTION *conn,
  323. MI_LO_FD lofd,
  324. mi_int8 *offset,
  325. mi_integer whence,
  326. mi_int8 *range,
  327. mi_integer lockmode));
  328. MI_DECL
  329. mi_integer MI_PROC_EXPORT /* returns MI_OK or MI_ERROR */
  330. mi_lo_unlock ARGS((MI_CONNECTION *conn,
  331. MI_LO_FD lofd,
  332. mi_int8 *offset,
  333. mi_integer whence,
  334. mi_int8 *range));
  335. /* I/O routines */
  336. MI_DECL
  337. mi_integer MI_PROC_EXPORT
  338. mi_lo_seek ARGS((MI_CONNECTION *conn,
  339. MI_LO_FD lofd,
  340. mi_int8 *offset,
  341. mi_integer whence,
  342. mi_int8 *posn)); /* result */
  343. MI_DECL
  344. mi_integer MI_PROC_EXPORT /* returns 0 or MI_ERROR */
  345. mi_lo_tell ARGS((MI_CONNECTION *conn,
  346. MI_LO_FD lofd,
  347. mi_int8 *posn)); /* result */
  348. MI_DECL
  349. mi_integer MI_PROC_EXPORT /* returns # bytes read */
  350. mi_lo_read ARGS((MI_CONNECTION *conn,
  351. MI_LO_FD lofd,
  352. char *buf,
  353. mi_integer nbytes));
  354. MI_DECL
  355. mi_integer MI_PROC_EXPORT /* returns # bytes written */
  356. mi_lo_write ARGS((MI_CONNECTION *conn,
  357. MI_LO_FD lofd,
  358. const char *src,
  359. mi_integer nbytes));
  360. /* combo of seek & (read or write): */
  361. MI_DECL
  362. mi_integer MI_PROC_EXPORT
  363. mi_lo_readwithseek ARGS((MI_CONNECTION *conn,
  364. MI_LO_FD lofd,
  365. char *buf,
  366. mi_integer nbytes,
  367. mi_int8 *offset,
  368. mi_integer whence));
  369. MI_DECL
  370. mi_integer MI_PROC_EXPORT
  371. mi_lo_writewithseek ARGS((MI_CONNECTION *conn,
  372. MI_LO_FD lofd,
  373. const char *src,
  374. mi_integer nbytes,
  375. mi_int8 *offset,
  376. mi_integer whence));
  377. /* expand and open: returns both FD and HANDLE like mi_lo_create */
  378. MI_DECL
  379. MI_LO_FD MI_PROC_EXPORT /* on error returns MI_ERROR */
  380. mi_lo_expand ARGS((MI_CONNECTION *conn,
  381. MI_LO_HANDLE **hbuf, /* in/out */
  382. MI_MULTIREP_DATA *mrptr, /* in */
  383. mi_integer len,
  384. mi_integer openflags,
  385. MI_LO_SPEC *spec));
  386. MI_DECL
  387. mi_integer MI_PROC_EXPORT
  388. mi_lo_truncate ARGS((MI_CONNECTION *conn,
  389. MI_LO_FD lofd,
  390. mi_int8 *offset));
  391. MI_DECL
  392. const char * MI_PROC_EXPORT
  393. mi_lo_filename ARGS((MI_CONNECTION *conn,
  394. MI_LO_HANDLE *loptr,
  395. const char *fname_spec));
  396. /* make a new LO from a file: leaves open.
  397. * returns both FD and HANDLE like mi_lo_create */
  398. MI_DECL
  399. MI_LO_FD MI_PROC_EXPORT
  400. mi_lo_from_file ARGS((MI_CONNECTION *conn,
  401. MI_LO_HANDLE **hbuf,
  402. const char *fname,
  403. mi_integer flags,
  404. mi_integer offset,
  405. mi_integer amount,
  406. MI_LO_SPEC *lospec));
  407. MI_DECL
  408. MI_LO_FD MI_PROC_EXPORT
  409. mi_lo_from_file8 ARGS((MI_CONNECTION *conn,
  410. MI_LO_HANDLE **hbuf,
  411. const char *fname,
  412. mi_integer flags,
  413. mi_int8 offset,
  414. mi_int8 amount,
  415. MI_LO_SPEC *lospec));
  416. MI_DECL
  417. mi_integer MI_PROC_EXPORT
  418. mi_lo_from_file_by_lofd ARGS((MI_CONNECTION *conn,
  419. MI_LO_FD lofd,
  420. const char *fspec,
  421. mi_integer flags,
  422. mi_integer offset,
  423. mi_integer amount));
  424. MI_DECL
  425. mi_integer MI_PROC_EXPORT
  426. mi_lo_from_file_by_lofd8 ARGS((MI_CONNECTION *conn,
  427. MI_LO_FD lofd,
  428. const char *fspec,
  429. mi_integer flags,
  430. mi_int8 offset,
  431. mi_int8 amount));
  432. MI_DECL
  433. const char * MI_PROC_EXPORT
  434. mi_lo_to_file ARGS((MI_CONNECTION *conn,
  435. MI_LO_HANDLE *loptr,
  436. const char *fname_spec,
  437. mi_integer flags,
  438. mi_integer *size));
  439. MI_DECL
  440. const char * MI_PROC_EXPORT
  441. mi_lo_to_file8 ARGS((MI_CONNECTION *conn,
  442. MI_LO_HANDLE *loptr,
  443. const char *fname_spec,
  444. mi_integer flags,
  445. mi_int8 *size));
  446. MI_DECL
  447. mi_integer MI_PROC_EXPORT
  448. mi_lo_alter ARGS((MI_CONNECTION *conn,
  449. MI_LO_HANDLE *loptr,
  450. MI_LO_SPEC *lospec));
  451. /* constructor */
  452. MI_DECL
  453. mi_integer MI_PROC_EXPORT
  454. mi_lo_stat ARGS((MI_CONNECTION *conn,
  455. MI_LO_FD lofd,
  456. MI_LO_STAT **lostat)); /* out */
  457. /* destructor */
  458. MI_DECL
  459. mi_integer MI_PROC_EXPORT
  460. mi_lo_stat_free ARGS((MI_CONNECTION *conn,
  461. MI_LO_STAT *lostat)); /* in */
  462. MI_DECL
  463. mi_integer MI_PROC_EXPORT
  464. mi_lo_decrefcount ARGS((MI_CONNECTION *conn, MI_LO_HANDLE *loptr));
  465. MI_DECL
  466. mi_integer MI_PROC_EXPORT
  467. mi_lo_increfcount ARGS((MI_CONNECTION *conn, MI_LO_HANDLE *loptr));
  468. MI_DECL
  469. char MI_PROC_EXPORT
  470. *mi_lo_to_string ARGS((MI_LO_HANDLE *lo));
  471. MI_DECL
  472. MI_LO_HANDLE MI_PROC_EXPORT
  473. *mi_lo_from_string ARGS((char *str));
  474. MI_DECL
  475. mi_integer MI_PROC_EXPORT
  476. mi_lo_lolist_create ARGS( (MI_CONNECTION *conn,
  477. mi_integer locnt,
  478. MI_LO_HANDLE **loptrs,
  479. MI_LO_LIST **lolist));
  480. MI_DECL
  481. mi_unsigned_char1 * MI_PROC_EXPORT
  482. mi_get_lo_handle ARGS((mi_unsigned_char1 *datap,
  483. MI_LO_HANDLE *refp));
  484. MI_DECL
  485. mi_unsigned_char1 * MI_PROC_EXPORT
  486. mi_put_lo_handle ARGS((mi_unsigned_char1 *datap,
  487. MI_LO_HANDLE *refp));
  488. MI_DECL
  489. mi_integer MI_PROC_EXPORT
  490. mi_lo_to_buffer ARGS( (MI_CONNECTION *conn,
  491. MI_LO_HANDLE *lop,
  492. mi_integer size,
  493. char **buffer) );
  494. MI_DECL
  495. mi_integer MI_PROC_EXPORT
  496. mi_lo_from_buffer ARGS( (MI_CONNECTION *conn,
  497. MI_LO_HANDLE *lop,
  498. mi_integer size,
  499. char *buffer) );
  500. MI_DECL
  501. mi_integer MI_PROC_EXPORT
  502. mi_lo_utimes ARGS((MI_CONNECTION *conn,
  503. MI_LO_HANDLE *lop,
  504. mi_integer access_sec,
  505. mi_integer access_usec,
  506. mi_integer mod_sec,
  507. mi_integer mod_usec) );
  508. EXTERNC_END
  509. #endif /* _MILO_H_ */