/* This file is part of
-* ======================================================
-*
-* LyX, The Document Processor
-*
-* Copyright (C) 1995 Matthias Ettrich
-* Copyright (C) 1995-1998 The LyX Team.
-*
-*======================================================*/
+ * ======================================================
+ *
+ * LyX, The Document Processor
+ *
+ * Copyright 1995 Matthias Ettrich
+ * Copyright 1995-1999 The LyX Team.
+ *
+ * ======================================================*/
#include <config.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <string.h>
+#include <cstdlib>
+#include <cstdio>
+#include <cctype>
+#include <cstring>
#ifdef __GNUG__
#pragma implementation
#endif
#include "LyXAction.h"
-#include "error.h"
+#include "debug.h"
#include "gettext.h"
+#include "support/lstrings.h"
/*
NAMING RULES FOR USER-COMMANDS
for (int i=0; i<psd_idx; i++) {
if (action==tb->action && !strcmp(tb->name, arg)) {
- lyxerr.debug(LString("Pseudoaction already exist[")
- + int(action) + '|'
- + PTR_AS_INT(arg) + ']',
- Error::KEY);
+ lyxerr[Debug::KEY] << "Pseudoaction already exist["
+ << action << '|'
+ << arg << ']' << endl;
return LFUN_LASTACTION+i;
}
if (psdaction >= 0) return psdaction;
if (psd_idx>=MAX_PSEUDO_ACTION) {
- lyxerr.print("Lyx Error: No more pseudo-actions allowed");
- lyxerr.print(" Tell the developers.");
+ lyxerr << "Lyx Error: No more pseudo-actions allowed"
+ << " Tell the developers." << endl;
return -1;
}
lyx_func_args[psd_idx].name = strdup(arg);
*arg = lyx_func_args[i].name;
return (int)lyx_func_args[i].action;
} else {
- lyxerr.print("Lyx Error: Unrecognized pseudo-action");
+ lyxerr << "Lyx Error: Unrecognized pseudo-action" << endl;
return -1;
}
}
}
if (arg && action >= 0) {
action = getPseudoAction((kb_action)action, arg);
- lyxerr.debug(LString("Pseudo action_arg[")
- + int(action) + '|'
- + PTR_AS_INT(arg) + ']',Error::KEY);
+ lyxerr[Debug::KEY] << "Pseudo action_arg["
+ << action << '|'
+ << arg << ']' << endl;
}
return action;
}
if (helpTexts[action].action == action) {
return helpTexts[action].name;
}
- // + LString(' ') + int(is_ro) + LString(']'));
+ // + string(' ') + int(is_ro) + string(']'));
no_desc:
// In an ideal world, this never happens:
return _("No description available!");
// Function to compare items from the attrib table.
-int actioncomp(const void *a, const void *b)
+extern "C" int actioncomp(const void *a, const void *b)
{
int const *ia=(int const*)a, *ib=(int const*)b;
return (*ia)-(*ib);
} else
if (k<0) l = m+1; else r = m;
}
- lyxerr.debug(LString("RO[") + int(action)
- + LString(" ") + int(is_ro) + LString("]"));
+ lyxerr.debug() << "RO[" << action
+ << " " << is_ro << "]" << endl;
return is_ro;
}
+ostream & operator<<(ostream & o, kb_action action)
+{
+ return o << int(action);
+}