aboutsummaryrefslogtreecommitdiffstats
path: root/src/filemode.c
diff options
context:
space:
mode:
authorDan Nicolaescu2010-07-04 00:50:25 -0700
committerDan Nicolaescu2010-07-04 00:50:25 -0700
commit971de7fb158335fbda39525feb2d7776a26bc030 (patch)
tree605333d85f16e35bb06baffcb66ac49f4ec0dce9 /src/filemode.c
parentb8463cbfbe2c5183cf40772df2746e58b787ddeb (diff)
downloademacs-971de7fb158335fbda39525feb2d7776a26bc030.tar.gz
emacs-971de7fb158335fbda39525feb2d7776a26bc030.zip
Convert (most) functions in src to standard C.
* src/alloc.c: Convert function definitions to standard C. * src/atimer.c: * src/bidi.c: * src/bytecode.c: * src/callint.c: * src/callproc.c: * src/casefiddle.c: * src/casetab.c: * src/category.c: * src/ccl.c: * src/character.c: * src/charset.c: * src/chartab.c: * src/cmds.c: * src/coding.c: * src/composite.c: * src/data.c: * src/dbusbind.c: * src/dired.c: * src/dispnew.c: * src/doc.c: * src/doprnt.c: * src/ecrt0.c: * src/editfns.c: * src/fileio.c: * src/filelock.c: * src/filemode.c: * src/fns.c: * src/font.c: * src/fontset.c: * src/frame.c: * src/fringe.c: * src/ftfont.c: * src/ftxfont.c: * src/gtkutil.c: * src/indent.c: * src/insdel.c: * src/intervals.c: * src/keymap.c: * src/lread.c: * src/macros.c: * src/marker.c: * src/md5.c: * src/menu.c: * src/minibuf.c: * src/prefix-args.c: * src/print.c: * src/ralloc.c: * src/regex.c: * src/region-cache.c: * src/scroll.c: * src/search.c: * src/sound.c: * src/strftime.c: * src/syntax.c: * src/sysdep.c: * src/termcap.c: * src/terminal.c: * src/terminfo.c: * src/textprop.c: * src/tparam.c: * src/undo.c: * src/unexelf.c: * src/window.c: * src/xfaces.c: * src/xfns.c: * src/xfont.c: * src/xftfont.c: * src/xgselect.c: * src/xmenu.c: * src/xrdb.c: * src/xselect.c: * src/xsettings.c: * src/xsmfns.c: * src/xterm.c: Likewise.
Diffstat (limited to 'src/filemode.c')
-rw-r--r--src/filemode.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/src/filemode.c b/src/filemode.c
index 4a11d2a3115..c3a5a924a93 100644
--- a/src/filemode.c
+++ b/src/filemode.c
@@ -90,10 +90,10 @@
90#define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK) 90#define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
91#endif 91#endif
92 92
93void mode_string (); 93void mode_string (short unsigned int mode, char *str);
94static char ftypelet (); 94static char ftypelet (long int bits);
95static void rwx (); 95static void rwx (short unsigned int bits, char *chars);
96static void setst (); 96static void setst (short unsigned int bits, char *chars);
97 97
98/* filemodestring - fill in string STR with an ls-style ASCII 98/* filemodestring - fill in string STR with an ls-style ASCII
99 representation of the st_mode field of file stats block STATP. 99 representation of the st_mode field of file stats block STATP.
@@ -132,9 +132,7 @@ static void setst ();
132 'T' if the file is sticky but not executable. */ 132 'T' if the file is sticky but not executable. */
133 133
134void 134void
135filemodestring (statp, str) 135filemodestring (struct stat *statp, char *str)
136 struct stat *statp;
137 char *str;
138{ 136{
139 mode_string (statp->st_mode, str); 137 mode_string (statp->st_mode, str);
140} 138}
@@ -143,9 +141,7 @@ filemodestring (statp, str)
143 is given as an argument. */ 141 is given as an argument. */
144 142
145void 143void
146mode_string (mode, str) 144mode_string (short unsigned int mode, char *str)
147 unsigned short mode;
148 char *str;
149{ 145{
150 str[0] = ftypelet ((long) mode); 146 str[0] = ftypelet ((long) mode);
151 rwx ((mode & 0700) << 0, &str[1]); 147 rwx ((mode & 0700) << 0, &str[1]);
@@ -167,8 +163,7 @@ mode_string (mode, str)
167 '?' for any other file type. */ 163 '?' for any other file type. */
168 164
169static char 165static char
170ftypelet (bits) 166ftypelet (long int bits)
171 long bits;
172{ 167{
173#ifdef S_ISBLK 168#ifdef S_ISBLK
174 if (S_ISBLK (bits)) 169 if (S_ISBLK (bits))
@@ -207,9 +202,7 @@ ftypelet (bits)
207 flags in CHARS accordingly. */ 202 flags in CHARS accordingly. */
208 203
209static void 204static void
210rwx (bits, chars) 205rwx (short unsigned int bits, char *chars)
211 unsigned short bits;
212 char *chars;
213{ 206{
214 chars[0] = (bits & S_IRUSR) ? 'r' : '-'; 207 chars[0] = (bits & S_IRUSR) ? 'r' : '-';
215 chars[1] = (bits & S_IWUSR) ? 'w' : '-'; 208 chars[1] = (bits & S_IWUSR) ? 'w' : '-';
@@ -220,9 +213,7 @@ rwx (bits, chars)
220 according to the file mode BITS. */ 213 according to the file mode BITS. */
221 214
222static void 215static void
223setst (bits, chars) 216setst (short unsigned int bits, char *chars)
224 unsigned short bits;
225 char *chars;
226{ 217{
227#ifdef S_ISUID 218#ifdef S_ISUID
228 if (bits & S_ISUID) 219 if (bits & S_ISUID)