packages: php-pecl-ssh2/php-pecl-ssh2.spec, php-pecl-ssh2/branch.diff (NEW)...

glen glen at pld-linux.org
Sun Jun 6 19:27:44 CEST 2010


Author: glen                         Date: Sun Jun  6 17:27:44 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- add branch.diff, builds with php53; rel 3

---- Files affected:
packages/php-pecl-ssh2:
   php-pecl-ssh2.spec (1.23 -> 1.24) , branch.diff (NONE -> 1.1)  (NEW), branch.sh (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/php-pecl-ssh2/php-pecl-ssh2.spec
diff -u packages/php-pecl-ssh2/php-pecl-ssh2.spec:1.23 packages/php-pecl-ssh2/php-pecl-ssh2.spec:1.24
--- packages/php-pecl-ssh2/php-pecl-ssh2.spec:1.23	Sun Jun  6 19:24:05 2010
+++ packages/php-pecl-ssh2/php-pecl-ssh2.spec	Sun Jun  6 19:27:38 2010
@@ -1,16 +1,17 @@
 # $Revision$, $Date$
 %define		modname	ssh2
-%define		status		beta
+%define		status	beta
 Summary:	%{modname} - bindings for the libssh2 library
 Summary(pl.UTF-8):	%{modname} - dowiązania do biblioteki libssh2
 Name:		php-pecl-%{modname}
 Version:	0.11.0
-Release:	2
+Release:	3
 License:	PHP
 Group:		Development/Languages/PHP
 Source0:	http://pecl.php.net/get/%{modname}-%{version}.tgz
 # Source0-md5:	9f5dcd5b92299458389038f7318cbc46
 Patch0:		php-pecl-ssh2-libssh2.patch
+Patch1:		branch.diff
 URL:		http://pecl.php.net/package/ssh2/
 BuildRequires:	libssh2-devel >= 0.16
 BuildRequires:	openssl-devel >= 0.9.7d
@@ -35,6 +36,7 @@
 %setup -qc
 mv %{modname}-%{version}/* .
 %patch0 -p0
+%patch1 -p0
 
 %build
 phpize
@@ -72,6 +74,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.24  2010/06/06 17:27:38  glen
+- add branch.diff, builds with php53; rel 3
+
 Revision 1.23  2010/06/06 17:24:05  glen
 - unify
 

================================================================
Index: packages/php-pecl-ssh2/branch.diff
diff -u /dev/null packages/php-pecl-ssh2/branch.diff:1.1
--- /dev/null	Sun Jun  6 19:27:44 2010
+++ packages/php-pecl-ssh2/branch.diff	Sun Jun  6 19:27:38 2010
@@ -0,0 +1,19467 @@
+Index: config.w32
+===================================================================
+--- config.w32	(.../tags/RELEASE_0_11_0)
++++ config.w32	(.../trunk)
+@@ -0,0 +1,37 @@
++// $Id$
++// vim:ft=javascript
++
++ARG_WITH("ssh2", "SSH2 support", "no");
++
++if (PHP_SSH2 != "no") {
++	if ((((PHP_ZLIB=="no") && (CHECK_LIB("zlib_a.lib", "ssh2", PHP_SSH2) ||  CHECK_LIB("zlib.lib", "ssh2", PHP_SSH2))) || 
++		(PHP_ZLIB_SHARED && CHECK_LIB("zlib.lib", "ssh2", PHP_SSH2)) || (PHP_ZLIB == "yes" && (!PHP_ZLIB_SHARED))) &&
++		CHECK_LIB("libeay32.lib", "ssh2", PHP_SSH2) &&
++		CHECK_LIB("ssleay32.lib", "ssh2", PHP_SSH2) &&
++		CHECK_LIB("ws2_32.lib", "ssh2", PHP_SSH2)) {
++
++		// Use bundled lib if none installed, even if it is outdated.
++		if (!(CHECK_LIB("libssh2_a.lib;libssh2.lib", "ssh2", PHP_SSH2) &&
++				CHECK_HEADER_ADD_INCLUDE("libssh2.h", "CFLAGS_SSH2", PHP_PHP_BUILD + "\\include\\libssh2"))) {
++			FSO.CopyFile(configure_module_dirname + "\\libssh2\\src\\libssh2_config.h.in.w32",
++					configure_module_dirname + "\\libssh2\\src\\libssh2_config.h");
++
++			ADD_FLAG('CFLAGS_SSH2', '/DLIBSSH2_WIN32=1 /DLIBSSH2_API= /I ' + 
++					configure_module_dirname + '/libssh2/include');
++		}
++
++		AC_DEFINE('HAVE_SSH2LIB', 1);
++		AC_DEFINE('PHP_SSH2_REMOTE_FORWARDING', 1);
++		AC_DEFINE('PHP_SSH2_HOSTBASED_AUTH', 1);
++		AC_DEFINE('PHP_SSH2_POLL', 1);
++		AC_DEFINE('PHP_SSH2_PUBLICKEY_SUBSYSTEM', 1);
++
++		EXTENSION("ssh2", "ssh2.c ssh2_fopen_wrappers.c ssh2_sftp.c");
++
++		ADD_SOURCES(configure_module_dirname + "/libssh2/src", "channel.c comp.c crypt.c \
++				hostkey.c kex.c mac.c misc.c openssl.c packet.c pem.c publickey.c scp.c \
++				session.c sftp.c transport.c userauth.c", "ssh2");
++	} else {
++		WARNING("ssh2 not enabled: libraries or headers not found");
++	}
++}
+
+Property changes on: config.w32
+___________________________________________________________________
+Added: svn:eol-style
+   + native
+Added: svn:keywords
+   + Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL
+Added: cvs2svn:cvs-rev
+   + 1.11
+
+Index: ssh2.c
+===================================================================
+--- ssh2.c	(.../tags/RELEASE_0_11_0)
++++ ssh2.c	(.../trunk)
+@@ -47,14 +47,9 @@
+ int le_ssh2_pkey_subsys;
+ #endif
+ 
+-#ifdef ZEND_ENGINE_2
+-static
+-    ZEND_BEGIN_ARG_INFO(php_ssh2_first_arg_force_ref, 0)
+-        ZEND_ARG_PASS_INFO(1)
+-    ZEND_END_ARG_INFO()
+-#else
+-static unsigned char php_ssh2_first_arg_force_ref[] = { 1, BYREF_FORCE };
+-#endif
++ZEND_BEGIN_ARG_INFO(php_ssh2_first_arg_force_ref, 0)
++    ZEND_ARG_PASS_INFO(1)
++ZEND_END_ARG_INFO()
+ 
+ /* *************
+    * Callbacks *
+@@ -248,7 +243,7 @@
+ /* {{{ php_ssh2_set_callback
+  * Try to set a method if it's passed in with the hash table
+  */
+-static int php_ssh2_set_callback(LIBSSH2_SESSION *session, HashTable *ht, char *callback, int callback_len, int callback_type, php_ssh2_session_data *data)
++static int php_ssh2_set_callback(LIBSSH2_SESSION *session, HashTable *ht, char *callback, int callback_len, int callback_type, php_ssh2_session_data *data TSRMLS_DC)
+ {
+ 	zval **handler, *copyval;
+ 	void *internal_handler;
+@@ -257,7 +252,7 @@
+ 		return 0;
+ 	}
+ 
+-	if (!handler || !*handler || !zend_is_callable(*handler, 0, NULL)) {
++	if (!handler || !*handler || !zend_is_callable(*handler, 0, NULL ZEND_IS_CALLABLE_TSRMLS_CC)) {
+ 		return -1;
+ 	}
+ 
+@@ -358,7 +353,7 @@
+ 	if (!session) {
+ 		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to initialize SSH2 session");
+ 		efree(data);
+-		close(socket);
++		closesocket(socket);
+ 		return NULL;
+ 	}
+ 	libssh2_banner_set(session, LIBSSH2_SSH_DEFAULT_BANNER " PHP");
+@@ -411,19 +406,19 @@
+ 	if (callbacks) {
+ 		/* ignore debug disconnect macerror */
+ 
+-		if (php_ssh2_set_callback(session, HASH_OF(callbacks), "ignore", sizeof("ignore") - 1, LIBSSH2_CALLBACK_IGNORE, data)) {
++		if (php_ssh2_set_callback(session, HASH_OF(callbacks), "ignore", sizeof("ignore") - 1, LIBSSH2_CALLBACK_IGNORE, data TSRMLS_CC)) {
+ 			php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed setting IGNORE callback");
+ 		}
+ 
+-		if (php_ssh2_set_callback(session, HASH_OF(callbacks), "debug", sizeof("debug") - 1, LIBSSH2_CALLBACK_DEBUG, data)) {
++		if (php_ssh2_set_callback(session, HASH_OF(callbacks), "debug", sizeof("debug") - 1, LIBSSH2_CALLBACK_DEBUG, data TSRMLS_CC)) {
+ 			php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed setting DEBUG callback");
+ 		}
+ 
+-		if (php_ssh2_set_callback(session, HASH_OF(callbacks), "macerror", sizeof("macerror") - 1, LIBSSH2_CALLBACK_MACERROR, data)) {
++		if (php_ssh2_set_callback(session, HASH_OF(callbacks), "macerror", sizeof("macerror") - 1, LIBSSH2_CALLBACK_MACERROR, data TSRMLS_CC)) {
+ 			php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed setting MACERROR callback");
+ 		}
+ 
+-		if (php_ssh2_set_callback(session, HASH_OF(callbacks), "disconnect", sizeof("disconnect") - 1, LIBSSH2_CALLBACK_DISCONNECT, data)) {
++		if (php_ssh2_set_callback(session, HASH_OF(callbacks), "disconnect", sizeof("disconnect") - 1, LIBSSH2_CALLBACK_DISCONNECT, data TSRMLS_CC)) {
+ 			php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed setting DISCONNECT callback");
+ 		}
+ 	}
+@@ -434,7 +429,7 @@
+ 
+ 		last_error = libssh2_session_last_error(session, &error_msg, NULL, 0);
+ 		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error starting up SSH connection(%d): %s", last_error, error_msg);
+-		close(socket);
++		closesocket(socket);
+ 		libssh2_session_free(session);
+ 		efree(data);
+ 		return NULL;
+@@ -1148,7 +1143,7 @@
+ 			zval_ptr_dtor(&(*data)->disconnect_cb);
+ 		}
+ 
+-		close((*data)->socket);
++		closesocket((*data)->socket);
+ 
+ 		efree(*data);
+ 		*data = NULL;
+@@ -1274,7 +1269,7 @@
+ 
+ /* {{{ ssh2_functions[]
+  */
+-function_entry ssh2_functions[] = {
++zend_function_entry ssh2_functions[] = {
+ 	PHP_FE(ssh2_connect,						NULL)
+ 	PHP_FE(ssh2_methods_negotiated,				NULL)
+ 	PHP_FE(ssh2_fingerprint,					NULL)
+
+Property changes on: ssh2.c
+___________________________________________________________________
+Modified: cvs2svn:cvs-rev
+   - 1.22
+   + 1.25
+
+Index: libssh2/include/libssh2_publickey.h
+===================================================================
+--- libssh2/include/libssh2_publickey.h	(.../tags/RELEASE_0_11_0)
++++ libssh2/include/libssh2_publickey.h	(.../trunk)
+@@ -0,0 +1,101 @@
++/* Copyright (c) 2004-2006, Sara Golemon <sarag at libssh2.org>
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms,
++ * with or without modification, are permitted provided
++ * that the following conditions are met:
++ *
++ *   Redistributions of source code must retain the above
++ *   copyright notice, this list of conditions and the
++ *   following disclaimer.
++ *
++ *   Redistributions in binary form must reproduce the above
++ *   copyright notice, this list of conditions and the following
++ *   disclaimer in the documentation and/or other materials
++ *   provided with the distribution.
++ *
++ *   Neither the name of the copyright holder nor the names
++ *   of any other contributors may be used to endorse or
++ *   promote products derived from this software without
++ *   specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
++ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
++ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
++ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
++ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
++ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
++ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
++ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
++ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
++ * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
++ * OF SUCH DAMAGE.
++ */
++
++/* Note: This include file is only needed for using the
++ * publickey SUBSYSTEM which is not the same as publickey
++ * authentication.  For authentication you only need libssh2.h
++ *
++ * For more information on the publickey subsystem,
++ * refer to IETF draft: secsh-publickey
++ */
++
++#ifndef LIBSSH2_PUBLICKEY_H
++#define LIBSSH2_PUBLICKEY_H 1
++
++typedef struct _LIBSSH2_PUBLICKEY               LIBSSH2_PUBLICKEY;
++
++typedef struct _libssh2_publickey_attribute {
++    const char *name;
++    unsigned long name_len;
++    const char *value;
++    unsigned long value_len;
++    char mandatory;
++} libssh2_publickey_attribute;
++
++typedef struct _libssh2_publickey_list {
++    unsigned char *packet; /* For freeing */
++
++    const unsigned char *name;
++    unsigned long name_len;
++    const unsigned char *blob;
++    unsigned long blob_len;
++    unsigned long num_attrs;
++    libssh2_publickey_attribute *attrs; /* free me */
++} libssh2_publickey_list;
++
++/* Generally use the first macro here, but if both name and value are string literals, you can use _fast() to take advantage of preprocessing */
++#define libssh2_publickey_attribute(name, value, mandatory)         { (name), strlen(name), (value), strlen(value), (mandatory) },
++#define libssh2_publickey_attribute_fast(name, value, mandatory)    { (name), sizeof(name) - 1, (value), sizeof(value) - 1, (mandatory) },
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++/* Publickey Subsystem */
++LIBSSH2_API LIBSSH2_PUBLICKEY *libssh2_publickey_init(LIBSSH2_SESSION *session);
++
++LIBSSH2_API int libssh2_publickey_add_ex(LIBSSH2_PUBLICKEY *pkey, const unsigned char *name, unsigned long name_len,
++                                                            const unsigned char *blob, unsigned long blob_len, char overwrite,
++                                                            unsigned long num_attrs, const libssh2_publickey_attribute attrs[]);
++#define libssh2_publickey_add(pkey, name, blob, blob_len, overwrite, num_attrs, attrs) \
++        libssh2_publickey_add_ex((pkey), (name), strlen(name), (blob), (blob_len), (overwrite), (num_attrs), (attrs))
++
++LIBSSH2_API int libssh2_publickey_remove_ex(LIBSSH2_PUBLICKEY *pkey, const unsigned char *name, unsigned long name_len,
++                                                            const unsigned char *blob, unsigned long blob_len);
++#define libssh2_publickey_remove(pkey, name, blob, blob_len) \
++        libssh2_publickey_remove_ex((pkey), (name), strlen(name), (blob), (blob_len))
++
++LIBSSH2_API int libssh2_publickey_list_fetch(LIBSSH2_PUBLICKEY *pkey, unsigned long *num_keys, libssh2_publickey_list **pkey_list);
++LIBSSH2_API void libssh2_publickey_list_free(LIBSSH2_PUBLICKEY *pkey, libssh2_publickey_list *pkey_list);
++
++LIBSSH2_API int libssh2_publickey_shutdown(LIBSSH2_PUBLICKEY *pkey);
++
++#ifdef __cplusplus
++} /* extern "C" */
++#endif
++
++#endif /* ndef: LIBSSH2_PUBLICKEY_H */
+
+Property changes on: libssh2/include/libssh2_publickey.h
+___________________________________________________________________
+Added: svn:mime-type
+   + text/x-c
+Added: svn:keywords
+   + Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL
+Added: cvs2svn:cvs-rev
+   + 1.2
+Added: svn:eol-style
+   + native
+
+Index: libssh2/include/libssh2_sftp.h
+===================================================================
+--- libssh2/include/libssh2_sftp.h	(.../tags/RELEASE_0_11_0)
++++ libssh2/include/libssh2_sftp.h	(.../trunk)
+@@ -0,0 +1,251 @@
++/* Copyright (c) 2004-2008, Sara Golemon <sarag at libssh2.org>
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms,
++ * with or without modification, are permitted provided
++ * that the following conditions are met:
++ *
++ *   Redistributions of source code must retain the above
++ *   copyright notice, this list of conditions and the
++ *   following disclaimer.
++ *
++ *   Redistributions in binary form must reproduce the above
++ *   copyright notice, this list of conditions and the following
++ *   disclaimer in the documentation and/or other materials
++ *   provided with the distribution.
++ *
++ *   Neither the name of the copyright holder nor the names
++ *   of any other contributors may be used to endorse or
++ *   promote products derived from this software without
++ *   specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
++ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
++ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
++ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
++ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
++ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
++ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
++ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
++ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
++ * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
++ * OF SUCH DAMAGE.
++ */
++
++#ifndef LIBSSH2_SFTP_H
++#define LIBSSH2_SFTP_H 1
++
++#ifndef WIN32
++#include <unistd.h>
++#endif
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++/* Note: Version 6 was documented at the time of writing
++ * However it was marked as "DO NOT IMPLEMENT" due to pending changes
++ *
++ * Let's start with Version 3 (The version found in OpenSSH) and go from there
++ */
++#define LIBSSH2_SFTP_VERSION        3
++#define LIBSSH2_SFTP_PACKET_MAXLEN  40000
++
++typedef struct _LIBSSH2_SFTP                LIBSSH2_SFTP;
++typedef struct _LIBSSH2_SFTP_HANDLE         LIBSSH2_SFTP_HANDLE;
++typedef struct _LIBSSH2_SFTP_ATTRIBUTES     LIBSSH2_SFTP_ATTRIBUTES;
++
++/* Flags for open_ex() */
++#define LIBSSH2_SFTP_OPENFILE           0
++#define LIBSSH2_SFTP_OPENDIR            1
++
++/* Flags for rename_ex() */
++#define LIBSSH2_SFTP_RENAME_OVERWRITE   0x00000001
++#define LIBSSH2_SFTP_RENAME_ATOMIC      0x00000002
++#define LIBSSH2_SFTP_RENAME_NATIVE      0x00000004
++
++/* Flags for stat_ex() */
++#define LIBSSH2_SFTP_STAT               0
++#define LIBSSH2_SFTP_LSTAT              1
++#define LIBSSH2_SFTP_SETSTAT            2
++
++/* Flags for symlink_ex() */
++#define LIBSSH2_SFTP_SYMLINK            0
++#define LIBSSH2_SFTP_READLINK           1
++#define LIBSSH2_SFTP_REALPATH           2
++
++/* SFTP attribute flag bits */
++#define LIBSSH2_SFTP_ATTR_SIZE              0x00000001
++#define LIBSSH2_SFTP_ATTR_UIDGID            0x00000002
++#define LIBSSH2_SFTP_ATTR_PERMISSIONS       0x00000004
++#define LIBSSH2_SFTP_ATTR_ACMODTIME         0x00000008
++#define LIBSSH2_SFTP_ATTR_EXTENDED          0x80000000
++
++struct _LIBSSH2_SFTP_ATTRIBUTES {
++    /* If flags & ATTR_* bit is set, then the value in this struct will be meaningful
++     * Otherwise it should be ignored
++     */
++    unsigned long flags;
++
++    libssh2_uint64_t filesize;
++    unsigned long uid, gid;
++    unsigned long permissions;
++    unsigned long atime, mtime;
++};
++
++/* SFTP filetypes */
++#define LIBSSH2_SFTP_TYPE_REGULAR           1
++#define LIBSSH2_SFTP_TYPE_DIRECTORY         2
++#define LIBSSH2_SFTP_TYPE_SYMLINK           3
++#define LIBSSH2_SFTP_TYPE_SPECIAL           4
++#define LIBSSH2_SFTP_TYPE_UNKNOWN           5
++#define LIBSSH2_SFTP_TYPE_SOCKET            6
++#define LIBSSH2_SFTP_TYPE_CHAR_DEVICE       7
++#define LIBSSH2_SFTP_TYPE_BLOCK_DEVICE      8
++#define LIBSSH2_SFTP_TYPE_FIFO              9
++
++/*
++ * Reproduce the POSIX file modes here for systems that are not
++ * POSIX compliant.  
++ *
++ * These is used in "permissions" of "struct _LIBSSH2_SFTP_ATTRIBUTES"
++ */
++/* File type */
++#define LIBSSH2_SFTP_S_IFMT         0170000     /* type of file mask */
++#define LIBSSH2_SFTP_S_IFIFO        0010000     /* named pipe (fifo) */
++#define LIBSSH2_SFTP_S_IFCHR        0020000     /* character special */
++#define LIBSSH2_SFTP_S_IFDIR        0040000     /* directory */
++#define LIBSSH2_SFTP_S_IFBLK        0060000     /* block special */
++#define LIBSSH2_SFTP_S_IFREG        0100000     /* regular */
++#define LIBSSH2_SFTP_S_IFLNK        0120000     /* symbolic link */
++#define LIBSSH2_SFTP_S_IFSOCK       0140000     /* socket */
++
++/* File mode */
++/* Read, write, execute/search by owner */
++#define LIBSSH2_SFTP_S_IRWXU        0000700     /* RWX mask for owner */
++#define LIBSSH2_SFTP_S_IRUSR        0000400     /* R for owner */
++#define LIBSSH2_SFTP_S_IWUSR        0000200     /* W for owner */
++#define LIBSSH2_SFTP_S_IXUSR        0000100     /* X for owner */
++/* Read, write, execute/search by group */
++#define LIBSSH2_SFTP_S_IRWXG        0000070     /* RWX mask for group */
++#define LIBSSH2_SFTP_S_IRGRP        0000040     /* R for group */
++#define LIBSSH2_SFTP_S_IWGRP        0000020     /* W for group */
++#define LIBSSH2_SFTP_S_IXGRP        0000010     /* X for group */
++/* Read, write, execute/search by others */
++#define LIBSSH2_SFTP_S_IRWXO        0000007     /* RWX mask for other */
++#define LIBSSH2_SFTP_S_IROTH        0000004     /* R for other */
++#define LIBSSH2_SFTP_S_IWOTH        0000002     /* W for other */
++#define LIBSSH2_SFTP_S_IXOTH        0000001     /* X for other */
++
++/* SFTP File Transfer Flags -- (e.g. flags parameter to sftp_open())
++ * Danger will robinson... APPEND doesn't have any effect on OpenSSH servers */
++#define LIBSSH2_FXF_READ                        0x00000001
++#define LIBSSH2_FXF_WRITE                       0x00000002
++#define LIBSSH2_FXF_APPEND                      0x00000004
++#define LIBSSH2_FXF_CREAT                       0x00000008
++#define LIBSSH2_FXF_TRUNC                       0x00000010
++#define LIBSSH2_FXF_EXCL                        0x00000020
++
++/* SFTP Status Codes (returned by libssh2_sftp_last_error() ) */
++#define LIBSSH2_FX_OK                       0
++#define LIBSSH2_FX_EOF                      1
++#define LIBSSH2_FX_NO_SUCH_FILE             2
++#define LIBSSH2_FX_PERMISSION_DENIED        3
++#define LIBSSH2_FX_FAILURE                  4
++#define LIBSSH2_FX_BAD_MESSAGE              5
++#define LIBSSH2_FX_NO_CONNECTION            6
++#define LIBSSH2_FX_CONNECTION_LOST          7
++#define LIBSSH2_FX_OP_UNSUPPORTED           8
++#define LIBSSH2_FX_INVALID_HANDLE           9
++#define LIBSSH2_FX_NO_SUCH_PATH             10
++#define LIBSSH2_FX_FILE_ALREADY_EXISTS      11
++#define LIBSSH2_FX_WRITE_PROTECT            12
++#define LIBSSH2_FX_NO_MEDIA                 13
++#define LIBSSH2_FX_NO_SPACE_ON_FILESYSTEM   14
++#define LIBSSH2_FX_QUOTA_EXCEEDED           15
++#define LIBSSH2_FX_UNKNOWN_PRINCIPLE        16 /* Initial mis-spelling */
++#define LIBSSH2_FX_UNKNOWN_PRINCIPAL        16
++#define LIBSSH2_FX_LOCK_CONFlICT            17 /* Initial mis-spelling */
++#define LIBSSH2_FX_LOCK_CONFLICT            17
++#define LIBSSH2_FX_DIR_NOT_EMPTY            18
++#define LIBSSH2_FX_NOT_A_DIRECTORY          19
++#define LIBSSH2_FX_INVALID_FILENAME         20
++#define LIBSSH2_FX_LINK_LOOP                21
++
++/* Returned by any function that would block during a read/write opperation */
++#define LIBSSH2SFTP_EAGAIN LIBSSH2_ERROR_EAGAIN
++
++/* SFTP API */
++LIBSSH2_API LIBSSH2_SFTP *libssh2_sftp_init(LIBSSH2_SESSION *session);
++LIBSSH2_API int libssh2_sftp_shutdown(LIBSSH2_SFTP *sftp);
++LIBSSH2_API unsigned long libssh2_sftp_last_error(LIBSSH2_SFTP *sftp);
++
++/* File / Directory Ops */
++LIBSSH2_API LIBSSH2_SFTP_HANDLE *libssh2_sftp_open_ex(LIBSSH2_SFTP *sftp, const char *filename, unsigned int filename_len,
++                                                      unsigned long flags, long mode, int open_type);
++#define libssh2_sftp_open(sftp, filename, flags, mode) \
++                    libssh2_sftp_open_ex((sftp), (filename), strlen(filename), (flags), (mode), LIBSSH2_SFTP_OPENFILE)
++#define libssh2_sftp_opendir(sftp, path) \
++                    libssh2_sftp_open_ex((sftp), (path), strlen(path), 0, 0, LIBSSH2_SFTP_OPENDIR)
++
++LIBSSH2_API ssize_t libssh2_sftp_read(LIBSSH2_SFTP_HANDLE *handle, char *buffer, size_t buffer_maxlen);
++
++LIBSSH2_API int libssh2_sftp_readdir_ex(LIBSSH2_SFTP_HANDLE *handle, char *buffer, size_t buffer_maxlen, 
++                                        char *longentry, size_t longentry_maxlen, 
++                                        LIBSSH2_SFTP_ATTRIBUTES *attrs);
++#define libssh2_sftp_readdir(handle, buffer, buffer_maxlen, attrs) \
++                    libssh2_sftp_readdir_ex((handle), (buffer), (buffer_maxlen), NULL, 0, (attrs))
++
++LIBSSH2_API ssize_t libssh2_sftp_write(LIBSSH2_SFTP_HANDLE *handle, const char *buffer, size_t count);
++
++LIBSSH2_API int libssh2_sftp_close_handle(LIBSSH2_SFTP_HANDLE *handle);
++#define libssh2_sftp_close(handle)                  libssh2_sftp_close_handle(handle)
++#define libssh2_sftp_closedir(handle)               libssh2_sftp_close_handle(handle)
++
++LIBSSH2_API void libssh2_sftp_seek(LIBSSH2_SFTP_HANDLE *handle, size_t offset);
++LIBSSH2_API void libssh2_sftp_seek64(LIBSSH2_SFTP_HANDLE *handle, libssh2_uint64_t offset);
++#define libssh2_sftp_rewind(handle)         libssh2_sftp_seek64((handle), 0)
++
++LIBSSH2_API size_t libssh2_sftp_tell(LIBSSH2_SFTP_HANDLE *handle);
++LIBSSH2_API libssh2_uint64_t libssh2_sftp_tell64(LIBSSH2_SFTP_HANDLE *handle);
++
++LIBSSH2_API int libssh2_sftp_fstat_ex(LIBSSH2_SFTP_HANDLE *handle, LIBSSH2_SFTP_ATTRIBUTES *attrs, int setstat);
++#define libssh2_sftp_fstat(handle, attrs)               libssh2_sftp_fstat_ex((handle), (attrs), 0)
++#define libssh2_sftp_fsetstat(handle, attrs)            libssh2_sftp_fstat_ex((handle), (attrs), 1)
++
++
++
++/* Miscellaneous Ops */
++LIBSSH2_API int libssh2_sftp_rename_ex(LIBSSH2_SFTP *sftp,  const char *source_filename,    unsigned int srouce_filename_len,
++                                                            const char *dest_filename,      unsigned int dest_filename_len,
++                                                            long flags);
++#define libssh2_sftp_rename(sftp, sourcefile, destfile)     libssh2_sftp_rename_ex((sftp), (sourcefile), strlen(sourcefile), (destfile), strlen(destfile), \
++                                                            LIBSSH2_SFTP_RENAME_OVERWRITE | LIBSSH2_SFTP_RENAME_ATOMIC | LIBSSH2_SFTP_RENAME_NATIVE)
++
++LIBSSH2_API int libssh2_sftp_unlink_ex(LIBSSH2_SFTP *sftp, const char *filename, unsigned int filename_len);
++#define libssh2_sftp_unlink(sftp, filename)                 libssh2_sftp_unlink_ex((sftp), (filename), strlen(filename))
++
++LIBSSH2_API int libssh2_sftp_mkdir_ex(LIBSSH2_SFTP *sftp, const char *path, unsigned int path_len, long mode);
++#define libssh2_sftp_mkdir(sftp, path, mode)                libssh2_sftp_mkdir_ex((sftp), (path), strlen(path), (mode))
++
++LIBSSH2_API int libssh2_sftp_rmdir_ex(LIBSSH2_SFTP *sftp, const char *path, unsigned int path_len);
++#define libssh2_sftp_rmdir(sftp, path)                      libssh2_sftp_rmdir_ex((sftp), (path), strlen(path))
++
++LIBSSH2_API int libssh2_sftp_stat_ex(LIBSSH2_SFTP *sftp, const char *path, unsigned int path_len, int stat_type, LIBSSH2_SFTP_ATTRIBUTES *attrs);
++#define libssh2_sftp_stat(sftp, path, attrs)                libssh2_sftp_stat_ex((sftp), (path), strlen(path), LIBSSH2_SFTP_STAT, (attrs))
++#define libssh2_sftp_lstat(sftp, path, attrs)               libssh2_sftp_stat_ex((sftp), (path), strlen(path), LIBSSH2_SFTP_LSTAT, (attrs))
++#define libssh2_sftp_setstat(sftp, path, attrs)             libssh2_sftp_stat_ex((sftp), (path), strlen(path), LIBSSH2_SFTP_SETSTAT, (attrs))
++
++LIBSSH2_API int libssh2_sftp_symlink_ex(LIBSSH2_SFTP *sftp, const char *path, unsigned int path_len, char *target, unsigned int target_len, int link_type);
++#define libssh2_sftp_symlink(sftp, orig, linkpath)          libssh2_sftp_symlink_ex((sftp), (orig), strlen(orig), (linkpath), strlen(linkpath), LIBSSH2_SFTP_SYMLINK)
++#define libssh2_sftp_readlink(sftp, path, target, maxlen)   libssh2_sftp_symlink_ex((sftp), (path), strlen(path), (target), (maxlen), LIBSSH2_SFTP_READLINK)
++#define libssh2_sftp_realpath(sftp, path, target, maxlen)   libssh2_sftp_symlink_ex((sftp), (path), strlen(path), (target), (maxlen), LIBSSH2_SFTP_REALPATH)
++
++#ifdef __cplusplus
++} /* extern "C" */
++#endif
++
++#endif /* LIBSSH2_SFTP_H */
+
+Property changes on: libssh2/include/libssh2_sftp.h
+___________________________________________________________________
+Added: svn:mime-type
+   + text/x-c
+Added: svn:keywords
+   + Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL
+Added: cvs2svn:cvs-rev
+   + 1.2
+Added: svn:eol-style
+   + native
+
+Index: libssh2/include/libssh2.h
+===================================================================
+--- libssh2/include/libssh2.h	(.../tags/RELEASE_0_11_0)
<<Diff was trimmed, longer than 597 lines>>

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/php-pecl-ssh2/php-pecl-ssh2.spec?r1=1.23&r2=1.24&f=u



More information about the pld-cvs-commit mailing list