summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorEdin Kadribasic <edink@php.net>2003-12-05 01:03:35 +0000
committerEdin Kadribasic <edink@php.net>2003-12-05 01:03:35 +0000
commit32eb4f78c2f761b1f1c89aa82c057ee62590b10e (patch)
tree051f1a5d1069e50a7f6161f825f1f8a3174035ca /ext
parent6abf2179c1d3c17ffe64072678935481d76f67ab (diff)
downloadphp-git-32eb4f78c2f761b1f1c89aa82c057ee62590b10e.tar.gz
Get rid of PHPAPI usage.
Enable shared build in the new php5 build system Check for the correct header.
Diffstat (limited to 'ext')
-rw-r--r--ext/pgsql/config.w3216
-rw-r--r--ext/pgsql/pgsql.c14
-rw-r--r--ext/pgsql/php_pgsql.h21
3 files changed, 24 insertions, 27 deletions
diff --git a/ext/pgsql/config.w32 b/ext/pgsql/config.w32
index 624533d152..c66959d302 100644
--- a/ext/pgsql/config.w32
+++ b/ext/pgsql/config.w32
@@ -4,16 +4,12 @@
ARG_WITH("pgsql", "PostgreSQL support", "no");
if (PHP_PGSQL != "no") {
- if (!PHP_PGSQL_SHARED) {
- ERROR("Cannot build pgsql as a static extension until someone fixes its bogus PHPAPI usage\r\nuse --with-pgsql=shared instead.");
+ if (CHECK_LIB("libpq.lib", "pgsql", PHP_PGSQL) &&
+ CHECK_HEADER_ADD_INCLUDE("libpq-fe.h", "CFLAGS_PGSQL", PHP_PHP_BUILD + "\\include\\pgsql;" + PHP_PGSQL)) {
+ EXTENSION("pgsql", "pgsql.c");
+ AC_DEFINE('HAVE_PGSQL', 1, 'Have PostgreSQL library');
+ ADD_FLAG("CFLAGS_PGSQL", "/D HAVE_PQCMDTUPLES /D HAVE_PQCLIENTENCODING /D HAVE_PQESCAPE /D HAVE_PG_CONFIG_H /D PGSQL_EXPORTS");
} else {
- if (CHECK_LIB("libpq.lib", "pgsql", PHP_PGSQL) &&
- CHECK_HEADER_ADD_INCLUDE("postgres.h", "CFLAGS_PGSQL", PHP_PHP_BUILD + "\\include\\pgsql;" + PHP_PHP_BUILD + "\\postgresql\\src\\include;" + PHP_PGSQL)) {
- EXTENSION("pgsql", "pgsql.c");
- AC_DEFINE('HAVE_PGSQL', 1, 'Have PostgreSQL library');
- ADD_FLAG("CFLAGS_PGSQL", "/D HAVE_PQCMDTUPLES /D HAVE_PQCLIENTENCODING /D HAVE_PQESCAPE /D HAVE_PG_CONFIG_H");
- } else {
- WARNING("pgsql not enabled; libraries and headers not found");
- }
+ WARNING("pgsql not enabled; libraries and headers not found");
}
}
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index 148f289aea..ed87c74992 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -3315,7 +3315,7 @@ PHP_FUNCTION(pg_get_pid)
/* {{{ php_pgsql_meta_data
* TODO: Add meta_data cache for better performance
*/
-PHPAPI 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 TSRMLS_DC)
{
PGresult *pg_result;
char *tmp_name;
@@ -3574,7 +3574,7 @@ static int php_pgsql_add_quotes(zval *src, zend_bool should_free TSRMLS_DC)
/* {{{ php_pgsql_convert
* check and convert array values (fieldname=>vlaue pair) for sql
*/
-PHPAPI 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_convert(PGconn *pg_link, const char *table_name, const zval *values, zval *result, ulong opt TSRMLS_DC)
{
HashPosition pos;
char *field = NULL;
@@ -4212,7 +4212,7 @@ static int do_exec(smart_str *querystr, int expect, PGconn *pg_link, ulong opt T
/* {{{ php_pgsql_insert
*/
-PHPAPI int php_pgsql_insert(PGconn *pg_link, const char *table, zval *var_array, ulong opt, char **sql TSRMLS_DC)
+PHP_PGSQL_API int php_pgsql_insert(PGconn *pg_link, const char *table, zval *var_array, ulong opt, char **sql TSRMLS_DC)
{
zval **val, *converted = NULL;
char buf[256];
@@ -4391,7 +4391,7 @@ static inline int build_assignment_string(smart_str *querystr, HashTable *ht, co
/* {{{ php_pgsql_update
*/
-PHPAPI int php_pgsql_update(PGconn *pg_link, const char *table, zval *var_array, zval *ids_array, ulong opt, char **sql TSRMLS_DC)
+PHP_PGSQL_API int php_pgsql_update(PGconn *pg_link, const char *table, zval *var_array, zval *ids_array, ulong opt, char **sql TSRMLS_DC)
{
zval *var_converted = NULL, *ids_converted = NULL;
smart_str querystr = {0};
@@ -4497,7 +4497,7 @@ PHP_FUNCTION(pg_update)
/* {{{ php_pgsql_delete
*/
-PHPAPI int php_pgsql_delete(PGconn *pg_link, const char *table, zval *ids_array, ulong opt, char **sql TSRMLS_DC)
+PHP_PGSQL_API int php_pgsql_delete(PGconn *pg_link, const char *table, zval *ids_array, ulong opt, char **sql TSRMLS_DC)
{
zval *ids_converted = NULL;
smart_str querystr = {0};
@@ -4586,7 +4586,7 @@ PHP_FUNCTION(pg_delete)
/* {{{ php_pgsql_result2array
*/
-PHPAPI int php_pgsql_result2array(PGresult *pg_result, zval *ret_array TSRMLS_DC)
+PHP_PGSQL_API int php_pgsql_result2array(PGresult *pg_result, zval *ret_array TSRMLS_DC)
{
zval *row;
char *field_name, *element, *data;
@@ -4628,7 +4628,7 @@ PHPAPI int php_pgsql_result2array(PGresult *pg_result, zval *ret_array TSRMLS_DC
/* {{{ php_pgsql_select
*/
-PHPAPI int php_pgsql_select(PGconn *pg_link, const char *table, zval *ids_array, zval *ret_array, ulong opt, char **sql TSRMLS_DC)
+PHP_PGSQL_API int php_pgsql_select(PGconn *pg_link, const char *table, zval *ids_array, zval *ret_array, ulong opt, char **sql TSRMLS_DC)
{
zval *ids_converted = NULL;
smart_str querystr = {0};
diff --git a/ext/pgsql/php_pgsql.h b/ext/pgsql/php_pgsql.h
index 80744ab185..d434df531f 100644
--- a/ext/pgsql/php_pgsql.h
+++ b/ext/pgsql/php_pgsql.h
@@ -36,14 +36,15 @@ extern zend_module_entry pgsql_module_entry;
#ifdef PHP_WIN32
#define INV_WRITE 0x00020000
#define INV_READ 0x00040000
-#undef PHPAPI
+#undef PHP_PGSQL_API
#ifdef PGSQL_EXPORTS
-#define PHPAPI __declspec(dllexport)
+#define PHP_PGSQL_API __declspec(dllexport)
#else
-#define PHPAPI __declspec(dllimport)
+#define PHP_PGSQL_API __declspec(dllimport)
#endif
#else
#include <libpq/libpq-fs.h>
+#define PHP_PGSQL_API /* nothing special */
#endif
#ifdef HAVE_PG_CONFIG_H
@@ -161,13 +162,13 @@ PHP_FUNCTION(pg_select);
#define PGSQL_DML_STRING (1<<11) /* Return query string */
/* exported functions */
-PHPAPI int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, zval *meta TSRMLS_DC);
-PHPAPI int php_pgsql_convert(PGconn *pg_link, const char *table_name, const zval *values, zval *result, ulong opt TSRMLS_DC);
-PHPAPI int php_pgsql_insert(PGconn *pg_link, const char *table, zval *values, ulong opt, char **sql TSRMLS_DC);
-PHPAPI int php_pgsql_update(PGconn *pg_link, const char *table, zval *values, zval *ids, ulong opt , char **sql TSRMLS_DC);
-PHPAPI int php_pgsql_delete(PGconn *pg_link, const char *table, zval *ids, ulong opt, char **sql TSRMLS_DC);
-PHPAPI int php_pgsql_select(PGconn *pg_link, const char *table, zval *ids, zval *ret_array, ulong opt, char **sql TSRMLS_DC);
-PHPAPI int php_pgsql_result2array(PGresult *pg_result, zval *ret_array TSRMLS_DC);
+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_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);
+PHP_PGSQL_API int php_pgsql_delete(PGconn *pg_link, const char *table, zval *ids, ulong opt, char **sql TSRMLS_DC);
+PHP_PGSQL_API int php_pgsql_select(PGconn *pg_link, const char *table, zval *ids, zval *ret_array, ulong opt, char **sql TSRMLS_DC);
+PHP_PGSQL_API int php_pgsql_result2array(PGresult *pg_result, zval *ret_array TSRMLS_DC);
/* internal functions */
static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent);