xref: /aoo41x/main/ucb/source/ucp/ftp/ftpcfunc.cxx (revision 72cd26dd)
12f86921cSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
32f86921cSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
42f86921cSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
52f86921cSAndrew Rist  * distributed with this work for additional information
62f86921cSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
72f86921cSAndrew Rist  * to you under the Apache License, Version 2.0 (the
82f86921cSAndrew Rist  * "License"); you may not use this file except in compliance
92f86921cSAndrew Rist  * with the License.  You may obtain a copy of the License at
102f86921cSAndrew Rist  *
112f86921cSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
122f86921cSAndrew Rist  *
132f86921cSAndrew Rist  * Unless required by applicable law or agreed to in writing,
142f86921cSAndrew Rist  * software distributed under the License is distributed on an
152f86921cSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
162f86921cSAndrew Rist  * KIND, either express or implied.  See the License for the
172f86921cSAndrew Rist  * specific language governing permissions and limitations
182f86921cSAndrew Rist  * under the License.
192f86921cSAndrew Rist  *
202f86921cSAndrew Rist  *************************************************************/
212f86921cSAndrew Rist 
222f86921cSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_ucb.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir /**************************************************************************
28cdf0e10cSrcweir 								TODO
29cdf0e10cSrcweir  **************************************************************************
30cdf0e10cSrcweir 
31cdf0e10cSrcweir  *************************************************************************/
32cdf0e10cSrcweir #include <string.h>
33cdf0e10cSrcweir 
34cdf0e10cSrcweir #include "ftpcontentidentifier.hxx"
35cdf0e10cSrcweir #include "ftpinpstr.hxx"
36*72cd26ddSAriel Constenla-Haile #include <osl/file.h>
37cdf0e10cSrcweir 
38cdf0e10cSrcweir using namespace ftp;
39cdf0e10cSrcweir using namespace com::sun::star::uno;
40cdf0e10cSrcweir 
41cdf0e10cSrcweir extern "C" {
42*72cd26ddSAriel Constenla-Haile 
file_write(void * buffer,size_t size,size_t nmemb,void * stream)43cdf0e10cSrcweir     int file_write(void *buffer,size_t size,size_t nmemb,void *stream)
44cdf0e10cSrcweir     {
45*72cd26ddSAriel Constenla-Haile         oslFileHandle aFile = reinterpret_cast< oslFileHandle >( stream );
46*72cd26ddSAriel Constenla-Haile         if( !aFile )
47cdf0e10cSrcweir             return 0;
48*72cd26ddSAriel Constenla-Haile 
49*72cd26ddSAriel Constenla-Haile         sal_uInt64 nWritten = 0;
50*72cd26ddSAriel Constenla-Haile         sal_uInt64 nToWrite( size * nmemb );
51*72cd26ddSAriel Constenla-Haile         osl_writeFile( aFile, buffer, nToWrite, &nWritten );
52*72cd26ddSAriel Constenla-Haile 
53*72cd26ddSAriel Constenla-Haile         return nWritten != nToWrite ? 0 : nmemb;
54cdf0e10cSrcweir     }
55cdf0e10cSrcweir 
56cdf0e10cSrcweir }
57