2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright (C) 1995 Matthias Ettrich
8 * Copyright (C) 1995-1999 The LyX Team.
10 * ====================================================== */
20 #include "support/filetools.h"
22 /// generates an checksum
23 unsigned long lyxsum(char const * file);
25 /// returns a date string
29 if ((tid= time(0)) == (time_t)-1)
36 // Where can I put this? I found the occurence of the same code
37 // three/four times. Don't you think it better to use a macro definition
38 // (an inlined member of some class)?
40 inline string getUserName()
42 string userName(GetEnv("LOGNAME"));
44 userName = GetEnv("USER");
46 userName = _("unknown");
50 // This should have been a namespace
52 static char * getcwd(char * buffer, size_t size) {
54 return ::getcwd(buffer, size);
56 return ::_getcwd2(buffer, size);
59 static int chdir(char const * name) {
63 return ::_chdir2(name);