|
Post Scarcity
A prototype for a post scarcity programming environment
|
#include <stdlib.h>#include <string.h>#include <time.h>#include <wchar.h>#include <wctype.h>#include "memory/conspage.h"#include "memory/consspaceobject.h"#include "arith/integer.h"#include "time/psse_time.h"Go to the source code of this file.
Macros | |
| #define | _GNU_SOURCE |
| #define | seconds_per_year 31557600L |
Functions | |
| struct cons_pointer | lisp_time (struct stack_frame *frame, struct cons_pointer frame_pointer, struct cons_pointer env) |
| Function; return a time representation of the first argument in the frame; further arguments are ignored. | |
| long int | lisp_time_to_unix_time (struct cons_pointer t) |
| Return the UNIX time value which represents this time, if it falls within the period representable in UNIX time, or zero otherwise. | |
| struct cons_pointer | make_time (struct cons_pointer integer_or_nil) |
| struct cons_pointer | time_to_string (struct cons_pointer pointer) |
| This is temporary, for bootstrapping. | |
| unsigned __int128 | unix_time_to_lisp_time (time_t t) |
Variables | |
| unsigned __int128 | epoch_offset |
| PSSE Lisp epoch is 14 Bn years, or 441,806,400,000,000,000 seconds, before the UNIX epoch; the value in microseconds will break the C reader. | |
| #define _GNU_SOURCE |
Definition at line 23 of file psse_time.c.
| #define seconds_per_year 31557600L |
Definition at line 25 of file psse_time.c.
| struct cons_pointer lisp_time | ( | struct stack_frame * | frame, |
| struct cons_pointer | frame_pointer, | ||
| struct cons_pointer | env | ||
| ) |
Function; return a time representation of the first argument in the frame; further arguments are ignored.
| frame | my stack_frame. |
| frame_pointer | a pointer to my stack_frame. |
| env | my environment. |
integer_or_nil is an integer, return a time which is that number of microseconds after the notional big bang; else the current time. Definition at line 86 of file psse_time.c.
References make_time().
Referenced by main().
| long int lisp_time_to_unix_time | ( | struct cons_pointer | t | ) |
Return the UNIX time value which represents this time, if it falls within the period representable in UNIX time, or zero otherwise.
Definition at line 39 of file psse_time.c.
References epoch_offset, pointer2cell, and timep.
Referenced by time_to_string().
| struct cons_pointer make_time | ( | struct cons_pointer | integer_or_nil | ) |
Definition at line 59 of file psse_time.c.
References allocate_cell(), integerp, cons_space_object::payload, pointer2cell, TIMETV, and unix_time_to_lisp_time().
Referenced by lisp_time().
| struct cons_pointer time_to_string | ( | struct cons_pointer | pointer | ) |
This is temporary, for bootstrapping.
Definition at line 95 of file psse_time.c.
References c_string_to_lisp_string(), lisp_time_to_unix_time(), and NIL.
Referenced by print().
| unsigned __int128 unix_time_to_lisp_time | ( | time_t | t | ) |
| unsigned __int128 epoch_offset |
PSSE Lisp epoch is 14 Bn years, or 441,806,400,000,000,000 seconds, before the UNIX epoch; the value in microseconds will break the C reader.
Definition at line 31 of file psse_time.c.
Referenced by lisp_time_to_unix_time(), and unix_time_to_lisp_time().