From e4ef51fb143fbd971d94b2f2f92683627dbabc60 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sun, 30 Aug 2015 10:10:48 -0700 Subject: 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. --- lib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib.c') 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); } -- cgit v1.2.3