#include "_scm.h"
#include "genio.h"
#include "smob.h"
+#include "feature.h"
#include "filesys.h"
\f
#include <unistd.h>
#endif
-#ifdef HAVE_LIBC_H
+#ifdef LIBC_H_WITH_UNISTD_H
#include <libc.h>
#endif
*/
SCM_PROC (s_sys_chown, "chown", 3, 0, 0, scm_sys_chown);
-#ifdef __STDC__
-SCM
-scm_sys_chown (SCM path, SCM owner, SCM group)
-#else
+
SCM
scm_sys_chown (path, owner, group)
SCM path;
SCM owner;
SCM group;
-#endif
{
int val;
SCM_PROC (s_sys_chmod, "chmod", 2, 0, 0, scm_sys_chmod);
-#ifdef __STDC__
-SCM
-scm_sys_chmod (SCM port_or_path, SCM mode)
-#else
+
SCM
scm_sys_chmod (port_or_path, mode)
SCM port_or_path;
SCM mode;
-#endif
{
int rv;
SCM_ASSERT (SCM_INUMP (mode), mode, SCM_ARG2, s_sys_chmod);
}
SCM_PROC (s_umask, "umask", 0, 1, 0, scm_umask);
-#ifdef __STDC__
-SCM
-scm_umask (SCM mode)
-#else
+
SCM
scm_umask (mode)
SCM mode;
-#endif
{
mode_t mask;
if (SCM_UNBNDP (mode))
*/
long scm_tc16_fd;
-#ifdef __STDC__
-static int
-scm_fd_print (SCM sexp, SCM port, int writing)
-#else
+
+static int scm_fd_print SCM_P ((SCM sexp, SCM port, scm_print_state *pstate));
+
static int
-scm_fd_print (sexp, port, writing)
+scm_fd_print (sexp, port, pstate)
SCM sexp;
SCM port;
- int writing;
-#endif
+ scm_print_state *pstate;
{
scm_gen_puts (scm_regular_string, "#<fd ", port);
scm_intprint (SCM_CDR (sexp), 10, port);
return 1;
}
-#ifdef __STDC__
-static scm_sizet
-scm_fd_free (SCM p)
-#else
+
+static scm_sizet scm_fd_free SCM_P ((SCM p));
+
static scm_sizet
scm_fd_free (p)
SCM p;
-#endif
{
SCM flags;
static scm_smobfuns fd_smob = {scm_mark0, scm_fd_free, scm_fd_print, 0};
-#ifdef __STDC__
-SCM
-scm_intern_fd (int fd, int flags)
-#else
+
SCM
scm_intern_fd (fd, flags)
int fd;
int flags;
-#endif
{
SCM it;
SCM_NEWCELL (it);
\f
SCM_PROC (s_sys_open, "open", 3, 0, 0, scm_sys_open);
-#ifdef __STDC__
-SCM
-scm_sys_open (SCM path, SCM flags, SCM mode)
-#else
+
SCM
scm_sys_open (path, flags, mode)
SCM path;
SCM flags;
SCM mode;
-#endif
{
int fd;
SCM sfd;
SCM_PROC (s_sys_create, "create", 2, 0, 0, scm_sys_create);
-#ifdef __STDC__
-SCM
-scm_sys_create (SCM path, SCM mode)
-#else
+
SCM
scm_sys_create (path, mode)
SCM path;
SCM mode;
-#endif
{
int fd;
SCM sfd;
SCM_PROC (s_sys_close, "close", 1, 0, 0, scm_sys_close);
-#ifdef __STDC__
-SCM
-scm_sys_close (SCM sfd)
-#else
+
SCM
scm_sys_close (sfd)
SCM sfd;
-#endif
{
int fd;
int got;
SCM_PROC (s_sys_write_fd, "write-fd", 2, 0, 0, scm_sys_write_fd);
-#ifdef __STDC__
-SCM
-scm_sys_write_fd (SCM sfd, SCM buf)
-#else
+
SCM
scm_sys_write_fd (sfd, buf)
SCM sfd;
SCM buf;
-#endif
{
SCM answer;
int fd;
SCM_PROC (s_sys_read_fd, "read-fd", 2, 2, 0, scm_sys_read_fd);
-#ifdef __STDC__
-SCM
-scm_sys_read_fd (SCM sfd, SCM buf, SCM offset, SCM length)
-#else
+
SCM
scm_sys_read_fd (sfd, buf, offset, length)
SCM sfd;
SCM buf;
SCM offset;
SCM length;
-#endif
{
SCM answer;
int fd;
}
SCM_PROC (s_sys_lseek, "lseek", 2, 1, 0, scm_sys_lseek);
-#ifdef __STDC__
-SCM
-scm_sys_lseek (SCM sfd, SCM offset, SCM whence)
-#else
+
SCM
scm_sys_lseek (sfd, offset, whence)
SCM sfd;
SCM offset;
SCM whence;
-#endif
{
SCM answer;
int fd;
SCM_PROC (s_sys_dup, "dup", 1, 1, 0, scm_sys_dup);
-#ifdef __STDC__
-SCM
-scm_sys_dup (SCM oldfd, SCM newfd)
-#else
+
SCM
scm_sys_dup (oldfd, newfd)
SCM oldfd;
SCM newfd;
-#endif
{
SCM answer;
int fd;
\f
/* {Files}
*/
-#ifdef __STDC__
-static SCM
-scm_stat2scm (struct stat *stat_temp)
-#else
+
+SCM_SYMBOL (scm_sym_regular, "regular");
+SCM_SYMBOL (scm_sym_directory, "directory");
+SCM_SYMBOL (scm_sym_symlink, "symlink");
+SCM_SYMBOL (scm_sym_block_special, "block-special");
+SCM_SYMBOL (scm_sym_char_special, "char-special");
+SCM_SYMBOL (scm_sym_fifo, "fifo");
+SCM_SYMBOL (scm_sym_sock, "socket");
+SCM_SYMBOL (scm_sym_unknown, "unknown");
+
+static SCM scm_stat2scm SCM_P ((struct stat *stat_temp));
+
static SCM
scm_stat2scm (stat_temp)
struct stat *stat_temp;
-#endif
{
- SCM ans = scm_make_vector (SCM_MAKINUM (13), SCM_UNSPECIFIED, SCM_BOOL_F);
+ SCM ans = scm_make_vector (SCM_MAKINUM (15), SCM_UNSPECIFIED, SCM_BOOL_F);
SCM *ve = SCM_VELTS (ans);
+
ve[0] = scm_ulong2num ((unsigned long) stat_temp->st_dev);
ve[1] = scm_ulong2num ((unsigned long) stat_temp->st_ino);
ve[2] = scm_ulong2num ((unsigned long) stat_temp->st_mode);
#else
ve[12] = SCM_BOOL_F;
#endif
+ {
+ int mode = stat_temp->st_mode;
+
+ if (S_ISREG (mode))
+ ve[13] = scm_sym_regular;
+ else if (S_ISDIR (mode))
+ ve[13] = scm_sym_directory;
+ else if (S_ISLNK (mode))
+ ve[13] = scm_sym_symlink;
+ else if (S_ISBLK (mode))
+ ve[13] = scm_sym_block_special;
+ else if (S_ISCHR (mode))
+ ve[13] = scm_sym_char_special;
+ else if (S_ISFIFO (mode))
+ ve[13] = scm_sym_fifo;
+ else if (S_ISSOCK (mode))
+ ve[13] = scm_sym_sock;
+ else
+ ve[13] = scm_sym_unknown;
+
+ ve[14] = SCM_MAKINUM ((~S_IFMT) & mode);
+
+ /* the layout of the bits in ve[14] is intended to be portable.
+ If there are systems that don't follow the usual convention,
+ the following could be used:
+
+ tmp = 0;
+ if (S_ISUID & mode) tmp += 1;
+ tmp <<= 1;
+ if (S_IRGRP & mode) tmp += 1;
+ tmp <<= 1;
+ if (S_ISVTX & mode) tmp += 1;
+ tmp <<= 1;
+ if (S_IRUSR & mode) tmp += 1;
+ tmp <<= 1;
+ if (S_IWUSR & mode) tmp += 1;
+ tmp <<= 1;
+ if (S_IXUSR & mode) tmp += 1;
+ tmp <<= 1;
+ if (S_IWGRP & mode) tmp += 1;
+ tmp <<= 1;
+ if (S_IXGRP & mode) tmp += 1;
+ tmp <<= 1;
+ if (S_IROTH & mode) tmp += 1;
+ tmp <<= 1;
+ if (S_IWOTH & mode) tmp += 1;
+ tmp <<= 1;
+ if (S_IXOTH & mode) tmp += 1;
+
+ ve[14] = SCM_MAKINUM (tmp);
+
+ */
+ }
return ans;
}
SCM_PROC (s_sys_stat, "stat", 1, 0, 0, scm_sys_stat);
-#ifdef __STDC__
-SCM
-scm_sys_stat (SCM fd_or_path)
-#else
+
SCM
scm_sys_stat (fd_or_path)
SCM fd_or_path;
-#endif
{
int rv = 1;
struct stat stat_temp;
}
if (rv != 0)
- scm_syserror (s_sys_stat);
+ scm_syserror_msg (s_sys_stat, "%s: %S",
+ scm_listify (scm_makfrom0str (strerror (errno)),
+ fd_or_path,
+ SCM_UNDEFINED));
return scm_stat2scm (&stat_temp);
}
*/
SCM_PROC (s_sys_link, "link", 2, 0, 0, scm_sys_link);
-#ifdef __STDC__
-SCM
-scm_sys_link (SCM oldpath, SCM newpath)
-#else
+
SCM
scm_sys_link (oldpath, newpath)
SCM oldpath;
SCM newpath;
-#endif
{
int val;
SCM_PROC (s_sys_rename, "rename-file", 2, 0, 0, scm_sys_rename);
-#ifdef __STDC__
-SCM
-scm_sys_rename (SCM oldname, SCM newname)
-#else
+
SCM
scm_sys_rename (oldname, newname)
SCM oldname;
SCM newname;
-#endif
{
int rv;
SCM_ASSERT (SCM_NIMP (oldname) && SCM_STRINGP (oldname), oldname, SCM_ARG1, s_sys_rename);
SCM_PROC(s_sys_delete_file, "delete-file", 1, 0, 0, scm_sys_delete_file);
-#ifdef __STDC__
-SCM
-scm_sys_delete_file (SCM str)
-#else
+
SCM
scm_sys_delete_file (str)
SCM str;
-#endif
{
int ans;
SCM_ASSERT (SCM_NIMP (str) && SCM_STRINGP (str), str, SCM_ARG1, s_sys_delete_file);
SCM_PROC (s_sys_mkdir, "mkdir", 1, 1, 0, scm_sys_mkdir);
-#ifdef __STDC__
-SCM
-scm_sys_mkdir (SCM path, SCM mode)
-#else
+
SCM
scm_sys_mkdir (path, mode)
SCM path;
SCM mode;
-#endif
{
#ifdef HAVE_MKDIR
int rv;
SCM_PROC (s_sys_rmdir, "rmdir", 1, 0, 0, scm_sys_rmdir);
-#ifdef __STDC__
-SCM
-scm_sys_rmdir (SCM path)
-#else
+
SCM
scm_sys_rmdir (path)
SCM path;
-#endif
{
#ifdef HAVE_RMDIR
int val;
long scm_tc16_dir;
SCM_PROC (s_sys_opendir, "opendir", 1, 0, 0, scm_sys_opendir);
-#ifdef __STDC__
-SCM
-scm_sys_opendir (SCM dirname)
-#else
+
SCM
scm_sys_opendir (dirname)
SCM dirname;
-#endif
{
DIR *ds;
SCM dir;
SCM_SYSCALL (ds = opendir (SCM_CHARS (dirname)));
if (ds == NULL)
scm_syserror (s_sys_opendir);
- SCM_CAR (dir) = scm_tc16_dir | SCM_OPN;
+ SCM_SETCAR (dir, scm_tc16_dir | SCM_OPN);
SCM_SETCDR (dir, ds);
SCM_ALLOW_INTS;
return dir;
SCM_PROC (s_sys_readdir, "readdir", 1, 0, 0, scm_sys_readdir);
-#ifdef __STDC__
-SCM
-scm_sys_readdir (SCM port)
-#else
+
SCM
scm_sys_readdir (port)
SCM port;
-#endif
{
struct dirent *rdent;
SCM_DEFER_INTS;
SCM_PROC (s_rewinddir, "rewinddir", 1, 0, 0, scm_rewinddir);
-#ifdef __STDC__
-SCM
-scm_rewinddir (SCM port)
-#else
+
SCM
scm_rewinddir (port)
SCM port;
-#endif
{
SCM_ASSERT (SCM_NIMP (port) && SCM_OPDIRP (port), port, SCM_ARG1, s_rewinddir);
rewinddir ((DIR *) SCM_CDR (port));
SCM_PROC (s_sys_closedir, "closedir", 1, 0, 0, scm_sys_closedir);
-#ifdef __STDC__
-SCM
-scm_sys_closedir (SCM port)
-#else
+
SCM
scm_sys_closedir (port)
SCM port;
-#endif
{
int sts;
SCM_SYSCALL (sts = closedir ((DIR *) SCM_CDR (port)));
if (sts != 0)
scm_syserror (s_sys_closedir);
- SCM_CAR (port) = scm_tc16_dir;
+ SCM_SETCAR (port, scm_tc16_dir);
SCM_ALLOW_INTS;
return SCM_UNSPECIFIED;
}
-#ifdef __STDC__
-static int
-scm_dir_print (SCM sexp, SCM port, int writing)
-#else
+
+static int scm_dir_print SCM_P ((SCM sexp, SCM port, scm_print_state *pstate));
+
static int
-scm_dir_print (sexp, port, writing)
+scm_dir_print (sexp, port, pstate)
SCM sexp;
SCM port;
- int writing;
-#endif
+ scm_print_state *pstate;
{
scm_prinport (sexp, port, "directory");
return 1;
}
-#ifdef __STDC__
-static scm_sizet
-scm_dir_free (SCM p)
-#else
+
+static scm_sizet scm_dir_free SCM_P ((SCM p));
+
static scm_sizet
scm_dir_free (p)
SCM p;
-#endif
{
if (SCM_OPENP (p))
closedir ((DIR *) SCM_CDR (p));
SCM_PROC (s_sys_chdir, "chdir", 1, 0, 0, scm_sys_chdir);
-#ifdef __STDC__
-SCM
-scm_sys_chdir (SCM str)
-#else
+
SCM
scm_sys_chdir (str)
SCM str;
-#endif
{
int ans;
SCM_PROC (s_sys_getcwd, "getcwd", 0, 0, 0, scm_sys_getcwd);
-#ifdef __STDC__
-SCM
-scm_sys_getcwd (void)
-#else
+
SCM
scm_sys_getcwd ()
-#endif
{
#ifdef HAVE_GETCWD
char *rv;
\f
-#ifdef __STDC__
-static void
-fill_select_type (SELECT_TYPE * set, SCM list)
-#else
+
+static void fill_select_type SCM_P ((SELECT_TYPE * set, SCM list));
+
static void
fill_select_type (set, list)
SELECT_TYPE * set;
SCM list;
-#endif
{
while (list != SCM_EOL)
{
}
}
-#ifdef __STDC__
-static SCM
-retrieve_select_type (SELECT_TYPE * set, SCM list)
-#else
+
+static SCM retrieve_select_type SCM_P ((SELECT_TYPE * set, SCM list));
+
static SCM
retrieve_select_type (set, list)
SELECT_TYPE * set;
SCM list;
-#endif
{
SCM answer;
answer = SCM_EOL;
}
+/* {Checking for events}
+ */
+
SCM_PROC (s_sys_select, "select", 3, 2, 0, scm_sys_select);
-#ifdef __STDC__
-SCM
-scm_sys_select (SCM reads, SCM writes, SCM excepts, SCM secs, SCM msecs)
-#else
+
SCM
scm_sys_select (reads, writes, excepts, secs, msecs)
SCM reads;
SCM excepts;
SCM secs;
SCM msecs;
-#endif
{
#ifdef HAVE_SELECT
struct timeval timeout;
SCM_DEFER_INTS;
sreturn = select (SELECT_SET_SIZE,
&read_set, &write_set, &except_set, time_p);
- SCM_ALLOW_INTS;
if (sreturn < 0)
scm_syserror (s_sys_select);
+ SCM_ALLOW_INTS;
return scm_listify (retrieve_select_type (&read_set, reads),
retrieve_select_type (&write_set, writes),
retrieve_select_type (&except_set, excepts),
#endif
}
+/* Check if FILE has characters waiting to be read. */
+
+#ifdef __IBMC__
+# define MSDOS
+#endif
+#ifdef MSDOS
+# ifndef GO32
+# include <io.h>
+# include <conio.h>
+
+int
+scm_input_waiting_p (f, caller)
+ FILE *f;
+ char *caller;
+{
+ if (feof (f))
+ return 1;
+ if (fileno (f) == fileno (stdin) && (isatty (fileno (stdin))))
+ return kbhit ();
+ return -1;
+}
+
+# endif
+#else
+# ifdef _DCC
+# include <ioctl.h>
+# else
+# ifndef AMIGA
+# ifndef vms
+# ifdef MWC
+# include <sys/io.h>
+# else
+# ifndef THINK_C
+# ifndef ARM_ULIB
+# include <sys/ioctl.h>
+# endif
+# endif
+# endif
+# endif
+# endif
+# endif
+
+int
+scm_input_waiting_p (f, caller)
+ FILE *f;
+ char *caller;
+{
+ /* Can we return an end-of-file character? */
+ if (feof (f))
+ return 1;
+
+ /* Do we have characters in the stdio buffer? */
+# ifdef FILE_CNT_FIELD
+ if (f->FILE_CNT_FIELD > 0)
+ return 1;
+# else
+# ifdef FILE_CNT_GPTR
+ if (f->_gptr != f->_egptr)
+ return 1;
+# else
+# ifdef FILE_CNT_READPTR
+ if (f->_IO_read_end != f->_IO_read_ptr)
+ return 1;
+# else
+ Configure.in could not guess the name of the correct field in a FILE *.
+ This function needs to be ported to your system.
+ It should return zero iff no characters are waiting to be read.;
+# endif
+# endif
+# endif
+
+ /* Is the file prepared to deliver input? */
+# ifdef HAVE_SELECT
+ {
+ struct timeval timeout;
+ SELECT_TYPE read_set;
+ SELECT_TYPE write_set;
+ SELECT_TYPE except_set;
+ int fno = fileno ((FILE *)f);
+
+ FD_ZERO (&read_set);
+ FD_ZERO (&write_set);
+ FD_ZERO (&except_set);
+
+ FD_SET (fno, &read_set);
+
+ timeout.tv_sec = 0;
+ timeout.tv_usec = 0;
+
+ SCM_DEFER_INTS;
+ if (select (SELECT_SET_SIZE,
+ &read_set, &write_set, &except_set, &timeout)
+ < 0)
+ scm_syserror (caller);
+ SCM_ALLOW_INTS;
+ return FD_ISSET (fno, &read_set);
+ }
+# else
+# ifdef FIONREAD
+ {
+ long remir;
+ ioctl(fileno(f), FIONREAD, &remir);
+ return remir;
+ }
+# else
+ scm_misc_error ("char-ready?", "Not fully implemented\n");
+# endif
+# endif
+}
+#endif
+
\f
/* {Symbolic Links}
*/
SCM_PROC (s_sys_symlink, "symlink", 2, 0, 0, scm_sys_symlink);
-#ifdef __STDC__
-SCM
-scm_sys_symlink(SCM oldpath, SCM newpath)
-#else
+
SCM
scm_sys_symlink(oldpath, newpath)
SCM oldpath;
SCM newpath;
-#endif
{
#ifdef HAVE_SYMLINK
int val;
SCM_PROC (s_sys_readlink, "readlink", 1, 0, 0, scm_sys_readlink);
-#ifdef __STDC__
-SCM
-scm_sys_readlink(SCM path)
-#else
+
SCM
scm_sys_readlink(path)
SCM path;
-#endif
{
#ifdef HAVE_READLINK
scm_sizet rv;
SCM_PROC (s_sys_lstat, "lstat", 1, 0, 0, scm_sys_lstat);
-#ifdef __STDC__
-SCM
-scm_sys_lstat(SCM str)
-#else
+
SCM
scm_sys_lstat(str)
SCM str;
-#endif
{
#ifdef HAVE_LSTAT
int rv;
SCM_ASSERT(SCM_NIMP(str) && SCM_STRINGP(str), str, (char *)SCM_ARG1, s_sys_lstat);
SCM_SYSCALL(rv = lstat(SCM_CHARS(str), &stat_temp));
if (rv != 0)
- scm_syserror (s_sys_lstat);
+ scm_syserror_msg (s_sys_lstat, "%s: %S",
+ scm_listify (scm_makfrom0str (strerror (errno)),
+ str,
+ SCM_UNDEFINED));
return scm_stat2scm(&stat_temp);
#else
scm_sysmissing (s_sys_lstat);
SCM_PROC (s_sys_copy_file, "copy-file", 2, 0, 0, scm_sys_copy_file);
-#ifdef __STDC__
-SCM
-scm_sys_copy_file (SCM oldfile, SCM newfile)
-#else
+
SCM
scm_sys_copy_file (oldfile, newfile)
SCM oldfile;
SCM newfile;
-#endif
{
int oldfd, newfd;
int n;
}
\f
-#ifdef __STDC__
-void
-scm_init_filesys (void)
-#else
+
void
scm_init_filesys ()
-#endif
{
- /* File type/permission bits. */
-#ifdef S_IRUSR
- scm_sysintern ("S_IRUSR", SCM_MAKINUM (S_IRUSR));
-#endif
-#ifdef S_IWUSR
- scm_sysintern ("S_IWUSR", SCM_MAKINUM (S_IWUSR));
-#endif
-#ifdef S_IXUSR
- scm_sysintern ("S_IXUSR", SCM_MAKINUM (S_IXUSR));
-#endif
-#ifdef S_IRWXU
- scm_sysintern ("S_IRWXU", SCM_MAKINUM (S_IRWXU));
-#endif
-
-#ifdef S_IRGRP
- scm_sysintern ("S_IRGRP", SCM_MAKINUM (S_IRGRP));
-#endif
-#ifdef S_IWGRP
- scm_sysintern ("S_IWGRP", SCM_MAKINUM (S_IWGRP));
-#endif
-#ifdef S_IXGRP
- scm_sysintern ("S_IXGRP", SCM_MAKINUM (S_IXGRP));
-#endif
-#ifdef S_IRWXG
- scm_sysintern ("S_IRWXG", SCM_MAKINUM (S_IRWXG));
-#endif
-
-#ifdef S_IROTH
- scm_sysintern ("S_IROTH", SCM_MAKINUM (S_IROTH));
-#endif
-#ifdef S_IWOTH
- scm_sysintern ("S_IWOTH", SCM_MAKINUM (S_IWOTH));
-#endif
-#ifdef S_IXOTH
- scm_sysintern ("S_IXOTH", SCM_MAKINUM (S_IXOTH));
-#endif
-#ifdef S_IRWXO
- scm_sysintern ("S_IRWXO", SCM_MAKINUM (S_IRWXO));
-#endif
-
-#ifdef S_ISUID
- scm_sysintern ("S_ISUID", SCM_MAKINUM (S_ISUID));
-#endif
-#ifdef S_ISGID
- scm_sysintern ("S_ISGID", SCM_MAKINUM (S_ISGID));
-#endif
-#ifdef S_ISVTX
- scm_sysintern ("S_ISVTX", SCM_MAKINUM (S_ISVTX));
-#endif
-
-#ifdef S_IFMT
- scm_sysintern ("S_IFMT", SCM_MAKINUM (S_IFMT));
-#endif
-#ifdef S_IFDIR
- scm_sysintern ("S_IFDIR", SCM_MAKINUM (S_IFDIR));
-#endif
-#ifdef S_IFCHR
- scm_sysintern ("S_IFCHR", SCM_MAKINUM (S_IFCHR));
-#endif
-#ifdef S_IFBLK
- scm_sysintern ("S_IFBLK", SCM_MAKINUM (S_IFBLK));
-#endif
-#ifdef S_IFREG
- scm_sysintern ("S_IFREG", SCM_MAKINUM (S_IFREG));
-#endif
-#ifdef S_IFLNK
- scm_sysintern ("S_IFLNK", SCM_MAKINUM (S_IFLNK));
-#endif
-#ifdef S_IFSOCK
- scm_sysintern ("S_IFSOCK", SCM_MAKINUM (S_IFSOCK));
-#endif
-#ifdef S_IFIFO
- scm_sysintern ("S_IFIFO", SCM_MAKINUM (S_IFIFO));
-#endif
-
+ scm_add_feature ("i/o-extensions");
scm_tc16_fd = scm_newsmob (&fd_smob);
scm_tc16_dir = scm_newsmob (&dir_smob);