summaryrefslogtreecommitdiff
path: root/ext/pgsql/php_pgsql.h
diff options
context:
space:
mode:
Diffstat (limited to 'ext/pgsql/php_pgsql.h')
-rw-r--r--ext/pgsql/php_pgsql.h33
1 files changed, 32 insertions, 1 deletions
diff --git a/ext/pgsql/php_pgsql.h b/ext/pgsql/php_pgsql.h
index d0853d603e..62f20dad57 100644
--- a/ext/pgsql/php_pgsql.h
+++ b/ext/pgsql/php_pgsql.h
@@ -24,6 +24,8 @@
#if HAVE_PGSQL
+#define PHP_PGSQL_API_VERSION 20140217
+
extern zend_module_entry pgsql_module_entry;
#define pgsql_module_ptr &pgsql_module_entry
@@ -65,6 +67,7 @@ PHP_MINFO_FUNCTION(pgsql);
/* connection functions */
PHP_FUNCTION(pg_connect);
PHP_FUNCTION(pg_pconnect);
+PHP_FUNCTION(pg_connect_poll);
PHP_FUNCTION(pg_close);
PHP_FUNCTION(pg_connection_reset);
PHP_FUNCTION(pg_connection_status);
@@ -132,6 +135,9 @@ PHP_FUNCTION(pg_field_is_null);
PHP_FUNCTION(pg_field_table);
/* async message functions */
PHP_FUNCTION(pg_get_notify);
+PHP_FUNCTION(pg_socket);
+PHP_FUNCTION(pg_consume_input);
+PHP_FUNCTION(pg_flush);
PHP_FUNCTION(pg_get_pid);
/* error message functions */
PHP_FUNCTION(pg_result_error);
@@ -157,6 +163,9 @@ PHP_FUNCTION(pg_lo_import);
PHP_FUNCTION(pg_lo_export);
PHP_FUNCTION(pg_lo_seek);
PHP_FUNCTION(pg_lo_tell);
+#if HAVE_PG_LO_TRUNCATE
+PHP_FUNCTION(pg_lo_truncate);
+#endif
/* debugging functions */
PHP_FUNCTION(pg_trace);
@@ -186,6 +195,7 @@ PHP_FUNCTION(pg_select);
/* connection options - ToDo: Add async connection option */
#define PGSQL_CONNECT_FORCE_NEW (1<<1)
+#define PGSQL_CONNECT_ASYNC (1<<2)
/* php_pgsql_convert options */
#define PGSQL_CONV_IGNORE_DEFAULT (1<<1) /* Do not use DEAFULT value by removing field from returned array */
#define PGSQL_CONV_FORCE_NULL (1<<2) /* Convert to NULL if string is null string */
@@ -196,9 +206,11 @@ PHP_FUNCTION(pg_select);
#define PGSQL_DML_EXEC (1<<9) /* Execute query */
#define PGSQL_DML_ASYNC (1<<10) /* Do async query */
#define PGSQL_DML_STRING (1<<11) /* Return query string */
+#define PGSQL_DML_ESCAPE (1<<12) /* No convert, but escape only */
+
/* exported functions */
-PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, zval *meta TSRMLS_DC);
+PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, zval *meta, zend_bool extended TSRMLS_DC);
PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, const zval *values, zval *result, ulong opt TSRMLS_DC);
PHP_PGSQL_API int php_pgsql_insert(PGconn *pg_link, const char *table, zval *values, ulong opt, char **sql TSRMLS_DC);
PHP_PGSQL_API int php_pgsql_update(PGconn *pg_link, const char *table, zval *values, zval *ids, ulong opt , char **sql TSRMLS_DC);
@@ -215,6 +227,13 @@ static void php_pgsql_get_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_typ
static void php_pgsql_data_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type);
static void php_pgsql_do_async(INTERNAL_FUNCTION_PARAMETERS,int entry_type);
+static size_t php_pgsql_fd_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC);
+static size_t php_pgsql_fd_read(php_stream *stream, char *buf, size_t count TSRMLS_DC);
+static int php_pgsql_fd_close(php_stream *stream, int close_handle TSRMLS_DC);
+static int php_pgsql_fd_flush(php_stream *stream TSRMLS_DC);
+static int php_pgsql_fd_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC);
+static int php_pgsql_fd_cast(php_stream *stream, int cast_as, void **ret TSRMLS_DC);
+
typedef enum _php_pgsql_data_type {
/* boolean */
PG_BOOL,
@@ -277,6 +296,18 @@ typedef struct _php_pgsql_notice {
size_t len;
} php_pgsql_notice;
+static php_stream_ops php_stream_pgsql_fd_ops = {
+ php_pgsql_fd_write,
+ php_pgsql_fd_read,
+ php_pgsql_fd_close,
+ php_pgsql_fd_flush,
+ "PostgreSQL link",
+ NULL, /* seek */
+ php_pgsql_fd_cast, /* cast */
+ NULL, /* stat */
+ php_pgsql_fd_set_option
+};
+
ZEND_BEGIN_MODULE_GLOBALS(pgsql)
long default_link; /* default link when connection is omitted */
long num_links,num_persistent;