repositories
/
deb_libnfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[fix] - vs2010 project for libnfs
[deb_libnfs.git]
/
lib
/
libnfs-sync.c
diff --git
a/lib/libnfs-sync.c
b/lib/libnfs-sync.c
index e1f95ff0544dc17ee9ab62c421e61917f4111c50..c7698351148f502e735e581e08d0c696c990a358 100644
(file)
--- a/
lib/libnfs-sync.c
+++ b/
lib/libnfs-sync.c
@@
-17,23
+17,38
@@
/*
* High level api to nfs filesystems
*/
/*
* High level api to nfs filesystems
*/
+#ifdef WIN32
+#include "win32_compat.h"
+#define DllExport
+#else
+#include <strings.h>
+#include <unistd.h>
+#include <sys/statvfs.h>
+#include <poll.h>
+#include <sys/ioctl.h>
+#include <netdb.h>
+#include <sys/socket.h>
+#include <net/if.h>
+#endif
+#ifdef HAVE_CONFIG_H
#include "config.h"
#include "config.h"
+#endif
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <strings.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/stat.h>
-#include <sys/statvfs.h>
-#include <sys/ioctl.h>
-#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <fcntl.h>
#include <errno.h>
-#include <poll.h>
-#include <sys/socket.h>
-#include <net/if.h>
-#include <netdb.h>
+
+#ifdef HAVE_SYS_SOCKIO_H
+#include <sys/sockio.h>
+#endif
+
+#include <fcntl.h>
+#include <errno.h>
#include "libnfs.h"
#include "libnfs-raw.h"
#include "libnfs-raw-mount.h"
#include "libnfs.h"
#include "libnfs-raw.h"
#include "libnfs-raw-mount.h"
@@
-701,8
+716,11
@@
static void statvfs_cb(int status, struct nfs_context *nfs, void *data, void *pr
nfs_set_error(nfs, "statvfs call failed with \"%s\"", (char *)data);
return;
}
nfs_set_error(nfs, "statvfs call failed with \"%s\"", (char *)data);
return;
}
-
+#ifndef WIN32
memcpy(cb_data->return_data, data, sizeof(struct statvfs));
memcpy(cb_data->return_data, data, sizeof(struct statvfs));
+#else
+ cb_data->return_data=NULL;
+#endif/**/
}
int nfs_statvfs(struct nfs_context *nfs, const char *path, struct statvfs *svfs)
}
int nfs_statvfs(struct nfs_context *nfs, const char *path, struct statvfs *svfs)
@@
-1171,7
+1189,7
@@
void mount_free_export_list(struct exportnode *exports)
-
+#if !defined(WIN32)
void free_nfs_srvr_list(struct nfs_server_list *srv)
{
while (srv != NULL) {
void free_nfs_srvr_list(struct nfs_server_list *srv)
{
while (srv != NULL) {
@@
-1219,7
+1237,7
@@
void callit_cb(struct rpc_context *rpc, int status, void *data _U_, void *privat
/* check for dupes */
for (srvr = srv_data->srvrs; srvr; srvr = srvr->next) {
if (!strcmp(hostdd, srvr->addr)) {
/* check for dupes */
for (srvr = srv_data->srvrs; srvr; srvr = srvr->next) {
if (!strcmp(hostdd, srvr->addr)) {
- return
0
;
+ return;
}
}
}
}
@@
-1242,6
+1260,7
@@
void callit_cb(struct rpc_context *rpc, int status, void *data _U_, void *privat
srv_data->srvrs = srvr;
}
srv_data->srvrs = srvr;
}
+#ifndef WIN32
static int send_nfsd_probes(struct rpc_context *rpc, struct ifconf *ifc, struct nfs_list_data *data)
{
char *ptr;
static int send_nfsd_probes(struct rpc_context *rpc, struct ifconf *ifc, struct nfs_list_data *data)
{
char *ptr;
@@
-1293,11
+1312,13
@@
static int send_nfsd_probes(struct rpc_context *rpc, struct ifconf *ifc, struct
return 0;
}
return 0;
}
+#endif/*WIN32 TODO implement this with win32api FIXME*/
struct nfs_server_list *nfs_find_local_servers(void)
{
struct rpc_context *rpc;
struct nfs_list_data data = {0, NULL};
struct nfs_server_list *nfs_find_local_servers(void)
{
struct rpc_context *rpc;
struct nfs_list_data data = {0, NULL};
+#ifndef WIN32
struct timeval tv_start, tv_current;
struct ifconf ifc;
int size, loop;
struct timeval tv_start, tv_current;
struct ifconf ifc;
int size, loop;
@@
-1374,6
+1395,7
@@
struct nfs_server_list *nfs_find_local_servers(void)
free_nfs_srvr_list(data.srvrs);
return NULL;
}
free_nfs_srvr_list(data.srvrs);
return NULL;
}
-
+#endif/*WIN32 - FIXME redef it when send_nfsd_probes is implemented for win32*/
return data.srvrs;
}
return data.srvrs;
}
+#endif