[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r11603 - in gnunet/src: include util
From: |
gnunet |
Subject: |
[GNUnet-SVN] r11603 - in gnunet/src: include util |
Date: |
Thu, 3 Jun 2010 22:47:53 +0200 |
Author: grothoff
Date: 2010-06-03 22:47:53 +0200 (Thu, 03 Jun 2010)
New Revision: 11603
Modified:
gnunet/src/include/gnunet_network_lib.h
gnunet/src/util/network.c
Log:
add native setting capability
Modified: gnunet/src/include/gnunet_network_lib.h
===================================================================
--- gnunet/src/include/gnunet_network_lib.h 2010-06-03 05:31:08 UTC (rev
11602)
+++ gnunet/src/include/gnunet_network_lib.h 2010-06-03 20:47:53 UTC (rev
11603)
@@ -285,10 +285,14 @@
void GNUNET_NETWORK_fdset_copy (struct GNUNET_NETWORK_FDSet *to,
const struct GNUNET_NETWORK_FDSet *from);
-/*
+/**
* Return file descriptor for this network handle
+ *
+ * @param desc wrapper to process
+ * @return POSIX file descriptor
*/
int GNUNET_NETWORK_get_fd (struct GNUNET_NETWORK_Handle *desc);
+
/**
* Copy a native fd set
* @param to destination
@@ -298,7 +302,17 @@
void GNUNET_NETWORK_fdset_copy_native (struct GNUNET_NETWORK_FDSet *to,
const fd_set * from, int nfds);
+
/**
+ * Set a native fd in a set
+ *
+ * @param to destination
+ * @param nfd native FD to set
+ */
+void GNUNET_NETWORK_fdset_set_native (struct GNUNET_NETWORK_FDSet *to,
+ int nfd);
+
+/**
* Add a file handle to the fd set
* @param fds fd set
* @param h the file handle to add
Modified: gnunet/src/util/network.c
===================================================================
--- gnunet/src/util/network.c 2010-06-03 05:31:08 UTC (rev 11602)
+++ gnunet/src/util/network.c 2010-06-03 20:47:53 UTC (rev 11603)
@@ -723,7 +723,22 @@
to->nsds = nfds;
}
+
/**
+ * Set a native fd in a set
+ *
+ * @param to destination
+ * @param nfd native FD to set
+ */
+void GNUNET_NETWORK_fdset_set_native (struct GNUNET_NETWORK_FDSet *to,
+ int nfd)
+{
+ FD_SET (nfd, &to->sds);
+ to->nsds = GNUNET_MAX (nfd + 1, to->nsds);
+}
+
+
+/**
* Add a file handle to the fd set
* @param fds fd set
* @param h the file handle to add
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r11603 - in gnunet/src: include util,
gnunet <=