diff options
author | Andreas Bille <abi@openoffice.org> | 2002-10-15 08:21:19 +0000 |
---|---|---|
committer | Andreas Bille <abi@openoffice.org> | 2002-10-15 08:21:19 +0000 |
commit | c4baeafbbf7f40dc17c04f6e9522d812da54da71 (patch) | |
tree | 41affdeafe66d354e594be3c3e4e23753630ec79 /ucb/source/ucp/ftp/ftpcfunc.cxx | |
parent | 40b51f98c4b2717d8369002b4c8719840727a5ee (diff) |
#100904# mostly complete now
Diffstat (limited to 'ucb/source/ucp/ftp/ftpcfunc.cxx')
-rw-r--r-- | ucb/source/ucp/ftp/ftpcfunc.cxx | 65 |
1 files changed, 11 insertions, 54 deletions
diff --git a/ucb/source/ucp/ftp/ftpcfunc.cxx b/ucb/source/ucp/ftp/ftpcfunc.cxx index 135e56c1b2d1..b0afeecc83ac 100644 --- a/ucb/source/ucp/ftp/ftpcfunc.cxx +++ b/ucb/source/ucp/ftp/ftpcfunc.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ftpcfunc.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: abi $ $Date: 2002-08-28 07:29:49 $ + * last change: $Author: abi $ $Date: 2002-10-15 09:21:15 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -68,6 +68,7 @@ #include "ftpcontentidentifier.hxx" #include "ftpinpstr.hxx" +#include <stdio.h> using namespace ftp; using namespace com::sun::star::uno; @@ -86,62 +87,18 @@ extern "C" { } -// int write2InputStream(void *buffer,size_t size,size_t nmemb,void *stream) -// { -// size_t ret = size*nmemb; -// if(!(stream && ret)) // OK, no error if nothing can be written. -// return ret; - -// FTPBufferContainer *p = -// reinterpret_cast<FTPBufferContainer*>(stream); -// if(p && p->m_out) -// p->m_out->append(buffer,size,nmemb); -// return ret; -// } - - -// /** Callback for curl_easy_perform(), -// * forwarding the written content to the outputstream. -// */ - -// int write2OutputStream(void *buffer,size_t size,size_t nmemb,void *stream) -// { -// size_t ret = size*nmemb; - -// if(!(stream && ret)) // OK, no error if nothing can be written. -// return ret; - -// try{ -// FTPStreamContainer *p = -// reinterpret_cast<FTPStreamContainer*>(stream); -// if(p && p->m_out.is()) -// p->m_out->writeBytes( -// Sequence<sal_Int8>(static_cast<sal_Int8*>(buffer), -// size*nmemb) -// ); -// return ret; -// } catch(const Exception&) { -// return 0; -// } -// } + int file_write(void *buffer,size_t size,size_t nmemb,void *stream) + { + FILE* file = + reinterpret_cast<FILE*>(stream); + if(!file) + return 0; + return fwrite(buffer,size,nmemb,file); + } int ftp_passwd(void *client,char*prompt,char*buffer,int bufferlength) { -// FTPClient *p = -// reinterpret_cast<FTPClient>(client); - -// // 'passwd' returns actually "username:password" -// rtl::OUString passwd = p->passwd(); -// rtl::OString opasswd(passwd.getStr(), -// passwd.getLength(), -// RTL_TEXTENCODING_UTF8); -// if(strlen(opasswd.getStr()) <= bufferlength) -// strncpy(buffer,opasswd.getStr(),opasswd.getLength()); -// else -// strcpy(buffer,opasswd.getStr()); - strcpy(buffer,"psswd"); - return 0; } |