Post Scarcity
A prototype for a post scarcity programming environment
Loading...
Searching...
No Matches
print.c File Reference
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <wchar.h>
#include <wctype.h>
#include "memory/conspage.h"
#include "memory/consspaceobject.h"
#include "memory/hashmap.h"
#include "arith/integer.h"
#include "ops/intern.h"
#include "memory/stack.h"
#include "io/print.h"
#include "time/psse_time.h"
#include "memory/vectorspace.h"
Include dependency graph for print.c:

Go to the source code of this file.

Functions

struct cons_pointer print (URL_FILE *output, struct cons_pointer pointer)
 Print the cons-space object indicated by pointer to the stream indicated by output.
 
void print_128bit (URL_FILE *output, __int128_t n)
 stolen from https://stackoverflow.com/questions/11656241/how-to-print-uint128-t-number-using-gcc
 
void print_list (URL_FILE *output, struct cons_pointer pointer)
 
void print_list_contents (URL_FILE *output, struct cons_pointer pointer, bool initial_space)
 Print a single list cell (cons cell) indicated by pointer to the stream indicated by output.
 
void print_map (URL_FILE *output, struct cons_pointer map)
 
void print_string (URL_FILE *output, struct cons_pointer pointer)
 print all the characters in the string indicated by pointer onto the stream at this output, prepending and appending double quote characters.
 
void print_string_contents (URL_FILE *output, struct cons_pointer pointer)
 print all the characters in the symbol or string indicated by pointer onto this output; if pointer does not indicate a string or symbol, don't print anything but just return.
 
void print_vso (URL_FILE *output, struct cons_pointer pointer)
 
void println (URL_FILE *output)
 

Function Documentation

◆ print()

◆ print_128bit()

void print_128bit ( URL_FILE output,
__int128_t  n 
)

◆ print_list()

void print_list ( URL_FILE output,
struct cons_pointer  pointer 
)

Definition at line 85 of file print.c.

References print_list_contents(), and url_fputws.

Referenced by print().

◆ print_list_contents()

void print_list_contents ( URL_FILE output,
struct cons_pointer  pointer,
bool  initial_space 
)

Print a single list cell (cons cell) indicated by pointer to the stream indicated by output.

if initial_space is true, prepend a space character.

Definition at line 64 of file print.c.

References CONSTV, NILTV, cons_space_object::payload, pointer2cell, print(), print_list_contents(), cons_space_object::tag, url_fputwc, and url_fwprintf.

Referenced by print_list(), and print_list_contents().

◆ print_map()

void print_map ( URL_FILE output,
struct cons_pointer  map 
)

Definition at line 91 of file print.c.

References c_car(), c_cdr(), hashmap_get(), hashmap_keys(), hashmapp, nilp, pointer_to_vso, print(), url_fputwc, and url_fputws.

Referenced by print_vso().

◆ print_string()

void print_string ( URL_FILE output,
struct cons_pointer  pointer 
)

print all the characters in the string indicated by pointer onto the stream at this output, prepending and appending double quote characters.

Definition at line 52 of file print.c.

References print_string_contents(), and url_fputwc.

Referenced by print().

◆ print_string_contents()

void print_string_contents ( URL_FILE output,
struct cons_pointer  pointer 
)

print all the characters in the symbol or string indicated by pointer onto this output; if pointer does not indicate a string or symbol, don't print anything but just return.

Definition at line 35 of file print.c.

References keywordp, cons_space_object::payload, pointer2cell, stringp, symbolp, and url_fputwc.

Referenced by print(), and print_string().

◆ print_vso()

void print_vso ( URL_FILE output,
struct cons_pointer  pointer 
)

Definition at line 113 of file print.c.

References HASHTV, vector_space_object::header, pointer_to_vso, print_map(), and vector_space_header::tag.

Referenced by print().

◆ println()

void println ( URL_FILE output)

Definition at line 275 of file print.c.

References url_fputws.

Referenced by lisp_repl().