apr_dso.inc 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. { Copyright 2000-2005 The Apache Software Foundation or its licensors, as
  2. * applicable.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. }
  16. {
  17. * @file apr_dso.h
  18. * @brief APR Dynamic Object Handling Routines
  19. }
  20. {#include "apr.h"
  21. #include "apr_pools.h"
  22. #include "apr_errno.h"}
  23. {
  24. * @defgroup apr_dso Dynamic Object Handling
  25. * @ingroup APR
  26. }
  27. {$define APR_HAS_DSO}
  28. {$if defined(APR_HAS_DSO) or defined(DOXYGEN)}
  29. {
  30. * Structure for referencing dynamic objects
  31. }
  32. type
  33. apr_dso_handle_t = record
  34. end;
  35. Papr_dso_handle_t = ^apr_dso_handle_t;
  36. PPapr_dso_handle_t = ^Papr_dso_handle_t;
  37. {
  38. * Structure for referencing symbols from dynamic objects
  39. }
  40. apr_dso_handle_sym_t = Pointer;
  41. Papr_dso_handle_sym_t = ^apr_dso_handle_sym_t;
  42. PPapr_dso_handle_sym_t = ^Papr_dso_handle_sym_t;
  43. {
  44. * Load a DSO library.
  45. * @param res_handle Location to store new handle for the DSO.
  46. * @param path Path to the DSO library
  47. * @param ctx Pool to use.
  48. * @bug We aught to provide an alternative to RTLD_GLOBAL, which
  49. * is the only supported method of loading DSOs today.
  50. }
  51. function apr_dso_load(res_handle: PPapr_dso_handle_t; const path: PChar;
  52. ctx: Papr_pool_t): apr_status_t;
  53. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  54. external LibAPR name LibNamePrefix + 'apr_dso_load' + LibSuff12;
  55. {
  56. * Close a DSO library.
  57. * @param handle handle to close.
  58. }
  59. function apr_dso_unload(handle: Papr_dso_handle_t): apr_status_t;
  60. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  61. external LibAPR name LibNamePrefix + 'apr_dso_unload' + LibSuff4;
  62. {
  63. * Load a symbol from a DSO handle.
  64. * @param ressym Location to store the loaded symbol
  65. * @param handle handle to load the symbol from.
  66. * @param symname Name of the symbol to load.
  67. }
  68. function apr_dso_sym(ressym: Papr_dso_handle_t; handle: Papr_dso_handle_t;
  69. const symname: PChar): apr_status_t;
  70. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  71. external LibAPR name LibNamePrefix + 'apr_dso_sym' + LibSuff12;
  72. {
  73. * Report more information when a DSO function fails.
  74. * @param dso The dso handle that has been opened
  75. * @param buf Location to store the dso error
  76. * @param bufsize The size of the provided buffer
  77. }
  78. function apr_dso_error(dso: Papr_dso_handle_t; buf: PChar;
  79. bufsize: apr_size_t): PChar;
  80. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  81. external LibAPR name LibNamePrefix + 'apr_dso_error' + LibSuff12;
  82. {$endif}