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.

121 lines
4.2 KiB

  1. /*
  2. +----------------------------------------------------------------------+
  3. | PHP HTML Embedded Scripting Language Version 3.0 |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1997,1998 PHP Development Team (See Credits file) |
  6. +----------------------------------------------------------------------+
  7. | This program is free software; you can redistribute it and/or modify |
  8. | it under the terms of one of the following licenses: |
  9. | |
  10. | A) the GNU General Public License as published by the Free Software |
  11. | Foundation; either version 2 of the License, or (at your option) |
  12. | any later version. |
  13. | |
  14. | B) the PHP License as published by the PHP Development Team and |
  15. | included in the distribution in the file: LICENSE |
  16. | |
  17. | This program is distributed in the hope that it will be useful, |
  18. | but WITHOUT ANY WARRANTY; without even the implied warranty of |
  19. | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
  20. | GNU General Public License for more details. |
  21. | |
  22. | You should have received a copy of both licenses referred to here. |
  23. | If you did not, or have any questions about PHP licensing, please |
  24. | contact core@php.net. |
  25. +----------------------------------------------------------------------+
  26. | Authors: Jouni Ahto |
  27. +----------------------------------------------------------------------+
  28. */
  29. /* $Id$ */
  30. #ifndef _PHP3_PGSQL_H
  31. #define _PHP3_PGSQL_H
  32. #if COMPILE_DL
  33. #undef HAVE_PGSQL
  34. #define HAVE_PGSQL 1
  35. #endif
  36. #if HAVE_PGSQL
  37. extern php3_module_entry pgsql_module_entry;
  38. #define pgsql_module_ptr &pgsql_module_entry
  39. #include <libpq-fe.h>
  40. #include <libpq/libpq-fs.h>
  41. extern int php3_minit_pgsql(INIT_FUNC_ARGS);
  42. extern int php3_rinit_pgsql(INIT_FUNC_ARGS);
  43. PHP_FUNCTION(pgsql_connect);
  44. PHP_FUNCTION(pgsql_pconnect);
  45. PHP_FUNCTION(pgsql_close);
  46. PHP_FUNCTION(pgsql_dbname);
  47. PHP_FUNCTION(pgsql_error_message);
  48. PHP_FUNCTION(pgsql_options);
  49. PHP_FUNCTION(pgsql_port);
  50. PHP_FUNCTION(pgsql_tty);
  51. PHP_FUNCTION(pgsql_host);
  52. PHP_FUNCTION(pgsql_exec);
  53. PHP_FUNCTION(pgsql_num_rows);
  54. PHP_FUNCTION(pgsql_num_fields);
  55. PHP_FUNCTION(pgsql_cmdtuples);
  56. PHP_FUNCTION(pgsql_field_name);
  57. PHP_FUNCTION(pgsql_field_size);
  58. PHP_FUNCTION(pgsql_field_type);
  59. PHP_FUNCTION(pgsql_field_number);
  60. PHP_FUNCTION(pgsql_result);
  61. PHP_FUNCTION(pgsql_fetch_row);
  62. PHP_FUNCTION(pgsql_fetch_array);
  63. PHP_FUNCTION(pgsql_fetch_object);
  64. PHP_FUNCTION(pgsql_data_length);
  65. PHP_FUNCTION(pgsql_data_isnull);
  66. PHP_FUNCTION(pgsql_free_result);
  67. PHP_FUNCTION(pgsql_last_oid);
  68. PHP_FUNCTION(pgsql_lo_create);
  69. PHP_FUNCTION(pgsql_lo_unlink);
  70. PHP_FUNCTION(pgsql_lo_open);
  71. PHP_FUNCTION(pgsql_lo_close);
  72. PHP_FUNCTION(pgsql_lo_read);
  73. PHP_FUNCTION(pgsql_lo_write);
  74. PHP_FUNCTION(pgsql_lo_readall);
  75. void php3_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent);
  76. int php3_pgsql_get_default_link(INTERNAL_FUNCTION_PARAMETERS);
  77. void php3_pgsql_get_link_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type);
  78. void php3_pgsql_get_result_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type);
  79. char *get_field_name(PGconn *pgsql, Oid oid, HashTable *list);
  80. void php3_pgsql_get_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type);
  81. void php3_pgsql_data_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type);
  82. typedef struct pgLofp {
  83. PGconn *conn;
  84. int lofd;
  85. } pgLofp;
  86. typedef struct _php3_pgsql_result_handle {
  87. PGconn *conn;
  88. PGresult *result;
  89. } pgsql_result_handle;
  90. typedef struct {
  91. long default_link;
  92. long num_links,num_persistent;
  93. long max_links,max_persistent;
  94. long allow_persistent;
  95. int le_link,le_plink,le_result,le_lofp,le_string;
  96. } pgsql_module;
  97. extern pgsql_module php3_pgsql_module;
  98. #else
  99. #define pgsql_module_ptr NULL
  100. #endif
  101. #define phpext_pgsql_ptr pgsql_module_ptr
  102. #endif /* _PHP3_PGSQL_H */