]> git.lyx.org Git - features.git/blob - src/support/lyxlib.h
Finally text-insets should draw correctly (also selections), some small fixes.
[features.git] / src / support / lyxlib.h
1 // -*- C++ -*-
2 /* This file is part of
3  * ====================================================== 
4  * 
5  *           LyX, The Document Processor
6  *        
7  *           Copyright 1995 Matthias Ettrich
8  *           Copyright 1995-2000 The LyX Team.
9  *
10  * ====================================================== */
11
12 #ifndef LYX_LIB_H
13 #define LYX_LIB_H
14
15 #include "LString.h"
16 #include <sys/types.h>
17
18 // Where can I put this?  I found the occurence of the same code
19 // three/four times. Don't you think it better to use a macro definition
20 // (an inlined member of some class)?
21
22 // This should have been a namespace
23 #ifdef CXX_WORKING_NAMESPACES
24 ///
25 namespace lyx {
26         ///
27         char * getcwd(char * buffer, size_t size);
28         ///
29         int chdir(char const * name);
30         ///
31         int chdir(string const & name);
32         /// Returns false it it fails
33         bool rename(char const * from, char const * to);
34         /// Returns false if it fails
35         bool rename(string const & from, string const & to);
36         /// Returns false it it fails
37         bool copy(string const & from, string const & to);
38         /// generates a checksum
39         unsigned long sum(char const * file);
40         /// generates a checksum
41         unsigned long sum(string const & file);
42         /// returns a date string (not used currently)
43         char * date(); 
44         /// returns the name of the user (not used currently)
45         string const getUserName();
46         ///
47         int kill(int pid, int sig);
48         ///
49         void abort();
50         ///
51         int mkdir(string const & pathname, mode_t mode);
52         ///
53         int putenv(char const * str);
54         ///
55         int unlink(string const & file);
56         ///
57         int rmdir(string const & file);
58         ///
59         int atoi(string const & nstr);
60 }
61 #else
62 ///
63 struct lyx {
64         ///
65         static char * getcwd(char * buffer, size_t size);
66         ///
67         static int chdir(char const * name);
68         ///
69         static int chdir(string const & name);
70         /// Returns false it it fails
71         static bool rename(char const * from, char const * to);
72         /// Returns false if it fails
73         static bool rename(string const & from, string const & to);
74         /// Returns false it it fails
75         static bool copy(string const & from, string const & to);
76         /// generates a checksum
77         static unsigned long sum(char const * file);
78         /// generates a checksum
79         static unsigned long sum(string const & file);
80         /// returns a date string (not used currently)
81         static char * date(); 
82         /// returns the name of the user (not used currently)
83         static string const getUserName();
84         ///
85         static int kill(int pid, int sig);
86         ///
87         static void abort();
88         ///
89         static int mkdir(string const & pathname, unsigned long int mode);
90         ///
91         static int putenv(char const * str);
92         ///
93         static int unlink(string const & file);
94         ///
95         static int rmdir(string const & file);
96         ///
97         static int atoi(string const & nstr);
98 };
99 #endif // CXX_WORKING_NAMESPACES
100 #endif