You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
2.6 KiB

  1. /*
  2. +----------------------------------------------------------------------+
  3. | PHP version 4.0 |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
  6. +----------------------------------------------------------------------+
  7. | This source file is subject to version 2.02 of the PHP license, |
  8. | that is bundled with this package in the file LICENSE, and is |
  9. | available at through the world-wide-web at |
  10. | http://www.php.net/license/2_02.txt. |
  11. | If you did not receive a copy of the PHP license and are unable to |
  12. | obtain it through the world-wide-web, please send a note to |
  13. | license@php.net so we can mail you a copy immediately. |
  14. +----------------------------------------------------------------------+
  15. | Authors: Kristian Koehntopp <kris@koehntopp.de> |
  16. +----------------------------------------------------------------------+
  17. */
  18. /* $Id$ */
  19. #ifndef PHP_RECODE_H
  20. #define PHP_RECODE_H
  21. #ifdef PHP_WIN32
  22. #define PHP_MYSQL_API __declspec(dllexport)
  23. #else
  24. #define PHP_MYSQL_API
  25. #endif
  26. #if HAVE_LIBRECODE
  27. /* Checking for thread safety and issue warning if necessary. */
  28. #ifdef ZTS
  29. #warning Recode module has not been tested for thread-safety.
  30. #endif
  31. /* Recode 3.5 is broken in the sense that it requires the definition
  32. * of a symbol "program_name" in order to link.
  33. */
  34. #define HAVE_BROKEN_RECODE
  35. #ifdef HAVE_STDBOOL_H
  36. # include <stdbool.h>
  37. #else
  38. typedef enum {false = 0, true = 1} bool;
  39. #endif
  40. #include <sys/types.h>
  41. #include <stdio.h>
  42. #include <recode.h>
  43. #include <unistd.h>
  44. extern zend_module_entry recode_module_entry;
  45. #define phpext_recode_ptr &recode_module_entry
  46. extern PHP_MINIT_FUNCTION(recode);
  47. extern PHP_MSHUTDOWN_FUNCTION(recode);
  48. extern PHP_MINFO_FUNCTION(recode);
  49. extern PHP_FUNCTION(recode_string);
  50. extern PHP_FUNCTION(recode_file);
  51. typedef struct {
  52. RECODE_OUTER outer;
  53. } php_recode_globals;
  54. #ifdef ZTS
  55. # define ReSLS_D php_recode_globals *recode_globals
  56. # define ReSLS_DC , ReSLS_D
  57. # define ReSLS_C recode_globals
  58. # define ReSLS_CC , ReSLS_C
  59. # define ReSG(v) (recode_globals->v)
  60. # define ReSLS_FETCH() php_recode_globals *recode_globals = ts_resource(recode_globals_id)
  61. #else
  62. # define ReSLS_D
  63. # define ReSLS_DC
  64. # define ReSLS_C
  65. # define ReSLS_CC
  66. # define ReSG(v) (recode_globals.v)
  67. # define ReSLS_FETCH()
  68. extern PHP_MYSQL_API php_recode_globals recode_globals;
  69. #endif
  70. #else
  71. #define phpext_recode_ptr NULL
  72. #endif
  73. #endif /* PHP_RECODE_H */