1999-04-22 02:48:28 +00:00
|
|
|
/*
|
|
|
|
+----------------------------------------------------------------------+
|
2000-06-04 20:24:07 +00:00
|
|
|
| PHP version 4.0 |
|
1999-04-22 02:48:28 +00:00
|
|
|
+----------------------------------------------------------------------+
|
2001-02-26 06:11:02 +00:00
|
|
|
| Copyright (c) 1997-2001 The PHP Group |
|
1999-04-22 02:48:28 +00:00
|
|
|
+----------------------------------------------------------------------+
|
2000-06-04 20:24:07 +00:00
|
|
|
| This source file is subject to version 2.02 of the PHP license, |
|
|
|
|
| that is bundled with this package in the file LICENSE, and is |
|
|
|
|
| available at through the world-wide-web at |
|
|
|
|
| http://www.php.net/license/2_02.txt. |
|
|
|
|
| If you did not receive a copy of the PHP license and are unable to |
|
|
|
|
| obtain it through the world-wide-web, please send a note to |
|
|
|
|
| license@php.net so we can mail you a copy immediately. |
|
1999-04-22 02:48:28 +00:00
|
|
|
+----------------------------------------------------------------------+
|
2000-06-04 20:24:07 +00:00
|
|
|
| Authors: Zeev Suraski <zeev@zend.com> |
|
2001-01-04 11:15:35 +00:00
|
|
|
| Jouni Ahto <jouni.ahto@exdec.fi> |
|
1999-04-22 02:48:28 +00:00
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* $Id$ */
|
|
|
|
|
2000-07-02 23:46:51 +00:00
|
|
|
#ifndef PHP_PGSQL_H
|
|
|
|
#define PHP_PGSQL_H
|
1999-04-22 02:48:28 +00:00
|
|
|
|
|
|
|
#if HAVE_PGSQL
|
|
|
|
|
1999-12-17 20:55:31 +00:00
|
|
|
extern zend_module_entry pgsql_module_entry;
|
1999-04-22 02:48:28 +00:00
|
|
|
#define pgsql_module_ptr &pgsql_module_entry
|
|
|
|
|
2000-05-02 05:27:35 +00:00
|
|
|
#ifdef PHP_PGSQL_PRIVATE
|
2000-05-23 06:03:34 +00:00
|
|
|
#undef SOCKET_SIZE_TYPE
|
1999-04-22 02:48:28 +00:00
|
|
|
#include <libpq-fe.h>
|
1999-11-20 00:30:08 +00:00
|
|
|
|
2000-06-09 22:39:56 +00:00
|
|
|
#ifdef PHP_WIN32
|
1999-11-20 00:30:08 +00:00
|
|
|
#define INV_WRITE 0x00020000
|
|
|
|
#define INV_READ 0x00040000
|
|
|
|
#else
|
1999-04-22 02:48:28 +00:00
|
|
|
#include <libpq/libpq-fs.h>
|
1999-11-20 00:30:08 +00:00
|
|
|
#endif
|
|
|
|
|
2000-02-12 14:38:31 +00:00
|
|
|
#ifdef PHP_WIN32
|
1999-11-20 00:30:08 +00:00
|
|
|
#define PHP_PGSQL_API __declspec(dllexport)
|
|
|
|
#else
|
|
|
|
#define PHP_PGSQL_API
|
|
|
|
#endif
|
1999-04-22 02:48:28 +00:00
|
|
|
|
1999-12-18 11:38:04 +00:00
|
|
|
PHP_MINIT_FUNCTION(pgsql);
|
2000-02-05 17:26:35 +00:00
|
|
|
PHP_MSHUTDOWN_FUNCTION(pgsql);
|
1999-12-18 11:38:04 +00:00
|
|
|
PHP_RINIT_FUNCTION(pgsql);
|
2001-02-13 18:28:24 +00:00
|
|
|
PHP_RSHUTDOWN_FUNCTION(pgsql);
|
2000-05-24 06:48:04 +00:00
|
|
|
PHP_MINFO_FUNCTION(pgsql);
|
1999-12-19 22:44:55 +00:00
|
|
|
PHP_FUNCTION(pg_connect);
|
|
|
|
PHP_FUNCTION(pg_pconnect);
|
|
|
|
PHP_FUNCTION(pg_close);
|
|
|
|
PHP_FUNCTION(pg_dbname);
|
1999-12-21 05:22:43 +00:00
|
|
|
PHP_FUNCTION(pg_errormessage);
|
2000-05-31 20:40:28 +00:00
|
|
|
PHP_FUNCTION(pg_trace);
|
|
|
|
PHP_FUNCTION(pg_untrace);
|
1999-12-19 22:44:55 +00:00
|
|
|
PHP_FUNCTION(pg_options);
|
|
|
|
PHP_FUNCTION(pg_port);
|
|
|
|
PHP_FUNCTION(pg_tty);
|
|
|
|
PHP_FUNCTION(pg_host);
|
|
|
|
PHP_FUNCTION(pg_exec);
|
1999-12-21 05:22:43 +00:00
|
|
|
PHP_FUNCTION(pg_numrows);
|
|
|
|
PHP_FUNCTION(pg_numfields);
|
1999-12-19 22:44:55 +00:00
|
|
|
PHP_FUNCTION(pg_cmdtuples);
|
2001-05-06 01:34:56 +00:00
|
|
|
PHP_FUNCTION(pg_last_notice);
|
1999-12-21 05:22:43 +00:00
|
|
|
PHP_FUNCTION(pg_fieldname);
|
|
|
|
PHP_FUNCTION(pg_fieldsize);
|
|
|
|
PHP_FUNCTION(pg_fieldtype);
|
|
|
|
PHP_FUNCTION(pg_fieldnum);
|
1999-12-19 22:44:55 +00:00
|
|
|
PHP_FUNCTION(pg_result);
|
|
|
|
PHP_FUNCTION(pg_fetch_row);
|
|
|
|
PHP_FUNCTION(pg_fetch_array);
|
|
|
|
PHP_FUNCTION(pg_fetch_object);
|
1999-12-21 05:22:43 +00:00
|
|
|
PHP_FUNCTION(pg_fieldprtlen);
|
|
|
|
PHP_FUNCTION(pg_fieldisnull);
|
|
|
|
PHP_FUNCTION(pg_freeresult);
|
|
|
|
PHP_FUNCTION(pg_getlastoid);
|
|
|
|
PHP_FUNCTION(pg_locreate);
|
|
|
|
PHP_FUNCTION(pg_lounlink);
|
|
|
|
PHP_FUNCTION(pg_loopen);
|
|
|
|
PHP_FUNCTION(pg_loclose);
|
|
|
|
PHP_FUNCTION(pg_loread);
|
|
|
|
PHP_FUNCTION(pg_lowrite);
|
|
|
|
PHP_FUNCTION(pg_loreadall);
|
2000-06-04 20:24:07 +00:00
|
|
|
PHP_FUNCTION(pg_loimport);
|
|
|
|
PHP_FUNCTION(pg_loexport);
|
2001-01-18 22:17:05 +00:00
|
|
|
PHP_FUNCTION(pg_lolseek);
|
|
|
|
PHP_FUNCTION(pg_lotell);
|
2000-09-11 21:28:47 +00:00
|
|
|
PHP_FUNCTION(pg_put_line);
|
|
|
|
PHP_FUNCTION(pg_end_copy);
|
2000-07-29 04:24:11 +00:00
|
|
|
#if HAVE_PQCLIENTENCODING
|
2000-09-13 04:13:36 +00:00
|
|
|
PHP_FUNCTION(pg_client_encoding);
|
|
|
|
PHP_FUNCTION(pg_set_client_encoding);
|
2000-07-29 04:24:11 +00:00
|
|
|
#endif
|
1999-04-22 02:48:28 +00:00
|
|
|
|
1999-12-18 11:38:04 +00:00
|
|
|
void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent);
|
|
|
|
int php_pgsql_get_default_link(INTERNAL_FUNCTION_PARAMETERS);
|
|
|
|
void php_pgsql_get_link_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type);
|
|
|
|
void php_pgsql_get_result_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type);
|
1999-04-22 02:48:28 +00:00
|
|
|
char *get_field_name(PGconn *pgsql, Oid oid, HashTable *list);
|
1999-12-18 11:38:04 +00:00
|
|
|
void php_pgsql_get_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type);
|
|
|
|
void php_pgsql_data_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type);
|
1999-04-22 02:48:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
typedef struct pgLofp {
|
|
|
|
PGconn *conn;
|
|
|
|
int lofd;
|
|
|
|
} pgLofp;
|
|
|
|
|
1999-12-18 11:38:04 +00:00
|
|
|
typedef struct _php_pgsql_result_handle {
|
1999-04-22 02:48:28 +00:00
|
|
|
PGconn *conn;
|
|
|
|
PGresult *result;
|
2001-06-19 18:10:08 +00:00
|
|
|
int row;
|
1999-04-22 02:48:28 +00:00
|
|
|
} pgsql_result_handle;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
long default_link;
|
|
|
|
long num_links,num_persistent;
|
|
|
|
long max_links,max_persistent;
|
|
|
|
long allow_persistent;
|
1999-11-20 01:04:45 +00:00
|
|
|
int le_lofp,le_string;
|
2001-04-04 21:40:41 +00:00
|
|
|
int ignore_notices;
|
2001-05-06 01:34:56 +00:00
|
|
|
char *last_notice;
|
1999-11-20 00:30:08 +00:00
|
|
|
} php_pgsql_globals;
|
|
|
|
|
1999-04-22 02:48:28 +00:00
|
|
|
|
1999-11-20 00:30:08 +00:00
|
|
|
#ifdef ZTS
|
2001-07-28 11:36:37 +00:00
|
|
|
# define PGG(v) TSRMG(pgsql_globals_id, php_pgsql_globals *, v)
|
1999-11-20 00:30:08 +00:00
|
|
|
#else
|
|
|
|
# define PGG(v) (pgsql_globals.v)
|
|
|
|
extern PHP_PGSQL_API php_pgsql_globals pgsql_globals;
|
|
|
|
#endif
|
2001-07-28 11:36:37 +00:00
|
|
|
|
2000-05-02 05:27:35 +00:00
|
|
|
#endif
|
1999-04-22 02:48:28 +00:00
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
#define pgsql_module_ptr NULL
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
1999-05-21 08:04:38 +00:00
|
|
|
#define phpext_pgsql_ptr pgsql_module_ptr
|
|
|
|
|
2000-07-02 23:46:51 +00:00
|
|
|
#endif /* PHP_PGSQL_H */
|