question about win32 related patched
Ralf Habacker
ralf.habacker at freenet.de
Wed Oct 19 10:35:39 BST 2005
Am Dienstag, 18. Oktober 2005 20:10 schrieb Thiago Macieira:
> Ralf Habacker wrote:
> >This let me think if in future KDE should have an os extension
> >library (as the win dir for win32 now), which contains all the missing
> >functions and fixes the os related flawing, so that all kde libs can
> > work with a unique set of lowlevel functions.
>
> I don't agree. This is one of the purposes for libkdecore anyways: we
> shouldn't standardise the C-level API and build C++ upon it. We should
> standardise on C++ already.
>
> As David said, DCOP is an abnormal case, because it sits below the
> lowermost KDE library (libkdecore).
>
> >The win dir is currently designed as a set of source files and compiler
> >specific system header in include/<compiler>/... (for example mingw
> > missed some network header), which structure may be used for additional
> > platforms and or compiler.
>
> This sounds like glibc's sysdeps subdirs.
if this means that glibc's sysdeps subdir contains missing functions for
operating systems, yes
> But I didn't understand: why do we carry mingw's headers inside KDE? Are
they missing in mingw itself?
not only the header also the functions. windows compilers does have only a
subset of the posix api, the win dir provides this functions. Currently there
are about 60 functions. The problem is that KDE is currently very much unix
related and on windows things goes slighty other. In the short it seems not
be possible to wrap all platform depending low level functions with c++
classes, so adding this additional functions to KDE is the better way.
$ find -name '*.c' -exec grep -H "EXPORT" {} \;
./fcntl.c:KDEWIN32_EXPORT int fcntl (int fd, int cmd,...)
./fsync.c:KDEWIN32_EXPORT int fsync(int fd)
./getenv.c:KDEWIN32_EXPORT char * kde_getenv(const char *name)
./grp.c:KDEWIN32_EXPORT struct group *getgrnam (const char *name)
./grp.c:KDEWIN32_EXPORT struct group *getgrgid (gid_t gid)
./grp.c:KDEWIN32_EXPORT struct group *getgrent(void)
./grp.c:KDEWIN32_EXPORT void setgrent(void)
./grp.c:KDEWIN32_EXPORT void endgrent(void)
./kde_file_win.c:KDEWIN32_EXPORT int kdewin32_stat(const char *file_name,
struct stat *buf)
./kde_file_win.c:KDEWIN32_EXPORT int kdewin32_lstat(const char *file_name,
struct stat *buf)
./kde_file_win.c:/*KDEWIN32_EXPORT int kdewin32_open(const char *path, int
flags)
./kde_file_win.c:KDEWIN32_EXPORT int kdewin32_open(const char *path, int
flags, ... /*mode_t mode*/)
./kde_file_win.c:KDEWIN32_EXPORT FILE *kdewin32_fopen(const char *path, const
char *mode)
./kde_file_win.c:KDEWIN32_EXPORT FILE *kdewin32_fdopen(int fd, const char
*mode)
./kde_file_win.c:KDEWIN32_EXPORT FILE *kdewin32_freopen(const char *path,
const char *mode, FILE *stream)
./kde_file_win.c:KDEWIN32_EXPORT int kdewin32_rename(const char *src, const
char *dest)
./kde_file_win.c:KDEWIN32_EXPORT int kdewin32_mkdir(const char *path, mode_t
mode)
./mmap.c:KDEWIN32_EXPORT void * mmap(void *start, size_t length, int prot ,
int flags, int fd, off_t offset)
./mmap.c:KDEWIN32_EXPORT int munmap(void *start, size_t length)
./pwd.c:KDEWIN32_EXPORT struct passwd * getpwnam (const char *name)
./readdir.c:KDEWIN32_EXPORT DIR * opendir(const char *dir)
./readdir.c:KDEWIN32_EXPORT struct dirent * readdir(DIR *dp)
./readdir.c:KDEWIN32_EXPORT struct dirent* readdir_r(DIR *dirp, struct dirent
*entry, struct dirent **result)
./readdir.c:KDEWIN32_EXPORT int closedir(DIR *dp)
./realpath.c:KDEWIN32_EXPORT char *realpath(const char *path,char
*resolved_path)
./resource.c:KDEWIN32_EXPORT int getrlimit (int __resource, struct rlimit
*__rlp)
./resource.c:KDEWIN32_EXPORT int setrlimit (int __resource, const struct
rlimit *__rlp)
./resource.c:KDEWIN32_EXPORT int getrusage (int __who, struct rusage
*__rusage)
./signal.c:KDEWIN32_EXPORT int kill(pid_t pid, int sig)
./signal.c:KDEWIN32_EXPORT pid_t waitpid(pid_t p, int *a, int b)
./strndup.c:KDEWIN32_EXPORT char* strndup(const char *src, size_t n)
./syslog.c:KDEWIN32_EXPORT void closelog (void)
./syslog.c:KDEWIN32_EXPORT void openlog (const char *ident , int option , int
facility)
./syslog.c:KDEWIN32_EXPORT int setlogmask (int priority)
./syslog.c:KDEWIN32_EXPORT void syslog (int priority, const char *
format, ...)
./time.c:KDEWIN32_EXPORT int gettimeofday(struct timeval *__p, struct timezone
*__z)
./time.c:KDEWIN32_EXPORT int settimeofday(const struct timeval *__p, const
struct timezone *__z)
./uname.c:KDEWIN32_EXPORT int uname(struct utsname *name)
./unistd.c:KDEWIN32_EXPORT int getgroups(int size, gid_t list[])
./unistd.c:KDEWIN32_EXPORT int readlink(const char *__path, char *__buf, int
__buflen)
./unistd.c:KDEWIN32_EXPORT int symlink(const char *__name1, const char
*__name2)
./unistd.c:KDEWIN32_EXPORT int link(const char *__name1, const char *__name2)
./unistd.c:KDEWIN32_EXPORT int chown(const char *__path, uid_t __owner, gid_t
__group)
./unistd.c:KDEWIN32_EXPORT int fchown(int __fd, uid_t __owner, gid_t __group )
./unistd.c:KDEWIN32_EXPORT int lstat(const char *path, struct stat *sb)
./unistd.c:KDEWIN32_EXPORT int fchmod(int __fd, mode_t __mode)
./unistd.c:KDEWIN32_EXPORT uid_t getuid()
./unistd.c:KDEWIN32_EXPORT uid_t geteuid (void)
./unistd.c:KDEWIN32_EXPORT gid_t getgid (void)
./unistd.c:KDEWIN32_EXPORT gid_t getegid (void)
./unistd.c:KDEWIN32_EXPORT int pipe(int *fd)
./unistd.c:KDEWIN32_EXPORT pid_t fork(void)
./unistd.c:KDEWIN32_EXPORT pid_t setsid(void)
./unistd.c:KDEWIN32_EXPORT int kde_gethostname(char *__name, size_t __len)
./unistd.c:KDEWIN32_EXPORT char* getlogin()
./unistd.c:KDEWIN32_EXPORT void usleep(unsigned int usec)
./unistd.c:KDEWIN32_EXPORT void sleep(unsigned int sec)
./unistd.c:KDEWIN32_EXPORT long int random()
./unistd.c:KDEWIN32_EXPORT int setreuid(uid_t ruid, uid_t euid)
> And if they are missing, are the function implementation in the libraries
> (DLLs) present regardless of the mingw version?
Yes, they located in the win dir.
Ralf
More information about the kde-core-devel
mailing list