-#else
-#define OPT_STATIC static
-struct lyx {
-#endif
- ///
- OPT_STATIC string const getcwd();
- ///
- OPT_STATIC int chdir(string const & name);
- /// Returns false if it fails
- OPT_STATIC bool rename(string const & from, string const & to);
- /// Returns false it it fails
- OPT_STATIC bool copy(string const & from, string const & to);
- /// generates a checksum
- OPT_STATIC unsigned long sum(string const & file);
- /// returns a date string (not used currently)
- OPT_STATIC char * date();
- /// returns the name of the user (not used currently)
- OPT_STATIC string const getUserName();
- ///
- OPT_STATIC int kill(int pid, int sig);
- ///
- OPT_STATIC void abort();
- ///
- OPT_STATIC int mkdir(string const & pathname, unsigned long int mode);
- ///
- OPT_STATIC int putenv(char const * str);
- ///
- OPT_STATIC int unlink(string const & file);
- ///
- OPT_STATIC int rmdir(string const & file);
- ///
- OPT_STATIC int atoi(string const & nstr);
- ///
- OPT_STATIC string const tempName(string const & dir = string(),
- string const & mask = string());
-#ifdef CXX_WORKING_NAMESPACES
+namespace support {
+
+/// FIXME: some point to this hmm ?
+int kill(int pid, int sig);
+
+/**
+ * Returns true if var is approximately equal to number with allowed error
+ * of 'error'.
+ *
+ * Usage: if (float_equal(var, number, 0.0001)) { }
+ *
+ * This will check if 'var' is approx. equal to 'number' with error of 1/1000
+ */
+inline bool float_equal(double var, double number, double error)
+{
+ return (number - error <= var && var <= number + error);