1999-10-02 16:21:10 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/* This file is part of
|
1999-11-15 10:54:16 +00:00
|
|
|
* ======================================================
|
1999-10-02 16:21:10 +00:00
|
|
|
*
|
|
|
|
* LyX, The Document Processor
|
|
|
|
*
|
2000-03-09 03:36:48 +00:00
|
|
|
* Copyright 1995 Matthias Ettrich
|
|
|
|
* Copyright 1995-2000 The LyX Team.
|
1999-10-02 16:21:10 +00:00
|
|
|
*
|
1999-11-15 10:54:16 +00:00
|
|
|
* ====================================================== */
|
1999-10-02 16:21:10 +00:00
|
|
|
|
|
|
|
#ifndef LYX_LIB_H
|
|
|
|
#define LYX_LIB_H
|
|
|
|
|
|
|
|
#include "LString.h"
|
|
|
|
|
|
|
|
// Where can I put this? I found the occurence of the same code
|
|
|
|
// three/four times. Don't you think it better to use a macro definition
|
|
|
|
// (an inlined member of some class)?
|
1999-11-01 04:22:28 +00:00
|
|
|
|
2000-10-20 13:13:38 +00:00
|
|
|
// Use a namespace if we can, a struct otherwise
|
2000-01-17 22:42:04 +00:00
|
|
|
#ifdef CXX_WORKING_NAMESPACES
|
2000-10-20 13:13:38 +00:00
|
|
|
#define OPT_STATIC
|
2000-01-17 22:42:04 +00:00
|
|
|
namespace lyx {
|
2000-10-20 13:13:38 +00:00
|
|
|
#else
|
|
|
|
#define OPT_STATIC static
|
|
|
|
struct lyx {
|
|
|
|
#endif
|
2000-01-17 22:42:04 +00:00
|
|
|
///
|
2000-11-08 09:39:46 +00:00
|
|
|
OPT_STATIC string const getcwd();
|
2000-09-26 13:54:57 +00:00
|
|
|
///
|
2000-10-20 13:13:38 +00:00
|
|
|
OPT_STATIC int chdir(string const & name);
|
2000-09-26 13:54:57 +00:00
|
|
|
/// Returns false if it fails
|
2000-10-20 13:13:38 +00:00
|
|
|
OPT_STATIC bool rename(string const & from, string const & to);
|
2000-09-05 13:16:19 +00:00
|
|
|
/// Returns false it it fails
|
2000-10-20 13:13:38 +00:00
|
|
|
OPT_STATIC bool copy(string const & from, string const & to);
|
2000-01-19 14:07:39 +00:00
|
|
|
/// generates a checksum
|
2000-10-20 13:13:38 +00:00
|
|
|
OPT_STATIC unsigned long sum(string const & file);
|
2000-01-19 14:07:39 +00:00
|
|
|
/// returns a date string (not used currently)
|
2000-10-20 13:13:38 +00:00
|
|
|
OPT_STATIC char * date();
|
2000-01-19 14:07:39 +00:00
|
|
|
/// returns the name of the user (not used currently)
|
2000-10-20 13:13:38 +00:00
|
|
|
OPT_STATIC string const getUserName();
|
2000-01-17 22:42:04 +00:00
|
|
|
///
|
2000-10-20 13:13:38 +00:00
|
|
|
OPT_STATIC int kill(int pid, int sig);
|
2000-01-17 22:42:04 +00:00
|
|
|
///
|
2000-10-20 13:13:38 +00:00
|
|
|
OPT_STATIC void abort();
|
2000-09-26 13:54:57 +00:00
|
|
|
///
|
2000-10-20 13:13:38 +00:00
|
|
|
OPT_STATIC int mkdir(string const & pathname, unsigned long int mode);
|
2000-01-20 01:41:55 +00:00
|
|
|
///
|
2000-10-20 13:13:38 +00:00
|
|
|
OPT_STATIC int putenv(char const * str);
|
2000-09-26 13:54:57 +00:00
|
|
|
///
|
2000-10-20 13:13:38 +00:00
|
|
|
OPT_STATIC int unlink(string const & file);
|
2000-09-26 13:54:57 +00:00
|
|
|
///
|
2000-10-20 13:13:38 +00:00
|
|
|
OPT_STATIC int rmdir(string const & file);
|
2000-09-26 13:54:57 +00:00
|
|
|
///
|
2000-10-20 13:13:38 +00:00
|
|
|
OPT_STATIC int atoi(string const & nstr);
|
2000-11-08 09:39:46 +00:00
|
|
|
///
|
|
|
|
OPT_STATIC string const tempName(string const & dir = string(),
|
|
|
|
string const & mask = string());
|
2000-10-20 13:13:38 +00:00
|
|
|
#ifdef CXX_WORKING_NAMESPACES
|
2000-01-17 22:42:04 +00:00
|
|
|
}
|
|
|
|
#else
|
1999-11-01 04:22:28 +00:00
|
|
|
};
|
1999-10-02 16:21:10 +00:00
|
|
|
#endif
|
2000-10-20 13:13:38 +00:00
|
|
|
|
|
|
|
#undef OPT_STATIC
|
|
|
|
|
|
|
|
#endif /* LYX_LIB_H */
|