minmprot.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. /*
  2. * Licensed Materials - Property of IBM and/or HCL
  3. *
  4. * IBM Informix Dynamic Server
  5. * (c) Copyright IBM Corporation 1996, 2004 All rights reserved.
  6. * (c) Copyright HCL Technologies Ltd. 2017. All Rights Reserved.
  7. *
  8. ***************************************************************************
  9. *
  10. * Title: minmproto.h
  11. * Description:
  12. * Restricted use memory duration prototypes
  13. * used by datablade developers.
  14. *
  15. ***************************************************************************
  16. */
  17. /*
  18. The definitions of nemd memory durations and prototypes are split into
  19. two separate files to get around build problems in the server. This file
  20. contains the prototypes. The file incl/public/minamedmem.h includes
  21. both sub-files as a convenience to the developer.
  22. */
  23. #ifndef _MINMPROTO_H_
  24. #define _MINMPROTO_H_
  25. #ifndef _MITYPES_H_
  26. #include "mitypes.h"
  27. #endif /*_MITYPES.H_ */
  28. #ifndef _MEMDUR_H_
  29. #include "memdur.h"
  30. #endif /* not _MEMDUR_H_ */
  31. EXTERNC_BEGIN
  32. /*
  33. * Named memory allocation calls
  34. */
  35. /* allocate a named block for the current default duration */
  36. MI_DECL
  37. mi_integer MI_PROC_EXPORT
  38. mi_named_alloc ARGS((mi_integer len,
  39. mi_string *name,
  40. MI_MEMORY_DURATION duration,
  41. void **memptr));
  42. /* allocate and zero a named block using the specified duration */
  43. MI_DECL
  44. mi_integer MI_PROC_EXPORT
  45. mi_named_zalloc ARGS((mi_integer len,
  46. mi_string *name,
  47. MI_MEMORY_DURATION duration,
  48. void **memptr));
  49. /* retrieve the address of a block by name and duration */
  50. MI_DECL
  51. mi_integer MI_PROC_EXPORT
  52. mi_named_get ARGS((mi_string *name,
  53. MI_MEMORY_DURATION duration,
  54. void **memptr));
  55. /* free a block specified by name and duration */
  56. MI_DECL
  57. void MI_PROC_EXPORT
  58. mi_named_free ARGS((mi_string *name,
  59. MI_MEMORY_DURATION duration));
  60. /*
  61. * Routines to manage Mutexes
  62. */
  63. /* (wait for) and lock a named memory mutex */
  64. MI_DECL
  65. mi_integer MI_PROC_EXPORT
  66. mi_lock_memory ARGS((mi_string *name,
  67. MI_MEMORY_DURATION duration));
  68. /* unlock a named memory mutex */
  69. MI_DECL
  70. mi_integer MI_PROC_EXPORT
  71. mi_unlock_memory ARGS((mi_string *name,
  72. MI_MEMORY_DURATION duration));
  73. /* conditionally lock a named memory mutex; return error if already locked */
  74. MI_DECL
  75. mi_integer MI_PROC_EXPORT
  76. mi_try_lock_memory ARGS((mi_string *name,
  77. MI_MEMORY_DURATION duration));
  78. MI_DECL
  79. MI_CONNECTION * MI_PROC_EXPORT
  80. mi_get_session_connection(void);
  81. MI_DECL
  82. mi_lvarchar * MI_PROC_EXPORT
  83. mi_get_cursor_table(mi_lvarchar *curname);
  84. EXTERNC_END
  85. #endif /* _MINMPROTO_H_ */