cvs: pear /XMMS php_xmms.h xmms.c
| From: | Rasmus Lerdorf | Date: | Mon, 15 Oct 2001 21:22:55 +0000 |
| Subject: | cvs: pear /XMMS php_xmms.h xmms.c | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-1029@lists.php.net to get a copy of this message | ||
rasmus Mon Oct 15 17:22:55 2001 EDT
Modified files:
/pear/XMMS php_xmms.h xmms.c
Log:
API update
Index: pear/XMMS/php_xmms.h
diff -u pear/XMMS/php_xmms.h:1.8 pear/XMMS/php_xmms.h:1.9
--- pear/XMMS/php_xmms.h:1.8 Tue Aug 14 03:50:00 2001
+++ pear/XMMS/php_xmms.h Mon Oct 15 17:22:55 2001
@@ -34,6 +34,8 @@
#include <xmms/xmmsctrl.h>
+#define PHP_XMMS_VERSION "0.1"
+
PHP_MINIT_FUNCTION(xmms);
PHP_MSHUTDOWN_FUNCTION(xmms);
PHP_MINFO_FUNCTION(xmms);
Index: pear/XMMS/xmms.c
diff -u pear/XMMS/xmms.c:1.15 pear/XMMS/xmms.c:1.16
--- pear/XMMS/xmms.c:1.15 Tue Aug 14 18:17:23 2001
+++ pear/XMMS/xmms.c Mon Oct 15 17:22:55 2001
@@ -21,6 +21,8 @@
#endif
#include "php.h"
+#include "php_globals.h"
+#include "SAPI.h"
#include "php_ini.h"
#include "ext/standard/info.h"
#include "php_xmms.h"
@@ -100,6 +102,9 @@
/* {{{ xmms_module_entry
*/
zend_module_entry xmms_module_entry = {
+#if ZEND_MODULE_API_NO >= 20010901
+ STANDARD_MODULE_HEADER,
+#endif
"xmms",
xmms_functions,
PHP_MINIT(xmms),
@@ -107,6 +112,9 @@
NULL,
NULL,
PHP_MINFO(xmms),
+#if ZEND_MODULE_API_NO >= 20010901
+ PHP_XMMS_VERSION,
+#endif
STANDARD_MODULE_PROPERTIES
};
/* }}} */
@@ -350,7 +358,7 @@
/* }}} */
/* {{{ proto void xmms_play([int pos])
- */
+ Play current or provided song position */
PHP_FUNCTION(xmms_play)
{
int argc = ZEND_NUM_ARGS();
@@ -863,12 +871,28 @@
}
/* }}} */
+/*
+pval _xmms_property_get(INTERNAL_FUNCTION_PARAMETERS, zend_property_reference *prop_ref) {
+ pval result;
+ zend_llist_element *element = prop_ref->elements_list->head;
+ zend_overloaded_element overloaded_property = (zend_overloaded_element *) element->data;
+
+ result.refcount = 1;
+ result.is_ref = 0;
+ Z_TYPE(result) = IS_STRING;
+ Z_STRVAL(result) = estrdup("Hello World");
+ Z_STRLEN(result) = 11;
+ return result;
+}
+*/
+
/* {{{ proto object xmms([bool start])
- XMMS class */
+ XMMS class constructor */
PHP_FUNCTION(xmms)
{
int argc = ZEND_NUM_ARGS();
zend_bool start = 0;
+ pval **tmp;
if (zend_parse_parameters(argc TSRMLS_CC, "|b", &start) == FAILURE)
return;
@@ -879,6 +903,10 @@
}
}
+ /*
+ xmms_class_entry_ptr->handle_property_get = _xmms_property_get;
+ */
+
if(xmms_remote_is_running(XG(session))) {
add_property_long(this_ptr, "version", xmms_remote_get_version(XG(session)));
add_property_bool(this_ptr, "running", 1);
@@ -890,6 +918,15 @@
add_property_bool(this_ptr, "repeat", 0);
add_property_bool(this_ptr, "shuffle", 0);
}
+ /*
+ add_property_string(this_ptr, "mime type", SG(default_mimetype), 1);
+ add_property_string(this_ptr, "SAPI", sapi_module.pretty_name, 1);
+ if(zend_hash_find(&EG(symbol_table), "foo", 4, (void **)&tmp) == SUCCESS) {
+ add_property_stringl(this_ptr, "foo", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1);
+ } else {
+ add_property_string(this_ptr, "foo", "undefined", 1);
+ }
+ */
}
/* }}} */