[cvs-annodex] commit (/annodex):
phpannodex/trunk/src/phpanx_general.c
phpannodex/trunk/src/phpanx_read.c
phpannodex/trunk/src/phpanx_write.c
ctford
nobody at lists.annodex.net
Thu Dec 8 10:41:36 EST 2005
Update of /annodex (new revision 1693)
Modified files:
phpannodex/trunk/src/phpanx_general.c
phpannodex/trunk/src/phpanx_read.c
phpannodex/trunk/src/phpanx_write.c
Log Message:
The return types of the PHP hooks now all match the return types of the Annodex functions, except that void functions return true rather than null (so that calling functions with the wrong number of arguments can return NULL).
Modified: phpannodex/trunk/src/phpanx_general.c
===================================================================
--- phpannodex/trunk/src/phpanx_general.c 2005-12-07 23:02:07 UTC (rev 1692)
+++ phpannodex/trunk/src/phpanx_general.c 2005-12-07 23:41:35 UTC (rev 1693)
@@ -19,11 +19,7 @@
/* Call Annodex function */
anx = anx_open(filename, mode);
- if( anx == NULL ) {
- RETURN_FALSE;
- } else {
- RETURN_LONG( (long) anx );
- }
+ RETURN_LONG( (long) anx );
}
PHP_FUNCTION(anx_open_read)
@@ -41,11 +37,7 @@
/* Call Annodex function */
anx = anx_open(filename, ANX_READ);
- if( anx == NULL ) {
- RETURN_FALSE;
- } else {
- RETURN_LONG( (long) anx );
- }
+ RETURN_LONG( (long) anx );
}
PHP_FUNCTION(anx_open_write)
@@ -63,11 +55,7 @@
/* Call Annodex function */
anx = anx_open(filename, ANX_WRITE);
- if( anx == NULL ) {
- RETURN_FALSE;
- } else {
- RETURN_LONG( (long) anx );
- }
+ RETURN_LONG( (long) anx );
}
PHP_FUNCTION(anx_new)
@@ -102,11 +90,7 @@
/* Call Annodex function */
anx = anx_close( anx );
- if (anx == NULL) {
- RETURN_TRUE;
- } else {
- RETURN_FALSE;
- }
+ RETURN_LONG( (long) anx );
}
PHP_FUNCTION(anx_ready)
@@ -125,11 +109,7 @@
/* Call Annodex function */
is_ready = anx_ready( anx );
- if (is_ready) {
- RETURN_TRUE;
- } else {
- RETURN_FALSE;
- }
+ RETURN_BOOL( is_ready );
}
PHP_FUNCTION(anx_strerror)
@@ -152,3 +132,4 @@
}
+
Modified: phpannodex/trunk/src/phpanx_read.c
===================================================================
--- phpannodex/trunk/src/phpanx_read.c 2005-12-07 23:02:07 UTC (rev 1692)
+++ phpannodex/trunk/src/phpanx_read.c 2005-12-07 23:41:35 UTC (rev 1693)
@@ -7,14 +7,18 @@
{
long ptr_long, n;
ANNODEX *anx;
+ int result;
+ /* Process arguments */
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll",
&ptr_long, &n) == FAILURE) {
RETURN_NULL();
}
-
anx = (ANNODEX*) ptr_long;
- RETURN_TRUE;
+ /* Call Annodex function */
+ result = anx_read( anx );
+
+ RETURN_LONG( result );
}
Modified: phpannodex/trunk/src/phpanx_write.c
===================================================================
--- phpannodex/trunk/src/phpanx_write.c 2005-12-07 23:02:07 UTC (rev 1692)
+++ phpannodex/trunk/src/phpanx_write.c 2005-12-07 23:41:35 UTC (rev 1693)
@@ -62,6 +62,7 @@
AnxClip *clip;
long clipptr_long, anxptr_long;
double at_time;
+ int result;
/* Process arguments */
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ldl",
@@ -70,9 +71,9 @@
}
/* Call Annodex function */
- anx_insert_clip( anx, at_time, clip );
+ result = anx_insert_clip( anx, at_time, clip );
- RETURN_TRUE;
+ RETURN_LONG( result );
}
PHP_FUNCTION(anx_insert_cmml)
--
ctford
More information about the cvs-annodex
mailing list