annotate src/sysdir.h @ 611:38db05db9cb5

[xemacs-hg @ 2001-06-08 12:21:09 by ben] ------ gc-in-window-procedure fixes ------ alloc.c: Create "post-gc actions", to avoid those dreaded "GC during window procedure" problems. event-msw.c: Abort, clean and simple, when GC in window procedure. We want to flush these puppies out. glyphs-msw.c: Use a post-gc action when destroying subwindows. lisp.h: Declare register_post_gc_action(). scrollbar-msw.c: Use a post-gc action when unshowing scrollbar windows, if in gc. redisplay.c: Add comment about the utter evilness of what's going down here. ------ cygwin setitimer fixes ------ Makefile.in.in: Compile profile.c only when HAVE_SETITIMER. nt.c: Style fixes. nt.c: Move setitimer() emulation to win32.c, because Cygwin needs it too. profile.c: Make sure we don't compile if no setitimer(). Use qxe_setitimer() instead of just plain setitimer(). signal.c: Define qxe_setitimer() as an encapsulation around setitimer() -- call setitimer() directly unless Cygwin or MS Win, in which case we use our simulated version in win32.c. systime.h: Prototype mswindows_setitimer() and qxe_setitimer(). Long comment about "qxe" and the policy regarding encapsulation. win32.c: Move setitimer() emulation here, so Cygwin can use it. Rename a couple of functions and variables to be longer and more descriptive. In setitimer_helper_proc(), send the signal using either mswindows_raise() or (on Cygwin) kill(). If for some reason we are still getting lockups, we'll change the kill() to directly invoke the signal handlers. ------ windows shell fixes ------ callproc.c, ntproc.c: Comments about how these two files must die. callproc.c: On MS Windows, init shell-file-name from SHELL, then COMSPEC, not just COMSPEC. (more correct and closer to FSF.) Don't force a value for SHELL into the environment. (Comments added to explain why not.) nt.c: Don't shove a fabricated SHELL into the environment. See above. ------ misc fixes ------ glyphs-shared.c: Style correction. xemacs-faq.texi: Merge in the rest of Hrvoje's Windows FAQ. Redo section 7 to update current reality and add condensed versions of new changes for 21.1 and 21.4. (Not quite done for 21.4.) Lots more Windows updates. process.el: Need to quote a null argument, too. From Dan Holmsand. startup.el: startup.el: Call MS Windows init function. win32-native.el: Correct comments at top. Correctly handle passing arguments to Cygwin programs and to bash. Fix quoting of zero-length arguments (from Dan Holmsand). Set shell-command-switch based on shell-file-name, which in turn comes from env var SHELL.
author ben
date Fri, 08 Jun 2001 12:21:27 +0000
parents abe6d1db359e
children b39c14581166
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1 /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2 Copyright (C) 1995 Free Software Foundation, Inc.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4 This file is part of XEmacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
6 XEmacs is free software; you can redistribute it and/or modify it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
7 under the terms of the GNU General Public License as published by the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
8 Free Software Foundation; either version 2, or (at your option) any
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
9 later version.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
10
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
14 for more details.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
15
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
17 along with XEmacs; see the file COPYING. If not, write to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
19 Boston, MA 02111-1307, USA. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
20
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
21 /* Synched up with: Not really in FSF. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
22
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 432
diff changeset
23 #ifndef INCLUDED_sysdir_h_
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 432
diff changeset
24 #define INCLUDED_sysdir_h_
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 432
diff changeset
25
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
26 #ifdef HAVE_UNISTD_H
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
27 #include <unistd.h>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
28 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
29
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
30 #ifdef SYSV_SYSTEM_DIR
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
31 # include <dirent.h>
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
32 #elif defined (WIN32_NATIVE)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
33 # include <direct.h>
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
34 # include "ndir.h"
432
3a7e78e1142d Import from CVS: tag r21-2-24
cvs
parents: 428
diff changeset
35 #elif defined (NONSYSTEM_DIR_LIBRARY)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
36 # include "ndir.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
37 #else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
38 # include <sys/dir.h>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
39 #endif /* not NONSYSTEM_DIR_LIBRARY */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
40
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
41 #ifdef SYSV_SYSTEM_DIR
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
42 # define DIRENTRY struct dirent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
43 #else /* not SYSV_SYSTEM_DIR */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
44 # define DIRENTRY struct direct
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
45 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
46
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
47 /* The d_nameln member of a struct dirent includes the '\0' character
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
48 on some systems, but not on others. What's worse, you can't tell
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
49 at compile-time which one it will be, since it really depends on
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
50 the sort of system providing the filesystem you're reading from,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
51 not the system you are running on. Paul Eggert
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
52 <eggert@bi.twinsun.com> says this occurs when Emacs is running on a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
53 SunOS 4.1.2 host, reading a directory that is remote-mounted from a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
54 Solaris 2.1 host and is in a native Solaris 2.1 filesystem.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
55
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
56 (and Solaris 2 doesn't have a d_nameln member at all! Posix.1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
57 doesn't specify it -- mrb)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
58
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
59 Since applying strlen to the name always works, we'll just do that. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
60 #define NAMLEN(p) strlen (p->d_name)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
61
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
62 #define DIRENTRY_NONEMPTY(p) ((p)->d_ino)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
63
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
64 /* encapsulation: directory calls */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
65
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
66 #ifdef ENCAPSULATE_CHDIR
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
67 int sys_chdir (const char *path);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
68 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
69 #if defined (ENCAPSULATE_CHDIR) && !defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
70 # undef chdir
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
71 # define chdir sys_chdir
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
72 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
73 #if !defined (ENCAPSULATE_CHDIR) && defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
74 # define sys_chdir chdir
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
75 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
76
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
77 #ifdef ENCAPSULATE_MKDIR
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
78 int sys_mkdir (const char *path, mode_t mode);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
79 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
80 #if defined (ENCAPSULATE_MKDIR) && !defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
81 # undef mkdir
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
82 # define mkdir sys_mkdir
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
83 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
84 #if !defined (ENCAPSULATE_MKDIR) && defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
85 # define sys_mkdir mkdir
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
86 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
87
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
88 #ifdef ENCAPSULATE_OPENDIR
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
89 DIR *sys_opendir (const char *filename);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
90 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
91 #if defined (ENCAPSULATE_OPENDIR) && !defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
92 # undef opendir
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
93 # define opendir sys_opendir
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
94 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
95 #if !defined (ENCAPSULATE_OPENDIR) && defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
96 # define sys_opendir opendir
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
97 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
98
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
99 #ifdef ENCAPSULATE_READDIR
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
100 DIRENTRY *sys_readdir (DIR *dirp);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
101 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
102 #if defined (ENCAPSULATE_READDIR) && !defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
103 # undef readdir
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
104 # define readdir sys_readdir
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
105 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
106 #if !defined (ENCAPSULATE_READDIR) && defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
107 # define sys_readdir readdir
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
108 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
109
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
110 #ifdef ENCAPSULATE_CLOSEDIR
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
111 int sys_closedir (DIR *dirp);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
112 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
113 #if defined (ENCAPSULATE_CLOSEDIR) && !defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
114 # undef closedir
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
115 # define closedir sys_closedir
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
116 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
117 #if !defined (ENCAPSULATE_CLOSEDIR) && defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
118 # define sys_closedir closedir
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
119 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
120
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
121 #ifdef ENCAPSULATE_RMDIR
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
122 int sys_rmdir (const char *path);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
123 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
124 #if defined (ENCAPSULATE_RMDIR) && !defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
125 # undef rmdir
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
126 # define rmdir sys_rmdir
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
127 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
128 #if !defined (ENCAPSULATE_RMDIR) && defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
129 # define sys_rmdir rmdir
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
130 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
131
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 432
diff changeset
132 #endif /* INCLUDED_sysdir_h_ */