summaryrefslogtreecommitdiff
path: root/ext/yp/php_yp.h
diff options
context:
space:
mode:
authorFredrik Öhrn <ohrn@php.net>2001-03-18 22:16:47 +0000
committerFredrik Öhrn <ohrn@php.net>2001-03-18 22:16:47 +0000
commit87138d68cd2ce2feeef437fb8a5416fde8232988 (patch)
tree52022de7bb40db6bda09dbae3107b32bb54d82bf /ext/yp/php_yp.h
parent00d81acc4f87931f9a071434b46b78791d4a482d (diff)
downloadphp-git-87138d68cd2ce2feeef437fb8a5416fde8232988.tar.gz
Much needed cleanup and new functions added
------------------------------------------- Cleaned up stringhandling for binary safeness. All functions now maintain a global 'errno' variable. All functions now print warning messages on failure. Added error code constants. Fixed bug #8041 while maintaining backward compatibility. New functions: yp_all traverse a map yp_cat retrive an entire map in one go yp_errno get last error code yp_err_string get a human readable error message
Diffstat (limited to 'ext/yp/php_yp.h')
-rw-r--r--ext/yp/php_yp.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/ext/yp/php_yp.h b/ext/yp/php_yp.h
index c3723d2f99..0b6d7bbad1 100644
--- a/ext/yp/php_yp.h
+++ b/ext/yp/php_yp.h
@@ -13,6 +13,7 @@
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Stephanie Wehner <_@r4k.net> |
+ | Fredrik Ohrn |
+----------------------------------------------------------------------+
*/
@@ -23,6 +24,12 @@
#if HAVE_YP
+#ifdef PHP_WIN32
+#define PHP_YP_API __declspec(dllexport)
+#else
+#define PHP_YP_API
+#endif
+
extern zend_module_entry yp_module_entry;
#define yp_module_ptr &yp_module_entry
@@ -33,8 +40,34 @@ PHP_FUNCTION(yp_master);
PHP_FUNCTION(yp_match);
PHP_FUNCTION(yp_first);
PHP_FUNCTION(yp_next);
+PHP_FUNCTION(yp_all);
+PHP_FUNCTION(yp_cat);
+PHP_FUNCTION(yp_errno);
+PHP_FUNCTION(yp_err_string);
+PHP_MINIT_FUNCTION(yp);
+PHP_RINIT_FUNCTION(yp);
PHP_MINFO_FUNCTION(yp);
+typedef struct {
+ int error;
+} php_yp_globals;
+
+#ifdef ZTS
+#define YPLS_D php_yp_globals *yp_globals
+#define YPLS_DC , YPLS_D
+#define YPLS_C yp_globals
+#define YPLS_CC , YPLS_C
+#define YP(v) (yp_globals->v)
+#define YPLS_FETCH() php_yp_globals *yp_globals = ts_resource(yp_globals_id)
+#else
+#define YPLS_D
+#define YPLS_DC
+#define YPLS_C
+#define YPLS_CC
+#define YP(v) (yp_globals.v)
+#define YPLS_FETCH()
+#endif
+
#else
#define yp_module_ptr NULL