# define BT_REGEXP_DUMP
/* save the debugging data to a file instead of displaying it */
# define BT_REGEXP_LOG
+# define BT_REGEXP_DEBUG_LOG
+# define BT_REGEXP_DEBUG_LOG_NAME "bt_regexp_debug.log"
#endif
/*
if (prog == NULL) /* error compiling regexp with initial engine */
{
-#ifdef DEBUG
+#ifdef BT_REGEXP_DEBUG_LOG
if (regexp_engine != BACKTRACKING_ENGINE) /* debugging log for NFA */
{
FILE *f;
- f = fopen("debug.log", "a");
+ f = fopen(BT_REGEXP_DEBUG_LOG_NAME, "a");
if (f)
{
if (!syntax_error)
fclose(f);
}
else
- EMSG("(NFA) Could not open \"debug.log\" to write !!!");
+ EMSG2("(NFA) Could not open \"%s\" to write !!!",
+ BT_REGEXP_DEBUG_LOG_NAME);
/*
if (syntax_error)
EMSG("NFA Regexp: Syntax Error !");
/* Comment this out to disable log files. They can get pretty big */
# define ENABLE_LOG
# define LOG_NAME "log_nfarun.log"
+# define NFA_REGEXP_DEBUG_LOG
+# define NFA_REGEXP_DEBUG_LOG_NAME "nfa_regexp_debug.log"
#endif
/* Upper limit allowed for {m,n} repetitions handled by NFA */
int *listids = NULL;
int j = 0;
int len = 0;
-#ifdef DEBUG
- FILE *debug = fopen("list.log", "a");
+#ifdef NFA_REGEXP_DEBUG_LOG
+ FILE *debug = fopen(NFA_REGEXP_DEBUG_LOG_NAME, "a");
if (debug == NULL)
{
- EMSG(_("(NFA) COULD NOT OPEN list.log !"));
+ EMSG2(_("(NFA) COULD NOT OPEN %s !"), NFA_REGEXP_DEBUG_LOG_NAME);
return FALSE;
}
#endif
fprintf(log_fd, "\n");
#endif
-#ifdef DEBUG
+#ifdef NFA_REGEXP_DEBUG_LOG
fprintf(debug, "\n-------------------\n");
#endif
else
t = &thislist->t[i];
-#ifdef DEBUG
+#ifdef NFA_REGEXP_DEBUG_LOG
nfa_set_code(t->state->c);
fprintf(debug, "%s, ", code);
#endif
if (listids != NULL)
vim_free(listids);
#undef ADD_POS_NEG_STATE
-#ifdef DEBUG
+#ifdef NFA_REGEXP_DEBUG_LOG
fclose(debug);
#endif