[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pecl-cvs
Subject:    [PECL-CVS] =?utf-8?q?svn:_/pecl/rsync/trunk/_config.m4_functions.c_rsync.c?=
From:       Anatoliy_Belsky <ab () php ! net>
Date:       2011-07-30 12:14:42
Message-ID: svn-ab-1312028082-313966-441255908 () svn ! php ! net
[Download RAW message or body]

ab                                       Sat, 30 Jul 2011 12:14:42 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=313966

Log:
moved the object related functions into the rsync.c

Changed paths:
    U   pecl/rsync/trunk/config.m4
    D   pecl/rsync/trunk/functions.c
    U   pecl/rsync/trunk/rsync.c

Modified: pecl/rsync/trunk/config.m4
===================================================================
--- pecl/rsync/trunk/config.m4	2011-07-30 11:44:34 UTC (rev 313965)
+++ pecl/rsync/trunk/config.m4	2011-07-30 12:14:42 UTC (rev 313966)
@@ -29,7 +29,7 @@
       librsync/rollsum.c librsync/scoop.c librsync/search.c librsync/stats.c \
       librsync/stream.c librsync/sumset.c librsync/trace.c librsync/tube.c \
       librsync/util.c librsync/version.c librsync/whole.c"
-      PHP_NEW_EXTENSION(rsync, $librsync_sources functions.c rsync.c, $ext_shared,,-I./librsync)
+      PHP_NEW_EXTENSION(rsync, $librsync_sources rsync.c, $ext_shared,,-I./librsync)

       PHP_ADD_BUILD_DIR($ext_builddir/librsync)
       dnl  PHP_INSTALL_HEADERS([ext/rsync], [php_rsync.h rsync/])
@@ -71,7 +71,7 @@
       -L$RSYNC_DIR/lib -lm
     ])

-    PHP_NEW_EXTENSION(rsync, functions.c rsync.c, $ext_shared)
+    PHP_NEW_EXTENSION(rsync, rsync.c, $ext_shared)
   fi

   dnl # --with-rsync -> add include path

Deleted: pecl/rsync/trunk/functions.c
===================================================================
--- pecl/rsync/trunk/functions.c	2011-07-30 11:44:34 UTC (rev 313965)
+++ pecl/rsync/trunk/functions.c	2011-07-30 12:14:42 UTC (rev 313966)
@@ -1,79 +0,0 @@
-/*
-  +--------------------------------------------------------------------+
-  | PECL :: rsync                                                      |
-  +--------------------------------------------------------------------+
-  | Redistribution and use in source and binary forms, with or without |
-  | modification, are permitted provided that the conditions mentioned |
-  | in the accompanying LICENSE file are met.                          |
-  +--------------------------------------------------------------------+
-  | Copyright (c) 2010 Michele Catalano <michele@catalano.de>          |
-  |                    Anatoliy Belsky <ab@php.net>                    |
-  +--------------------------------------------------------------------+
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "php.h"
-#include "php_ini.h"
-#include "ext/standard/info.h"
-#include "php_rsync.h"
-
-/* $Id: header 252479 2008-02-07 19:39:50Z iliaa $ */
-
-void
-php_rsync_object_destroy(void *obj TSRMLS_DC)
-{
-    struct ze_rsync_main_obj *zrmo = (struct ze_rsync_main_obj*) obj;
-
-    zend_object_std_dtor(&zrmo->zo TSRMLS_CC);
-
-    if (zrmo->has_log_cb) {
-        efree(&zrmo->log_cb);
-    }
-
-    efree(zrmo);
-}
-
-zend_object_value
-php_rsync_object_init(zend_class_entry *ze TSRMLS_DC)
-{
-    zend_object_value ret;
-    struct ze_rsync_main_obj *zrmo;
-    zval *tmp;
-
-    zrmo = (struct ze_rsync_main_obj*) emalloc(sizeof(struct ze_rsync_main_obj));
-    memset(&zrmo->zo, 0, sizeof(zend_object));
-
-    zend_object_std_init(&zrmo->zo, ze TSRMLS_CC);
-    zend_hash_copy(zrmo->zo.properties, &ze->default_properties,
-            (copy_ctor_func_t) zval_add_ref,
-            (void*) &tmp, sizeof(zval *));
-
-    zrmo->block_length = RS_DEFAULT_BLOCK_LEN;
-    zrmo->strong_length = RS_DEFAULT_STRONG_LEN;
-    zrmo->log_stats = 0;
-    zrmo->has_log_cb = 0;
-    zrmo->error = 0;
-    zrmo->log_cb.fci.function_name = NULL;
-#if PHP_VERSION_ID >= 50300
-        zrmo->log_cb.fci.object_ptr = NULL;
-#endif
-
-    ret.handle = zend_objects_store_put(zrmo, NULL,
-            (zend_objects_free_object_storage_t) php_rsync_object_destroy,
-            NULL TSRMLS_CC);
-
-    ret.handlers = zend_get_std_object_handlers();
-    ret.handlers->clone_obj = NULL;
-
-    return ret;
-}
-
-void
-php_rsync_generate_signature(void)
-{
-
-}
-

Modified: pecl/rsync/trunk/rsync.c
===================================================================
--- pecl/rsync/trunk/rsync.c	2011-07-30 11:44:34 UTC (rev 313965)
+++ pecl/rsync/trunk/rsync.c	2011-07-30 12:14:42 UTC (rev 313966)
@@ -99,9 +99,6 @@
 /* }}} */
 #endif

-extern zend_object_value php_rsync_object_init(zend_class_entry *ze TSRMLS_DC);
-//php_stream *php_rsync_file_open(zval **file, char *mode, char *name TSRMLS_DC);
-
 ZEND_BEGIN_ARG_INFO_EX(arginfo_rsync_generate_signature, 0, 0, 2)
     ZEND_ARG_INFO(0, file)
     ZEND_ARG_INFO(0, signaturfile)
@@ -148,7 +145,7 @@
 /* }}} */

 /* The main rsync class entry */
-zend_class_entry *Rsync_ce;
+static zend_class_entry *Rsync_ce;

 /* {{{ Rsync_methods[] */
 const zend_function_entry Rsync_methods[] = {
@@ -204,7 +201,59 @@
 PHP_INI_END()
 /* }}} */

+/* {{{ php_rsync_object_destroy */
+void
+php_rsync_object_destroy(void *obj TSRMLS_DC)
+{
+    struct ze_rsync_main_obj *zrmo = (struct ze_rsync_main_obj*) obj;

+    zend_object_std_dtor(&zrmo->zo TSRMLS_CC);
+
+    if (zrmo->has_log_cb) {
+        efree(&zrmo->log_cb);
+    }
+
+    efree(zrmo);
+}
+/* }}} */
+
+/* {{{ php_rsync_object_init */
+zend_object_value
+php_rsync_object_init(zend_class_entry *ze TSRMLS_DC)
+{
+    zend_object_value ret;
+    struct ze_rsync_main_obj *zrmo;
+    zval *tmp;
+
+    zrmo = (struct ze_rsync_main_obj*) emalloc(sizeof(struct ze_rsync_main_obj));
+    memset(&zrmo->zo, 0, sizeof(zend_object));
+
+    zend_object_std_init(&zrmo->zo, ze TSRMLS_CC);
+    zend_hash_copy(zrmo->zo.properties, &ze->default_properties,
+            (copy_ctor_func_t) zval_add_ref,
+            (void*) &tmp, sizeof(zval *));
+
+    zrmo->block_length = RS_DEFAULT_BLOCK_LEN;
+    zrmo->strong_length = RS_DEFAULT_STRONG_LEN;
+    zrmo->log_stats = 0;
+    zrmo->has_log_cb = 0;
+    zrmo->error = 0;
+    zrmo->log_cb.fci.function_name = NULL;
+#if PHP_VERSION_ID >= 50300
+        zrmo->log_cb.fci.object_ptr = NULL;
+#endif
+
+    ret.handle = zend_objects_store_put(zrmo, NULL,
+            (zend_objects_free_object_storage_t) php_rsync_object_destroy,
+            NULL TSRMLS_CC);
+
+    ret.handlers = zend_get_std_object_handlers();
+    ret.handlers->clone_obj = NULL;
+
+    return ret;
+}
+/* }}} */
+
 /* {{{ php_rsync_file_open
  *
  */



-- 
PECL CVS Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic