2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 1995 Matthias Ettrich
8 * Copyright 1995-2001 The LyX Team.
10 * ====================================================== */
17 // Where can I put this? I found the occurence of the same code
18 // three/four times. Don't you think it better to use a macro definition
19 // (an inlined member of some class)?
21 // Use a namespace if we can, a struct otherwise
25 string const getcwd();
27 int chdir(string const & name);
28 /// Returns false if it fails
29 bool rename(string const & from, string const & to);
30 /// Returns false it it fails
31 bool copy(string const & from, string const & to);
32 /// generates a checksum
33 unsigned long sum(string const & file);
34 /// returns a date string (not used currently)
36 /// returns the name of the user (not used currently)
37 string const getUserName();
39 int kill(int pid, int sig);
43 int mkdir(string const & pathname, unsigned long int mode);
45 int putenv(char const * str);
47 int unlink(string const & file);
49 int rmdir(string const & file);
51 int atoi(string const & nstr);
53 string const tempName(string const & dir = string(),
54 string const & mask = string());
57 /** Returns true if var is approximately equal to number with allowed error
60 * Reason: A float can be very close to the number, yet still need not be
61 * exactly equal, you can have exp(-10) which is very close to zero but not
62 * zero. If you only need an approximate equality (you usually do), use this
65 * Usage: if (float_equal(var, number, 0.0001)) { }
67 * This will check if 'var' is approx. equal to 'number' with error of 1/1000
69 inline bool float_equal(float var, float number, float error)
71 return (number - error <= var && var <= number + error);
75 #endif /* LYX_LIB_H */