aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-03-10 18:14:24 +0100
committerThomas White <taw@physics.org>2010-03-10 18:14:24 +0100
commit23838cbb7fc78a020bf5939f652e94d326c6d57e (patch)
tree7ae7c31f8d3fccdfaa7e4af04edae78f86dee568
parent7afb2efc35a34075daba73b24c4d8cac0d1838a5 (diff)
Make DirAx verbosity optional
-rw-r--r--src/dirax.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/dirax.c b/src/dirax.c
index a9288f2f..a9694f46 100644
--- a/src/dirax.c
+++ b/src/dirax.c
@@ -39,6 +39,9 @@
#include "peaks.h"
+#define DIRAX_VERBOSE 0
+
+
typedef enum {
DIRAX_INPUT_NONE,
DIRAX_INPUT_LINE,
@@ -48,7 +51,9 @@ typedef enum {
static void dirax_parseline(const char *line, struct image *image)
{
- int i, rf;
+ int rf, i;
+
+ #if DIRAX_VERBOSE
char *copy;
copy = strdup(line);
@@ -56,8 +61,9 @@ static void dirax_parseline(const char *line, struct image *image)
if ( copy[i] == '\r' ) copy[i]='r';
if ( copy[i] == '\n' ) copy[i]='\0';
}
- //STATUS("DirAx: %s\n", copy);
+ STATUS("DirAx: %s\n", copy);
free(copy);
+ #endif
if ( strstr(line, "reflections from file") ) {
ERROR("DirAx can't understand this data.\n");
@@ -110,18 +116,20 @@ static void dirax_parseline(const char *line, struct image *image)
static void dirax_sendline(const char *line, struct image *image)
{
+ #if DIRAX_VERBOSE
char *copy;
int i;
- write(image->dirax_pty, line, strlen(line));
-
copy = strdup(line);
for ( i=0; i<strlen(copy); i++ ) {
if ( copy[i] == '\r' ) copy[i]='\0';
if ( copy[i] == '\n' ) copy[i]='\0';
}
- //STATUS("To DirAx: '%s'\n", copy);
+ STATUS("To DirAx: '%s'\n", copy);
free(copy);
+ #endif
+
+ write(image->dirax_pty, line, strlen(line));
}