summaryrefslogtreecommitdiffstats
path: root/stream.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2012-09-18 22:11:45 -0700
committerKaz Kylheku <kaz@kylheku.com>2012-09-18 22:11:45 -0700
commit20bcf160207f5c4fc7a0e11bbba2adb36b74ca63 (patch)
tree9c49f9fcccb9c8f11a8777843a2954644c9f8f03 /stream.c
parente4445e078f15013e072cffd93d6b6f3eab3ecabe (diff)
downloadtxr-20bcf160207f5c4fc7a0e11bbba2adb36b74ca63.tar.gz
txr-20bcf160207f5c4fc7a0e11bbba2adb36b74ca63.tar.bz2
txr-20bcf160207f5c4fc7a0e11bbba2adb36b74ca63.zip
* arith.c (logtest): New function.
* eval.c (eval_init): Registered logtest. Registered s-ifmt, s-iflnk, s-ifreg, s-ifblk, s-ifdir, s-ifchr, s-ififo, s-isuid, s-isgid, s-isvtx, s-irwxu, s-irusr, s-iwusr, s-ixusr, s-irwxg, s-irgrp, s-iwgrp, s-ixgrp, s-irwxo, s-iroth, s-iwoth, s-ixoth variables. * lib.h (logtest): Declared. * stream.c (s_ifmt, s_ifsock, s_iflnk, s_ifreg, s_ifblk, s_ifdir, s_ifchr, s_ififo, s_isuid, s_isgid, s_isvtx, s_irwxu, s_irusr, s_iwusr, s_ixusr, s_irwxg, s_irgrp, s_iwgrp, s_ixgrp, s_irwxo, s_iroth, s_iwoth, s_ixoth): New global variables. * stream.h (s_ifmt, s_ifsock, s_iflnk, s_ifreg, s_ifblk, s_ifdir, s_ifchr, s_ififo, s_isuid, s_isgid, s_isvtx, s_irwxu, s_irusr, s_iwusr, s_ixusr, s_irwxg, s_irgrp, s_iwgrp, s_ixgrp, s_irwxo, s_iroth, s_iwoth, s_ixoth): Declared. * txr.1: Documented logtest and s-* variables for stat, as well as open-file and open-directory.
Diffstat (limited to 'stream.c')
-rw-r--r--stream.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/stream.c b/stream.c
index 1eaafc27..4d541276 100644
--- a/stream.c
+++ b/stream.c
@@ -56,6 +56,11 @@ val dev_k, ino_k, mode_k, nlink_k, uid_k;
val gid_k, rdev_k, size_k, blksize_k, blocks_k;
val atime_k, mtime_k, ctime_k;
+val s_ifmt, s_ifsock, s_iflnk, s_ifreg, s_ifblk, s_ifdir;
+val s_ifchr, s_ififo, s_isuid, s_isgid, s_isvtx, s_irwxu;
+val s_irusr, s_iwusr, s_ixusr, s_irwxg, s_irgrp, s_iwgrp;
+val s_ixgrp, s_irwxo, s_iroth, s_iwoth, s_ixoth;
+
struct strm_ops {
struct cobj_ops cobj_ops;
val (*put_string)(val, val);
@@ -1497,7 +1502,6 @@ val statf(val path)
path, num(errno), string_utf8(strerror(errno)), nao);
return list(dev_k, num(st.st_dev),
- dev_k, num(st.st_dev),
ino_k, num(st.st_ino),
mode_k, num(st.st_mode),
nlink_k, num(st.st_nlink),
@@ -1729,4 +1733,13 @@ void stream_init(void)
atime_k = intern(lit("atime"), keyword_package);
mtime_k = intern(lit("mtime"), keyword_package);
ctime_k = intern(lit("ctime"), keyword_package);
+
+ s_ifmt = num(S_IFMT); s_iflnk = num(S_IFLNK);
+ s_ifreg = num(S_IFREG); s_ifblk = num(S_IFBLK); s_ifdir = num(S_IFDIR);
+ s_ifchr = num(S_IFCHR); s_ififo = num(S_IFIFO); s_isuid = num(S_ISUID);
+ s_isgid = num(S_ISGID); s_isvtx = num(S_ISVTX); s_irwxu = num(S_IRWXU);
+ s_irusr = num(S_IRUSR); s_iwusr = num(S_IWUSR); s_ixusr = num(S_IXUSR);
+ s_irwxg = num(S_IRWXG); s_irgrp = num(S_IRGRP); s_iwgrp = num(S_IWGRP);
+ s_ixgrp = num(S_IXGRP); s_irwxo = num(S_IRWXO); s_iroth = num(S_IROTH);
+ s_iwoth = num(S_IWOTH); s_ixoth = num(S_IXOTH);
}