apr_iconv.inc 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. {-
  2. * Copyright (c) 1999,2000
  3. * Konstantin Chuguev. All rights reserved.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions
  7. * are met:
  8. * 1. Redistributions of source code must retain the above copyright
  9. * notice, this list of conditions and the following disclaimer.
  10. * 2. Redistributions in binary form must reproduce the above copyright
  11. * notice, this list of conditions and the following disclaimer in the
  12. * documentation and/or other materials provided with the distribution.
  13. * 3. All advertising materials mentioning features or use of this software
  14. * must display the following acknowledgement:
  15. * This product includes software developed by Konstantin Chuguev
  16. * and its contributors.
  17. *
  18. * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  19. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  20. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  21. * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  22. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  23. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  24. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  25. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  26. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  27. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  28. * SUCH DAMAGE.
  29. *
  30. }
  31. {#include "apr.h"
  32. #include "apr_pools.h"
  33. #include <stddef.h>}
  34. {
  35. * API_DECLARE_EXPORT is defined when building the libapriconv dynamic
  36. * library, so that all public symbols are exported.
  37. *
  38. * API_DECLARE_STATIC is defined when including the apriconv public headers,
  39. * to provide static linkage when the dynamic library may be unavailable.
  40. *
  41. * API_DECLARE_STATIC and API_DECLARE_EXPORT are left undefined when
  42. * including the apr-iconv public headers, to import and link the symbols
  43. * from the dynamic libapriconv library and assure appropriate indirection
  44. * and calling conventions at compile time.
  45. }
  46. //#if !defined(WIN32)
  47. {
  48. * The public apr-iconv functions are declared with API_DECLARE(), so they
  49. * use the most portable calling convention. Public apr-iconv functions
  50. * with variable arguments must use API_DECLARE_NONSTD().
  51. *
  52. * @deffunc API_DECLARE(rettype) apr_func(args);
  53. }
  54. //#define API_DECLARE(type) type
  55. {
  56. * The private apr-iconv functions are declared with API_DECLARE_NONSTD(),
  57. * so they use the most optimal C language calling conventions.
  58. *
  59. * @deffunc API_DECLARE(rettype) apr_func(args);
  60. }
  61. //#define API_DECLARE_NONSTD(type) type
  62. {
  63. * All exported apr-iconv variables are declared with API_DECLARE_DATA
  64. * This assures the appropriate indirection is invoked at compile time.
  65. *
  66. * @deffunc API_DECLARE_DATA type apr_variable;
  67. * @tip extern API_DECLARE_DATA type apr_variable; syntax is required for
  68. * declarations within headers to properly import the variable.
  69. }
  70. {#define API_DECLARE_DATA
  71. #elif defined(API_DECLARE_STATIC)
  72. #define API_DECLARE(type) type __stdcall
  73. #define API_DECLARE_NONSTD(type) type
  74. #define API_DECLARE_DATA
  75. #elif defined(API_DECLARE_EXPORT)
  76. #define API_DECLARE(type) __declspec(dllexport) type __stdcall
  77. #define API_DECLARE_NONSTD(type) __declspec(dllexport) type
  78. #define API_DECLARE_DATA __declspec(dllexport)
  79. #else
  80. #define API_DECLARE(type) __declspec(dllimport) type __stdcall
  81. #define API_DECLARE_NONSTD(type) __declspec(dllimport) type
  82. #define API_DECLARE_DATA __declspec(dllimport)
  83. #endif}
  84. {
  85. * apr_iconv_t: charset conversion descriptor type
  86. }
  87. type
  88. apr_iconv_t = Pointer;
  89. Papr_iconv_t = ^apr_iconv_t;
  90. { __BEGIN_DECLS }
  91. function apr_iconv_open(const param1, param2: PChar;
  92. param3: Papr_pool_t; param4: Papr_iconv_t): apr_status_t;
  93. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  94. external LibAPRIconv name LibNamePrefix + 'apr_iconv_open' + LibSuff16;
  95. function apr_iconv(param1: apr_iconv_t; const param2: PPChar;
  96. param3: Papr_pool_t; param4: PPchar;
  97. param5, param6: Papr_size_t): apr_status_t;
  98. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  99. external LibAPRIconv name LibNamePrefix + 'apr_iconv' + LibSuff24;
  100. function apr_iconv_close(param1: apr_iconv_t; param2: Papr_pool_t): apr_status_t;
  101. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  102. external LibAPRIconv name LibNamePrefix + 'apr_iconv_close' + LibSuff8;
  103. { __END_DECLS }