ftpcfunc.cxx (2f86921c) | ftpcfunc.cxx (72cd26dd) |
---|---|
1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 19 unchanged lines hidden (view full) --- 28 TODO 29 ************************************************************************** 30 31 *************************************************************************/ 32#include <string.h> 33 34#include "ftpcontentidentifier.hxx" 35#include "ftpinpstr.hxx" | 1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 19 unchanged lines hidden (view full) --- 28 TODO 29 ************************************************************************** 30 31 *************************************************************************/ 32#include <string.h> 33 34#include "ftpcontentidentifier.hxx" 35#include "ftpinpstr.hxx" |
36#include <stdio.h> | 36#include <osl/file.h> |
37 38using namespace ftp; 39using namespace com::sun::star::uno; 40 41extern "C" { | 37 38using namespace ftp; 39using namespace com::sun::star::uno; 40 41extern "C" { |
42 | 42 |
43 int file_write(void *buffer,size_t size,size_t nmemb,void *stream) 44 { | 43 int file_write(void *buffer,size_t size,size_t nmemb,void *stream) 44 { |
45 FILE* file = 46 reinterpret_cast<FILE*>(stream); 47 if(!file) | 45 oslFileHandle aFile = reinterpret_cast< oslFileHandle >( stream ); 46 if( !aFile ) |
48 return 0; | 47 return 0; |
49 return fwrite(buffer,size,nmemb,file); | 48 49 sal_uInt64 nWritten = 0; 50 sal_uInt64 nToWrite( size * nmemb ); 51 osl_writeFile( aFile, buffer, nToWrite, &nWritten ); 52 53 return nWritten != nToWrite ? 0 : nmemb; |
50 } 51 52} | 54 } 55 56} |