/*
* CINELERRA
* Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
- *
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
+ *
*/
// Disable 64 bit indirections so we can override both functions.
#define DEBUG 0
-// These are hacks to get all the file I/O libraries to transparently
+// These are hacks to get all the file I/O libraries to transparently
// go over the network without rewriting them.
// static int (*func)(__const char *__file, int __oflag) = 0;
// int result = -1;
// printf("open %s\n", path);
-//
+//
// if (!func)
// func = (int(*)(const char *path, int flags))dlsym(RTLD_NEXT, "open");
-//
+//
// result = (*func)(path, flags);
// return result;
// }
// if(!func)
// func = (int(*)(FILE *))dlsym(RTLD_NEXT, "fflush");
// //printf("fflush\n");
-//
+//
// renderfarm_fs_global->lock();
// if(renderfarm_fs_global->is_open(file))
// {
// done = 1;
// }
// renderfarm_fs_global->unlock();
-//
+//
// if(!done) result = (*func)(file);
// return result;
// }
client->lock("RenderFarmFSClient::fopen");
- if(!client->send_request_header(RENDERFARM_FOPEN,
+ if(!client->send_request_header(RENDERFARM_FOPEN,
len))
{
if(client->write_socket(buffer, len, RENDERFARM_TIMEOUT) == len)
int len = strlen(__filename) + 1;
char *datagram = new char[len];
strcpy(datagram, __filename);
-
+
client->lock("RenderFarmFSClient::remove");
if(!client->send_request_header(RENDERFARM_REMOVE, len))
{
char *datagram = new char[len];
strcpy(datagram, __old);
strcpy(datagram + strlen(__old) + 1, __new);
-
+
client->lock("RenderFarmFSClient::rename");
if(!client->send_request_header(RENDERFARM_RENAME, len))
{
int i = 0;
int64_t file_int64 = get_64(__stream);
STORE_INT64(file_int64);
-
+
client->lock("RenderFarmFSClient::fgetc");
if(!client->send_request_header(RENDERFARM_FGETC, 8))
{
int64_t file_int64 = get_64(__stream);
STORE_INT64(file_int64);
datagram[i++] = __c;
-
+
client->lock("RenderFarmFSClient::fputc");
if(!client->send_request_header(RENDERFARM_FPUTC, 9))
{
int64_t file_int64 = get_64(__stream);
STORE_INT64(file_int64);
STORE_INT32(__n);
-
+
client->lock("RenderFarmFSClient::fgets");
if(!client->send_request_header(RENDERFARM_FGETS, 12))
{
result = 0;
client->unlock();
if(DEBUG)
-printf("RenderFarmFSClient::fgets file=%p string=%p size=%d bytes=%p\n",
+printf("RenderFarmFSClient::fgets file=%p string=%p size=%d bytes=%p\n",
__stream, __s, bytes, bytes);
return result;
STORE_INT64(file_int64);
STORE_INT32(__size);
STORE_INT32(__n);
-
+
client->lock("RenderFarmFSClient::fread");
if(!client->send_request_header(RENDERFARM_FREAD, 16))
{
{
// fread data
result = READ_INT32(datagram);
- if(client->read_socket((char*)__ptr, __size * result, RENDERFARM_TIMEOUT) !=
+ if(client->read_socket((char*)__ptr, __size * result, RENDERFARM_TIMEOUT) !=
__size * result)
result = 0;
}
result = 0;
client->unlock();
if(DEBUG)
-printf("RenderFarmFSClient::fread file=%p size=%d num=%d result=%d\n",
+printf("RenderFarmFSClient::fread file=%p size=%d num=%d result=%d\n",
__stream, __size, __n, result);
return result;
STORE_INT64(file_int64);
STORE_INT32(__size);
STORE_INT32(__n);
-
+
client->lock("RenderFarmFSClient::fwrite");
if(!client->send_request_header(RENDERFARM_FWRITE, 16))
{
else
{
// fwrite data
- if(client->write_socket((char*)__ptr, __size * __n, RENDERFARM_TIMEOUT) !=
+ if(client->write_socket((char*)__ptr, __size * __n, RENDERFARM_TIMEOUT) !=
__size * __n)
result = 0;
else
result = 0;
client->unlock();
if(DEBUG)
-printf("RenderFarmFSClient::fwrite file=%p size=%d num=%d result=%d\n",
+printf("RenderFarmFSClient::fwrite file=%p size=%d num=%d result=%d\n",
__s, __size, __n, result);
return result;
result = -1;
client->unlock();
if(DEBUG)
-printf("RenderFarmFSClient::fseek stream=%p offset=%jd whence=%d result=%d\n",
+printf("RenderFarmFSClient::fseek stream=%p offset=%jd whence=%d result=%d\n",
__stream, __off, __whence, result);
return result;
}
result = -1;
client->unlock();
if(DEBUG)
-printf("RenderFarmFSClient::fseek stream=%p result=%jd\n",
+printf("RenderFarmFSClient::fseek stream=%p result=%jd\n",
__stream, result);
return result;
}