From 895f43a6c298d0c745aabe35bba07f73375f3c54 Mon Sep 17 00:00:00 2001 From: Michael Maclean Date: Wed, 2 Jan 2013 20:41:01 +0000 Subject: [PATCH] Remove Arr object --- config.m4 | 2 +- opencv.cpp | 1 - opencv_arr.cpp | 58 ------------------------------------------------ opencv_image.cpp | 2 +- opencv_mat.cpp | 2 +- php_opencv.h | 8 ------- 6 files changed, 3 insertions(+), 70 deletions(-) delete mode 100644 opencv_arr.cpp diff --git a/config.m4 b/config.m4 index 4fdccb3..61c8173 100644 --- a/config.m4 +++ b/config.m4 @@ -27,7 +27,7 @@ if test "$PHP_OPENCV" != "no"; then PHP_NEW_EXTENSION( opencv, - opencv.cpp opencv_error.cpp opencv_mat.cpp opencv_arr.cpp opencv_image.cpp opencv_histogram.cpp opencv_capture.cpp, + opencv.cpp opencv_error.cpp opencv_mat.cpp opencv_image.cpp opencv_histogram.cpp opencv_capture.cpp, $ext_shared, , , diff --git a/opencv.cpp b/opencv.cpp index 9ce8442..d26d7f2 100644 --- a/opencv.cpp +++ b/opencv.cpp @@ -107,7 +107,6 @@ PHP_MINIT_FUNCTION(opencv) */ PHP_MINIT(opencv_error)(INIT_FUNC_ARGS_PASSTHRU); - PHP_MINIT(opencv_arr)(INIT_FUNC_ARGS_PASSTHRU); PHP_MINIT(opencv_mat)(INIT_FUNC_ARGS_PASSTHRU); PHP_MINIT(opencv_image)(INIT_FUNC_ARGS_PASSTHRU); PHP_MINIT(opencv_histogram)(INIT_FUNC_ARGS_PASSTHRU); diff --git a/opencv_arr.cpp b/opencv_arr.cpp deleted file mode 100644 index 7034e73..0000000 --- a/opencv_arr.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Michael Maclean | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_opencv.h" -#include "zend_exceptions.h" - -zend_class_entry *opencv_ce_cvarr; - -/* {{{ proto void contruct() - OpenCV_Arr CANNOT be extended in userspace, this will throw an exception on use */ -PHP_METHOD(OpenCV_Arr, __construct) -{ - zend_throw_exception(opencv_ce_cvexception, "OpenCV\\Arr cannot be constructed", 0 TSRMLS_CC); -} -/* }}} */ - -/* {{{ opencv_arr_methods[] */ -const zend_function_entry opencv_arr_methods[] = { - PHP_ME(OpenCV_Arr, __construct, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - {NULL, NULL, NULL} -}; -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION */ -PHP_MINIT_FUNCTION(opencv_arr) -{ - zend_class_entry ce; - - INIT_NS_CLASS_ENTRY(ce, "OpenCV", "Arr", opencv_arr_methods); - opencv_ce_cvarr = zend_register_internal_class(&ce TSRMLS_CC); - - return SUCCESS; -} -/* }}} */ - - diff --git a/opencv_image.cpp b/opencv_image.cpp index 2cfbd57..fe9819a 100644 --- a/opencv_image.cpp +++ b/opencv_image.cpp @@ -823,7 +823,7 @@ PHP_MINIT_FUNCTION(opencv_image) zend_class_entry ce; INIT_NS_CLASS_ENTRY(ce, "OpenCV", "Image", opencv_image_methods); - opencv_ce_image = zend_register_internal_class_ex(&ce, opencv_ce_cvarr, NULL TSRMLS_CC); + opencv_ce_image = zend_register_internal_class_ex(&ce, opencv_ce_cvmat, NULL TSRMLS_CC); opencv_ce_image->create_object = opencv_image_object_new; #define REGISTER_IMAGE_LONG_CONST(const_name, value) \ diff --git a/opencv_mat.cpp b/opencv_mat.cpp index fbfcebb..5999980 100644 --- a/opencv_mat.cpp +++ b/opencv_mat.cpp @@ -104,7 +104,7 @@ PHP_MINIT_FUNCTION(opencv_mat) zend_class_entry ce; INIT_NS_CLASS_ENTRY(ce, "OpenCV", "Mat", opencv_mat_methods); - opencv_ce_cvarr = zend_register_internal_class_ex(&ce, opencv_ce_cvarr, NULL TSRMLS_CC); + opencv_ce_cvmat = zend_register_internal_class(&ce TSRMLS_CC); return SUCCESS; } diff --git a/php_opencv.h b/php_opencv.h index 26906c1..5d3e715 100644 --- a/php_opencv.h +++ b/php_opencv.h @@ -66,7 +66,6 @@ using namespace cv; PHP_MINIT_FUNCTION(opencv); PHP_MINIT_FUNCTION(opencv_error); PHP_MINIT_FUNCTION(opencv_mat); -PHP_MINIT_FUNCTION(opencv_arr); PHP_MINIT_FUNCTION(opencv_image); PHP_MINIT_FUNCTION(opencv_histogram); PHP_MINIT_FUNCTION(opencv_capture); @@ -77,17 +76,10 @@ PHP_RINIT_FUNCTION(opencv); extern zend_object_handlers opencv_std_object_handlers; extern zend_class_entry *opencv_ce_cvexception; extern zend_class_entry *opencv_ce_cvmat; -extern zend_class_entry *opencv_ce_cvarr; extern zend_class_entry *opencv_ce_image; extern zend_class_entry *opencv_ce_histogram; -typedef struct _opencv_arr_object { - zend_object std; - zend_bool constructed; - CvArr *cvptr; -} opencv_arr_object; - typedef struct _opencv_mat_object { zend_object std; zend_bool constructed;