diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2012-09-18 22:11:45 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2012-09-18 22:11:45 -0700 |
commit | 20bcf160207f5c4fc7a0e11bbba2adb36b74ca63 (patch) | |
tree | 9c49f9fcccb9c8f11a8777843a2954644c9f8f03 /arith.c | |
parent | e4445e078f15013e072cffd93d6b6f3eab3ecabe (diff) | |
download | txr-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 'arith.c')
-rw-r--r-- | arith.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -1618,6 +1618,12 @@ bad: uw_throwf(error_s, lit("logxor: operation failed on ~s ~s"), a, b, nao); } +val logtest(val a, val b) +{ + /* TODO: optimize */ + return logand(a, b) == zero; +} + static val comp_trunc(val a, val bits) { cnum an, bn; |