summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-08-30 10:10:48 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-08-30 10:10:48 -0700
commite4ef51fb143fbd971d94b2f2f92683627dbabc60 (patch)
treec8302b4abf5610a3cd273ebae3233165647f2f67 /lib.c
parent8dbbc8c2f56e84e9cff97188dc5ad832660d3cc8 (diff)
downloadtxr-e4ef51fb143fbd971d94b2f2f92683627dbabc60.tar.gz
txr-e4ef51fb143fbd971d94b2f2f92683627dbabc60.tar.bz2
txr-e4ef51fb143fbd971d94b2f2f92683627dbabc60.zip
Move stat functions to use a struct.
* lib.c (init): Move hash_init and struct init before sysif_init. * share/txr/stdlib/path-test.tl (sys:path-test-mode, path-mine-p, path-my-group-p, sys:path-access, path-newer, path-examine): Convert to struct return of stat functions. * stream.c (dev_k, ino_k, mode_k, nlink_k, uid_k, gid_k, rdev_k, size_k, blksize_k, blocks_k, atime_k, mtime_k, ctime_k): Global variable definitions removed from here. (stream_init): Initializations of moved global variables removed from here. * stream.h (dev_k, ino_k, mode_k, nlink_k, uid_k, gid_k, rdev_k, size_k, blksize_k, blocks_k, atime_k, mtime_k, ctime_k): Declarations removed from here. * sysif.c (stat_s, dev_s, ino_s, mode_s, nlink_s, uid_s, gid_s, rdev_s, size_s, blksize_s, blocks_s, atime_s, mtime_s, ctime_s): New global variables. (dev_k, ino_k, mode_k, nlink_k, uid_k, gid_k, rdev_k, size_k, blksize_k, blocks_k, atime_k, mtime_k, ctime_k): Existing variables moved here. (stat_to_struct): New static function. (stat_impl): Use stat_to_struct, except under 113 compatibility. (sysif_init): Initialize new symbol variables. Make stat struct type. * sysif.h (stat_s, dev_s, ino_s, mode_s, nlink_s, uid_s, gid_s, rdev_s, size_s, blksize_s, blocks_s, atime_s, mtime_s, ctime_s): Declared.
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib.c b/lib.c
index 8b41696f..fde73899 100644
--- a/lib.c
+++ b/lib.c
@@ -7643,6 +7643,8 @@ void init(const wchar_t *pn, mem_t *(*oom)(mem_t *, size_t),
obj_init();
uw_init();
eval_init();
+ hash_init();
+ struct_init();
sysif_init();
arith_init();
rand_init();
@@ -7651,7 +7653,6 @@ void init(const wchar_t *pn, mem_t *(*oom)(mem_t *, size_t),
sig_init();
#endif
filter_init();
- hash_init();
regex_init();
gc_late_init();
parse_init();
@@ -7664,7 +7665,6 @@ void init(const wchar_t *pn, mem_t *(*oom)(mem_t *, size_t),
glob_init();
#endif
cadr_init();
- struct_init();
gc_state(gc_save);
}