Permalink
Browse files

added nobk: option for serial links, switch the default to "on" for b…

…k: option.

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/wsim@711 c0ef0dea-404d-0410-ad65-84cceb5f200a
  • Loading branch information...
1 parent 0ce3948 commit 4d366c87351e13b9c43d67738daf143713a6d74c afraboul committed Nov 16, 2011
Showing with 15 additions and 7 deletions.
  1. +15 −7 libselect/libselect.c
View
22 libselect/libselect.c
@@ -53,15 +53,17 @@
* dimensions are fixed
****************************************/
-#define SELECT_SKIP_UPDATES 0
+#define SELECT_SKIP_UPDATES 0
+
#if SELECT_SKIP_UPDATES != 0
-#define LIBSELECT_UPDATE_SKIP 200
+#define LIBSELECT_UPDATE_SKIP 200
#endif
-#define DEFAULT_FIFO_SIZE 5120
-#define LIBSELECT_MAX_ENTRY 20
-#define BUFFER_MAX DEFAULT_FIFO_SIZE /* max 64ko == IP datagram max size */
+#define DEFAULT_FIFO_SIZE 5120
+#define LIBSELECT_MAX_ENTRY 20
+#define BUFFER_MAX DEFAULT_FIFO_SIZE /* max 64ko == IP datagram max size */
+#define BACKTRACK_DEFAULT_SETTING 1 /* on */
/****************************************
* libselect internal structure
*
@@ -494,13 +496,19 @@ libselect_id_t libselect_id_create(char *argname, int UNUSED flags)
if (strstr(cmdline,"bk:") == cmdline)
{
cmdline += 3;
- DMSG("wsim:libselect: open file %s with backtrack buffer on input/output\n",cmdline);
+ DMSG("wsim:libselect: open file %s *with* backtrack buffer on input/output\n",cmdline);
libselect.entry[id].backtrack = 1;
}
- else
+ else if (strstr(cmdline,"nobk:") == cmdline)
{
+ cmdline += 5;
+ DMSG("wsim:libselect: open file %s *without* backtrack buffer on input/output\n",cmdline);
libselect.entry[id].backtrack = 0;
}
+ else
+ {
+ libselect.entry[id].backtrack = BACKTRACK_DEFAULT_SETTING;
+ }
libselect.entry[id].fd_in = -1;
libselect.entry[id].fd_out = -1;

0 comments on commit 4d366c8

Please sign in to comment.