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
|
|
|
|
|
|
|
// This should have been a namespace
|
2000-01-17 22:42:04 +00:00
|
|
|
#ifdef CXX_WORKING_NAMESPACES
|
2000-08-07 20:58:24 +00:00
|
|
|
///
|
2000-01-17 22:42:04 +00:00
|
|
|
namespace lyx {
|
|
|
|
///
|
|
|
|
char * getcwd(char * buffer, size_t size);
|
|
|
|
///
|
|
|
|
int chdir(char const * name);
|
2000-09-26 13:54:57 +00:00
|
|
|
///
|
|
|
|
int chdir(string const & name);
|
2000-09-05 13:16:19 +00:00
|
|
|
/// Returns false it it fails
|
|
|
|
bool rename(char const * from, char const * to);
|
2000-09-26 13:54:57 +00:00
|
|
|
/// Returns false if it fails
|
|
|
|
bool rename(string const & from, string const & to);
|
2000-09-05 13:16:19 +00:00
|
|
|
/// Returns false it it fails
|
2000-09-14 17:53:12 +00:00
|
|
|
bool copy(string const & from, string const & to);
|
2000-01-19 14:07:39 +00:00
|
|
|
/// generates a checksum
|
2000-01-17 22:42:04 +00:00
|
|
|
unsigned long sum(char const * file);
|
2000-09-26 13:54:57 +00:00
|
|
|
/// generates a checksum
|
|
|
|
unsigned long sum(string const & file);
|
2000-01-19 14:07:39 +00:00
|
|
|
/// returns a date string (not used currently)
|
2000-01-17 22:42:04 +00:00
|
|
|
char * date();
|
2000-01-19 14:07:39 +00:00
|
|
|
/// returns the name of the user (not used currently)
|
2000-09-14 17:53:12 +00:00
|
|
|
string const getUserName();
|
2000-01-17 22:42:04 +00:00
|
|
|
///
|
2000-09-29 18:44:07 +00:00
|
|
|
int kill(int pid, int sig);
|
2000-01-17 22:42:04 +00:00
|
|
|
///
|
|
|
|
void abort();
|
2000-09-26 13:54:57 +00:00
|
|
|
///
|
2000-10-19 10:04:36 +00:00
|
|
|
int mkdir(string const & pathname, unsigned long int mode);
|
2000-01-20 01:41:55 +00:00
|
|
|
///
|
|
|
|
int putenv(char const * str);
|
2000-09-26 13:54:57 +00:00
|
|
|
///
|
|
|
|
int unlink(string const & file);
|
|
|
|
///
|
|
|
|
int rmdir(string const & file);
|
|
|
|
///
|
|
|
|
int atoi(string const & nstr);
|
2000-01-17 22:42:04 +00:00
|
|
|
}
|
|
|
|
#else
|
2000-08-07 20:58:24 +00:00
|
|
|
///
|
1999-11-01 04:22:28 +00:00
|
|
|
struct lyx {
|
2000-01-17 21:01:30 +00:00
|
|
|
///
|
|
|
|
static char * getcwd(char * buffer, size_t size);
|
|
|
|
///
|
|
|
|
static int chdir(char const * name);
|
2000-09-26 13:54:57 +00:00
|
|
|
///
|
|
|
|
static int chdir(string const & name);
|
2000-09-05 13:16:19 +00:00
|
|
|
/// Returns false it it fails
|
|
|
|
static bool rename(char const * from, char const * to);
|
2000-09-26 13:54:57 +00:00
|
|
|
/// Returns false if it fails
|
|
|
|
static bool rename(string const & from, string const & to);
|
2000-09-05 13:16:19 +00:00
|
|
|
/// Returns false it it fails
|
2000-09-14 17:53:12 +00:00
|
|
|
static bool copy(string const & from, string const & to);
|
2000-01-19 14:07:39 +00:00
|
|
|
/// generates a checksum
|
2000-01-17 21:01:30 +00:00
|
|
|
static unsigned long sum(char const * file);
|
2000-09-26 13:54:57 +00:00
|
|
|
/// generates a checksum
|
|
|
|
static unsigned long sum(string const & file);
|
2000-01-19 14:07:39 +00:00
|
|
|
/// returns a date string (not used currently)
|
2000-01-17 21:01:30 +00:00
|
|
|
static char * date();
|
2000-01-19 14:07:39 +00:00
|
|
|
/// returns the name of the user (not used currently)
|
2000-09-14 17:53:12 +00:00
|
|
|
static string const getUserName();
|
2000-01-17 21:01:30 +00:00
|
|
|
///
|
2000-09-29 18:44:07 +00:00
|
|
|
static int kill(int pid, int sig);
|
2000-01-17 21:01:30 +00:00
|
|
|
///
|
|
|
|
static void abort();
|
2000-01-20 01:41:55 +00:00
|
|
|
///
|
2000-09-26 13:54:57 +00:00
|
|
|
static int mkdir(string const & pathname, unsigned long int mode);
|
2000-01-20 01:41:55 +00:00
|
|
|
///
|
|
|
|
static int putenv(char const * str);
|
2000-09-26 13:54:57 +00:00
|
|
|
///
|
2000-09-26 16:16:55 +00:00
|
|
|
static int unlink(string const & file);
|
2000-09-26 13:54:57 +00:00
|
|
|
///
|
2000-09-26 16:16:55 +00:00
|
|
|
static int rmdir(string const & file);
|
2000-09-26 13:54:57 +00:00
|
|
|
///
|
2000-09-26 16:16:55 +00:00
|
|
|
static int atoi(string const & nstr);
|
1999-11-01 04:22:28 +00:00
|
|
|
};
|
2000-01-17 22:42:04 +00:00
|
|
|
#endif // CXX_WORKING_NAMESPACES
|
1999-10-02 16:21:10 +00:00
|
|
|
#endif
|