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.

120 lines
5.3 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. extern void php3_pgsql_connect(INTERNAL_FUNCTION_PARAMETERS);
  44. extern void php3_pgsql_pconnect(INTERNAL_FUNCTION_PARAMETERS);
  45. extern void php3_pgsql_close(INTERNAL_FUNCTION_PARAMETERS);
  46. extern void php3_pgsql_dbname(INTERNAL_FUNCTION_PARAMETERS);
  47. extern void php3_pgsql_error_message(INTERNAL_FUNCTION_PARAMETERS);
  48. extern void php3_pgsql_options(INTERNAL_FUNCTION_PARAMETERS);
  49. extern void php3_pgsql_port(INTERNAL_FUNCTION_PARAMETERS);
  50. extern void php3_pgsql_tty(INTERNAL_FUNCTION_PARAMETERS);
  51. extern void php3_pgsql_host(INTERNAL_FUNCTION_PARAMETERS);
  52. extern void php3_pgsql_exec(INTERNAL_FUNCTION_PARAMETERS);
  53. extern void php3_pgsql_num_rows(INTERNAL_FUNCTION_PARAMETERS);
  54. extern void php3_pgsql_num_fields(INTERNAL_FUNCTION_PARAMETERS);
  55. extern void php3_pgsql_cmdtuples(INTERNAL_FUNCTION_PARAMETERS);
  56. extern void php3_pgsql_field_name(INTERNAL_FUNCTION_PARAMETERS);
  57. extern void php3_pgsql_field_size(INTERNAL_FUNCTION_PARAMETERS);
  58. extern void php3_pgsql_field_type(INTERNAL_FUNCTION_PARAMETERS);
  59. extern void php3_pgsql_field_number(INTERNAL_FUNCTION_PARAMETERS);
  60. extern void php3_pgsql_result(INTERNAL_FUNCTION_PARAMETERS);
  61. extern void php3_pgsql_fetch_row(INTERNAL_FUNCTION_PARAMETERS);
  62. extern void php3_pgsql_fetch_array(INTERNAL_FUNCTION_PARAMETERS);
  63. extern void php3_pgsql_fetch_object(INTERNAL_FUNCTION_PARAMETERS);
  64. extern void php3_pgsql_data_length(INTERNAL_FUNCTION_PARAMETERS);
  65. extern void php3_pgsql_data_isnull(INTERNAL_FUNCTION_PARAMETERS);
  66. extern void php3_pgsql_free_result(INTERNAL_FUNCTION_PARAMETERS);
  67. extern void php3_pgsql_last_oid(INTERNAL_FUNCTION_PARAMETERS);
  68. extern void php3_pgsql_lo_create(INTERNAL_FUNCTION_PARAMETERS);
  69. extern void php3_pgsql_lo_unlink(INTERNAL_FUNCTION_PARAMETERS);
  70. extern void php3_pgsql_lo_open(INTERNAL_FUNCTION_PARAMETERS);
  71. extern void php3_pgsql_lo_close(INTERNAL_FUNCTION_PARAMETERS);
  72. extern void php3_pgsql_lo_read(INTERNAL_FUNCTION_PARAMETERS);
  73. extern void php3_pgsql_lo_write(INTERNAL_FUNCTION_PARAMETERS);
  74. extern void php3_pgsql_lo_readall(INTERNAL_FUNCTION_PARAMETERS);
  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_fetch_hash(INTERNAL_FUNCTION_PARAMETERS);
  82. void php3_pgsql_data_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type);
  83. typedef struct pgLofp {
  84. PGconn *conn;
  85. int lofd;
  86. } pgLofp;
  87. typedef struct _php3_pgsql_result_handle {
  88. PGconn *conn;
  89. PGresult *result;
  90. } pgsql_result_handle;
  91. typedef struct {
  92. long default_link;
  93. long num_links,num_persistent;
  94. long max_links,max_persistent;
  95. long allow_persistent;
  96. int le_link,le_plink,le_result,le_lofp,le_string;
  97. } pgsql_module;
  98. extern pgsql_module php3_pgsql_module;
  99. #else
  100. #define pgsql_module_ptr NULL
  101. #endif
  102. #endif /* _PHP3_PGSQL_H */