Lines Matching refs:ms
75 handle_mime(struct magic_set *ms, int mime, const char *str) in handle_mime() argument
78 if (file_printf(ms, "inode/%s", str) == -1) in handle_mime()
80 if ((mime & MAGIC_MIME_ENCODING) && file_printf(ms, in handle_mime()
84 if ((mime & MAGIC_MIME_ENCODING) && file_printf(ms, "binary") == -1) in handle_mime()
90 file_fsmagic(struct magic_set *ms, const char *fn, zend_stat_t *sb) in file_fsmagic() argument
93 int mime = ms->flags & MAGIC_MIME; in file_fsmagic()
94 int silent = ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION); in file_fsmagic()
103 if (ms->flags & MAGIC_ERROR) { in file_fsmagic()
104 file_error(ms, errno, "cannot stat `%s'", fn); in file_fsmagic()
107 if (file_printf(ms, "cannot open `%s' (%s)", in file_fsmagic()
117 if (file_printf(ms, "%ssetuid", COMMA) == -1) in file_fsmagic()
122 if (file_printf(ms, "%ssetgid", COMMA) == -1) in file_fsmagic()
127 if (file_printf(ms, "%ssticky", COMMA) == -1) in file_fsmagic()
141 if ((ms->flags & MAGIC_DEVICES) != 0) { in file_fsmagic()
146 if (handle_mime(ms, mime, "chardevice") == -1) in file_fsmagic()
151 if (file_printf(ms, "%scharacter special (%d/%d/%d)", in file_fsmagic()
156 if (file_printf(ms, "%scharacter special (%ld/%ld)", in file_fsmagic()
162 if (file_printf(ms, "%scharacter special", COMMA) == -1) in file_fsmagic()
172 if((ms->flags & MAGIC_DEVICES) != 0) in file_fsmagic()
175 if (handle_mime(ms, mime, "fifo") == -1) in file_fsmagic()
178 } else if (file_printf(ms, "%sfifo (named pipe)", COMMA) == -1) in file_fsmagic()
185 if (handle_mime(ms, mime, "door") == -1) in file_fsmagic()
188 } else if (file_printf(ms, "%sdoor", COMMA) == -1) in file_fsmagic()
195 if (ms->flags & MAGIC_ERROR) { in file_fsmagic()
196 file_error(ms, errno, "unreadable symlink `%s'", fn); in file_fsmagic()
206 if (handle_mime(ms, mime, "socket") == -1) in file_fsmagic()
209 } else if (file_printf(ms, "%ssocket", COMMA) == -1) in file_fsmagic()
227 if ((ms->flags & MAGIC_DEVICES) == 0 && sb->st_size == 0) { in file_fsmagic()
229 if (handle_mime(ms, mime, "x-empty") == -1) in file_fsmagic()
232 } else if (file_printf(ms, "%sempty", COMMA) == -1) in file_fsmagic()
240 file_error(ms, 0, "invalid mode 0%o", sb->st_mode); in file_fsmagic()
246 if (file_printf(ms, " ") == -1) in file_fsmagic()