diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-09-12 10:23:59 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-09-12 10:25:14 +0200 |
commit | 108a0454d05c744c4a05e298cfc8cbf157952414 (patch) | |
tree | ca99bed5d49eabfb644c3b1c0a397b1354efdaf3 /doc/ref | |
parent | Change overarching structure of info document. (diff) | |
download | calp-108a0454d05c744c4a05e298cfc8cbf157952414.tar.gz calp-108a0454d05c744c4a05e298cfc8cbf157952414.tar.xz |
Rework file tree structure for info files.
Diffstat (limited to '')
-rw-r--r-- | doc/ref/calp-prime.texi | 177 | ||||
-rw-r--r-- | doc/ref/general.texi | 27 | ||||
-rw-r--r-- | doc/ref/general/base64.texi (renamed from doc/ref/guile/base64.texi) | 0 | ||||
-rw-r--r-- | doc/ref/general/bst.texi | 37 | ||||
-rw-r--r-- | doc/ref/general/crypto.texi (renamed from doc/ref/guile/crypto.texi) | 0 | ||||
-rw-r--r-- | doc/ref/general/datetime.texi (renamed from doc/ref/guile/datetime.texi) | 0 | ||||
-rw-r--r-- | doc/ref/general/glob.texi (renamed from doc/ref/guile/glob.texi) | 0 | ||||
-rw-r--r-- | doc/ref/general/graphviz.texi (renamed from doc/ref/guile/graphviz.texi) | 0 | ||||
-rw-r--r-- | doc/ref/general/io.texi | 31 | ||||
-rw-r--r-- | doc/ref/general/srfi-41.texi (renamed from doc/ref/guile/srfi-41.texi) | 0 | ||||
-rw-r--r-- | doc/ref/general/util-config.texi (renamed from doc/ref/guile/util-config.texi) | 0 | ||||
-rw-r--r-- | doc/ref/general/util-exceptions.texi (renamed from doc/ref/guile/util-exceptions.texi) | 0 | ||||
-rw-r--r-- | doc/ref/general/util-path.texi (renamed from doc/ref/guile/util-path.texi) | 0 | ||||
-rw-r--r-- | doc/ref/general/util.texi (renamed from doc/ref/guile/util.texi) | 88 | ||||
-rw-r--r-- | doc/ref/general/uuid.texi | 17 | ||||
-rw-r--r-- | doc/ref/general/xdg-basedir.texi (renamed from doc/ref/guile/xdg-basedir.texi) | 0 | ||||
-rw-r--r-- | doc/ref/general/zic.texi (renamed from doc/ref/guile/zic.texi) | 0 | ||||
-rw-r--r-- | doc/ref/guile/translation.texi | 31 | ||||
-rw-r--r-- | doc/ref/guile/vcomponent.texi | 117 | ||||
-rw-r--r-- | doc/ref/vcomponent.texi | 115 | ||||
-rw-r--r-- | doc/ref/vulgar.texi | 238 | ||||
-rw-r--r-- | doc/ref/vulgar/color.texi | 18 | ||||
-rw-r--r-- | doc/ref/vulgar/termios.texi | 217 | ||||
-rw-r--r-- | doc/ref/web.texi | 2 | ||||
-rw-r--r-- | doc/ref/web/web.texi (renamed from doc/ref/guile/web.texi) | 0 |
25 files changed, 455 insertions, 660 deletions
diff --git a/doc/ref/calp-prime.texi b/doc/ref/calp-prime.texi index 89decb1b..a13cbd0b 100644 --- a/doc/ref/calp-prime.texi +++ b/doc/ref/calp-prime.texi @@ -1,179 +1,8 @@ @node Calp as a Program @chapter Calp as a Program -@include guile/translation.texi +@include calp/translation.texi +@include calp/error.texi +@include calp/other.texi -@node Errors and Conditions -@section Errors and Conditions - -@subsection ``Special'' Errors - -@deftp{Error type} return -Thrown in some sub-mains to quickly return from the sub-function. -Should possibly be replaced by an explicit return-continuation. -@end deftp - -@deftp{Error type} warning fmt args -Thrown when @code{warnings-are-errors} is true. - -@ref{warning} for more information. -@end deftp - -@deftp{Error type} max-page page-number -@end deftp - -@subsection ``Regular'' Errors -All below mentioned error types behave as expected, e.g., they are -produced through @code{scm-error}. - -@deftp{Error Type} configuration-error -Thrown by (calp util config), in some scenarios. -@TODO{Better documentation} -@end deftp - -@deftp{Error Type} c-parse-error -Errors thrown by our make-shift C parser. -@end deftp - -@deftp{Error Type} decoding-error -thrown by base64 in some cases -@end deftp - -@deftp{Error Type} parse-error -Thrown by some things related to parsing, but not all. -@TODO{normalize parsing errors further} -@end deftp - -@deftp{Error Type} graph-error -The first element of data is guaranteed to be the graph which caused -the error. -@end deftp - -@deftp{Error Type} missing-helper -A helper program we wanted was missing, could be resolved by somehow -downloading it into one of the searched locations. - -@example -data : (program-name : string) - , (searched-locations : (list string)) -@end example -@end deftp - - - -@node Other -@section Other - -@defun get-parser type -@example -get-parser ∷ type-name → hash-table x string → any -type = 'BINARY | 'BOOLEAN | 'CAL-ADDRES | 'DATE | 'DATE-TIME - | 'DURATION | 'FLOAT | 'INTEGER | 'PERIOD | 'RECUR - | 'TEXT | 'TIME | 'URI | 'UTC-OFFSET -@end example - -@ref{ical-get-writer} -@end defun - -@subsection formats ical -@subsubsection output - -@defun component->ical-string component -@end defun - -@defun print-components-with-fake-parent events -@end defun - -@defun print-all-events -@end defun - -@defun print-events-in-interval start end -@end defun - -@subsubsection parse - -@defun parse-calendar port -@end defun - -@subsubsection types - -@defun escape-chars str -Escape @code{,}, @code{;} and @code{\} with a -backslash, and encode newlines as @code{\n}. -@end defun - -@defun get-writer type -@anchor{ical-get-writer} -@example -get-writer ∷ type-name → hash-table x value → string -type = 'BINARY | 'BOOLEAN | 'CAL-ADDRES | 'DATE | 'DATE-TIME - | 'DURATION | 'FLOAT | 'INTEGER | 'PERIOD | 'RECUR - | 'TEXT | 'TIME | 'URI | 'UTC-OFFSET -@end example -@end defun - -@subsection formats vdir -@subsubsection parse - -@defun parse-vdir path -@end defun - -@subsubsection save-delete - -@defun save-event event -@end defun - -@defun remove-event event -@end defun - -@subsection formats xcal -@subsubsection output - -@defun vcomponent->sxcal component -@end defun - -@defun ns-wrap -@lisp -(define (ns-wrap sxml) - `(icalendar (@@ (xmlns "urn:ietf:params:xml:ns:icalendar-2.0")) - ,sxml)) -@end lisp -Where @var{sxml} is expected to be the output of @var{vcomponent->sxcal}. -@end defun - -@subsubsection parse -@defun sxcal->vcomponent sxcal -Parses a vcomponent in sxcal format. Requires that the vcomponent is -the root of the document (fragment), so wrapping icalendar-tags or -similar @emph{must} be removed. - -@example -(vcalendar - (properties ...) - (components ...)) -@end example -@end defun - -@subsubsection types -@defun get-writer type -@ref{ical-get-writer} -@end defun - - -@c -------------------------------------------------- - -@c TODO -This chapter will probably in the future be replaced by a proper -system overview in the future. - -@c module (vcomponent control) - -@defmac with-replaced-properties (component (key value) ...) body ... -Through the extent of @var{body} each @var{key}'s value in -@var{component} is replaced by its repspective @var{value}. - -Note that @var{body} is guarded through a dynamic-wind, meaning that -even non-local exits will restore @var{component} to its initial -state. -@end defmac diff --git a/doc/ref/general.texi b/doc/ref/general.texi index 0b54205a..be68fca6 100644 --- a/doc/ref/general.texi +++ b/doc/ref/general.texi @@ -1,15 +1,18 @@ @node Generally Useful Utilities @chapter Generally Useful Utilities -@include guile/datetime.texi -@include guile/zic.texi -@include guile/srfi-41.texi -@include guile/util.texi -@include guile/util-path.texi -@include guile/util-config.texi -@include guile/util-exceptions.texi -@include guile/base64.texi -@include guile/xdg-basedir.texi -@include guile/glob.texi -@include guile/graphviz.texi -@include guile/crypto.texi +@include general/datetime.texi +@include general/zic.texi +@include general/srfi-41.texi +@include general/util.texi +@include general/uuid.texi +@include general/io.texi +@include general/bst.texi +@include general/util-path.texi +@include general/util-config.texi +@include general/util-exceptions.texi +@include general/base64.texi +@include general/xdg-basedir.texi +@include general/glob.texi +@include general/graphviz.texi +@include general/crypto.texi diff --git a/doc/ref/guile/base64.texi b/doc/ref/general/base64.texi index ab6bba81..ab6bba81 100644 --- a/doc/ref/guile/base64.texi +++ b/doc/ref/general/base64.texi diff --git a/doc/ref/general/bst.texi b/doc/ref/general/bst.texi new file mode 100644 index 00000000..d2bba0ff --- /dev/null +++ b/doc/ref/general/bst.texi @@ -0,0 +1,37 @@ +@node Binary Search Tree +@section Binary Search Tree + +A simple ``read only'' binary search tree. + +@defun make-tree pred? lst +Constructs a new tree. @var{pred?} should be a procedure taking the +first element of @var{lst}, along with each element, and should return +a boolean value indicating if the specific element should go in the +left or right subtree. (left subtree is ``truthy'' values). + +This operation is done recursively. +@end defun + +@defun tree-node tree +Return the value of a tree node. +@end defun + +@defun left-subtree tree +Return all ``truthy'' children of tree node. +@end defun + +@defun right-subtree tree +Return all ``falsy children of tree node. +@end defun + +@defun length-of-longest-branch tree +Get the depth of a tree. +@end defun + +@defun tree-map proc tree +Apply proc onto the value of every node in tree, keeping the structure +of the tree. + +@b{Note:} this can cause the tree to no longer be a binary search +tree, but simply a ``formless'' binary tree. +@end defun diff --git a/doc/ref/guile/crypto.texi b/doc/ref/general/crypto.texi index b9e362d3..b9e362d3 100644 --- a/doc/ref/guile/crypto.texi +++ b/doc/ref/general/crypto.texi diff --git a/doc/ref/guile/datetime.texi b/doc/ref/general/datetime.texi index 037ac8d5..037ac8d5 100644 --- a/doc/ref/guile/datetime.texi +++ b/doc/ref/general/datetime.texi diff --git a/doc/ref/guile/glob.texi b/doc/ref/general/glob.texi index 400eb1f7..400eb1f7 100644 --- a/doc/ref/guile/glob.texi +++ b/doc/ref/general/glob.texi diff --git a/doc/ref/guile/graphviz.texi b/doc/ref/general/graphviz.texi index 72817ea8..72817ea8 100644 --- a/doc/ref/guile/graphviz.texi +++ b/doc/ref/general/graphviz.texi diff --git a/doc/ref/general/io.texi b/doc/ref/general/io.texi new file mode 100644 index 00000000..8c83ddcf --- /dev/null +++ b/doc/ref/general/io.texi @@ -0,0 +1,31 @@ +@node IO operations +@section IO + +Provided by module @code{(hnh util io)}. + +@defun open-input-port path +@defunx open-output-port path +Like @code{open-*-file}, but ``-'' gives @code{standard-@{input,output@}}. +@end defun + +@defun read-lines port +Return a list of all lines read from port. +@end defun + +@defun with-atomic-output-to-file filename thunk +Same functionality as the regular @var{with-output-to-file}, but +with the difference that either everything is written, or nothing +is written, and if anything is written it's all written atomicaly at +once (the original file will never contain an intermidiate state). +Does NOT handle race conditions between threads. + +propagates the return value of @var{thunk} upon successfully writing +the file, and @code{#f} otherwise. +@end defun + +@defun call-with-tmpfile proc [#:tmpl ``/tmp/file-XXXXXXX''] +@end defun + +@defun read-file path +Open file at path, and return its content as a string. +@end defun diff --git a/doc/ref/guile/srfi-41.texi b/doc/ref/general/srfi-41.texi index d8020ecc..d8020ecc 100644 --- a/doc/ref/guile/srfi-41.texi +++ b/doc/ref/general/srfi-41.texi diff --git a/doc/ref/guile/util-config.texi b/doc/ref/general/util-config.texi index 2e197bcc..2e197bcc 100644 --- a/doc/ref/guile/util-config.texi +++ b/doc/ref/general/util-config.texi diff --git a/doc/ref/guile/util-exceptions.texi b/doc/ref/general/util-exceptions.texi index 34ba33f9..34ba33f9 100644 --- a/doc/ref/guile/util-exceptions.texi +++ b/doc/ref/general/util-exceptions.texi diff --git a/doc/ref/guile/util-path.texi b/doc/ref/general/util-path.texi index 384915ef..384915ef 100644 --- a/doc/ref/guile/util-path.texi +++ b/doc/ref/general/util-path.texi diff --git a/doc/ref/guile/util.texi b/doc/ref/general/util.texi index d4dce3a6..bae19987 100644 --- a/doc/ref/guile/util.texi +++ b/doc/ref/general/util.texi @@ -357,91 +357,3 @@ Port of Common Lisp's @code{begin1} form. Like @code{begin} runs each form in its body in order, but returns the first result instead of the last. @end defmac - -@node UUIDs -@section UUID generation - -Provided by module @code{(hnh util uuid)}. - -@defun uuid-v4 -Generates a UUID-v4 string. -@end defun - -@defun uuid -Generates an implementation defined (but guaranteed valid) UUID. -@end defun - -@deftp {parameter} seed -Guile parameter containing the seed used when generating UUID's in -this module. Only set this when you want non-random randomness. -@end deftp - -@node IO operations -@section IO - -Provided by module @code{(hnh util io)}. - -@defun open-input-port path -@defunx open-output-port path -Like @code{open-*-file}, but ``-'' gives @code{standard-@{input,output@}}. -@end defun - -@defun read-lines port -Return a list of all lines read from port. -@end defun - -@defun with-atomic-output-to-file filename thunk -Same functionality as the regular @var{with-output-to-file}, but -with the difference that either everything is written, or nothing -is written, and if anything is written it's all written atomicaly at -once (the original file will never contain an intermidiate state). -Does NOT handle race conditions between threads. - -propagates the return value of @var{thunk} upon successfully writing -the file, and @code{#f} otherwise. -@end defun - -@defun call-with-tmpfile proc [#:tmpl ``/tmp/file-XXXXXXX''] -@end defun - -@defun read-file path -Open file at path, and return its content as a string. -@end defun - -@node Binary Search Tree -@section Binary Search Tree - -A simple ``read only'' binary search tree. - -@defun make-tree pred? lst -Constructs a new tree. @var{pred?} should be a procedure taking the -first element of @var{lst}, along with each element, and should return -a boolean value indicating if the specific element should go in the -left or right subtree. (left subtree is ``truthy'' values). - -This operation is done recursively. -@end defun - -@defun tree-node tree -Return the value of a tree node. -@end defun - -@defun left-subtree tree -Return all ``truthy'' children of tree node. -@end defun - -@defun right-subtree tree -Return all ``falsy children of tree node. -@end defun - -@defun length-of-longest-branch tree -Get the depth of a tree. -@end defun - -@defun tree-map proc tree -Apply proc onto the value of every node in tree, keeping the structure -of the tree. - -@b{Note:} this can cause the tree to no longer be a binary search -tree, but simply a ``formless'' binary tree. -@end defun diff --git a/doc/ref/general/uuid.texi b/doc/ref/general/uuid.texi new file mode 100644 index 00000000..78674763 --- /dev/null +++ b/doc/ref/general/uuid.texi @@ -0,0 +1,17 @@ +@node UUIDs +@section UUID generation + +Provided by module @code{(hnh util uuid)}. + +@defun uuid-v4 +Generates a UUID-v4 string. +@end defun + +@defun uuid +Generates an implementation defined (but guaranteed valid) UUID. +@end defun + +@deftp {parameter} seed +Guile parameter containing the seed used when generating UUID's in +this module. Only set this when you want non-random randomness. +@end deftp diff --git a/doc/ref/guile/xdg-basedir.texi b/doc/ref/general/xdg-basedir.texi index 2d3b2972..2d3b2972 100644 --- a/doc/ref/guile/xdg-basedir.texi +++ b/doc/ref/general/xdg-basedir.texi diff --git a/doc/ref/guile/zic.texi b/doc/ref/general/zic.texi index 5af36fd3..5af36fd3 100644 --- a/doc/ref/guile/zic.texi +++ b/doc/ref/general/zic.texi diff --git a/doc/ref/guile/translation.texi b/doc/ref/guile/translation.texi deleted file mode 100644 index 0e710c47..00000000 --- a/doc/ref/guile/translation.texi +++ /dev/null @@ -1,31 +0,0 @@ -@node Translation -@section Translation - -Base for string translation in the application. Calp uses Guile's -built in gettext bindings. The text domain used is ``calp''. - -@defun translate str -@anchor{translate} -Translate a string from english into an (through enviroment) specified -target language. All newlines in the source string will be changed to -spaces. - -This procedure is both used as the ``backend'' for @ref{G_}, but also -for non-literal strings which should be translated. -@end defun - -@defun G_ msg ... -@anchor{G_} -The ``global'' binding indicating a string to be translated. - -All arguments must be strings, and will be concatenated before being -passed to @ref{translate} (meaning newlines will be ignored). -@end defun - -@defun yes-no-check string [locale=%global-locale] -Checks @var{string} if it's a yes or no response in the given -@var{locale}. - -Returns @code{'yes} or @code{'no}, or @code{#f} if the string couldn't -be parsed as a yes/no predicate in the current locale. -@end defun diff --git a/doc/ref/guile/vcomponent.texi b/doc/ref/guile/vcomponent.texi deleted file mode 100644 index a0f3438e..00000000 --- a/doc/ref/guile/vcomponent.texi +++ /dev/null @@ -1,117 +0,0 @@ -@node VComponent -@section (vcomponent) - -@defvr {Configuration Variable} calendar-files -List of filepaths -@end defvr - -@defvr {Configuration Variable} default-calendar -@end defvr - -@c ===== Concepts ===== - -@c - internal fields -@c DATA layout -@c how does multiple value work? - -@c ===== BASE ===== - -@deftp {Record Type} <vline> - -@c - key -@c - value -@c - parameters -@c - source - -@defun make-vline key value [ht=(make-hash-table)] -@var{ht} is the hash table storing the parameters, can be explicitly -given if need for optimizations arrises. -@end defun - -@defun vline? x -@end defun - -@defun vline-key vline -@end defun - -@deffn {Slot} vline-source vline -@end deffn - -@deffn {Slot} value vline -@end deffn - -@deffn {Slot} param vline key -@end deffn - -@defun delete-parameter! vline key -@end defun - -@defun parameters vline -Key a list of all parameters -@example -((key value) ...) -@end example -@end defun - -@end deftp - - -@deftp {Record Type} <vcomponent> - -@defun vcomponent? x -@end defun - -@defun make-vcomponent [type='VIRTUAL] -@end defun - -@defun children vcomponent -Returns all direct children of vcomponent, as a list of vcomponents. -@end defun - -@deffn {Slot} parent vcomonent -@end deffn - -@defun type vcomponent -Returns the type of this vcomponent, as a symbol. Probably one of -@code{VCALENDAR}, @code{VEVENT}, ... -@end defun - -@defun add-child! parent child -Adds child to the parents child list, but also updates the child to -have parent in its parent slot -@end defun - -@deffn {Prop} prop* vcomponent key -@deffnx {Prop} prop vcomponent key -@var{prop*} return the vline object, while @var{prop} is equivalent to -@lisp -(value (prop* vcomponent key)) -@end lisp -@end deffn - -@defun {(extract field)} vcomponent -@defunx {(extract* field)} vcomponent -Curried version of @var{prop}. -@end defun - -@defun delete-property! component key -@end defun - -@defun properties comopnent -@example -((key . value) ...) -@end example -@end defun - -@end deftp - -@defun copy-vcomponent vcomponent -@end defun - - -@defun x-property? symb -Does symbol start with ``X-''? -@end defun - -@defun internal-field? symb [prefix="-"] -@end defun diff --git a/doc/ref/vcomponent.texi b/doc/ref/vcomponent.texi index 0aa7806c..983a75e2 100644 --- a/doc/ref/vcomponent.texi +++ b/doc/ref/vcomponent.texi @@ -1,4 +1,117 @@ @node VComponents @chapter VComponents -@include guile/vcomponent.texi +@defvr {Configuration Variable} calendar-files +List of filepaths +@end defvr + +@defvr {Configuration Variable} default-calendar +@end defvr + +@c ===== Concepts ===== + +@c - internal fields +@c DATA layout +@c how does multiple value work? + +@c ===== BASE ===== + +@deftp {Record Type} <vline> + +@c - key +@c - value +@c - parameters +@c - source + +@defun make-vline key value [ht=(make-hash-table)] +@var{ht} is the hash table storing the parameters, can be explicitly +given if need for optimizations arrises. +@end defun + +@defun vline? x +@end defun + +@defun vline-key vline +@end defun + +@deffn {Slot} vline-source vline +@end deffn + +@deffn {Slot} value vline +@end deffn + +@deffn {Slot} param vline key +@end deffn + +@defun delete-parameter! vline key +@end defun + +@defun parameters vline +Key a list of all parameters +@example +((key value) ...) +@end example +@end defun + +@end deftp + + +@deftp {Record Type} <vcomponent> + +@defun vcomponent? x +@end defun + +@defun make-vcomponent [type='VIRTUAL] +@end defun + +@defun children vcomponent +Returns all direct children of vcomponent, as a list of vcomponents. +@end defun + +@deffn {Slot} parent vcomonent +@end deffn + +@defun type vcomponent +Returns the type of this vcomponent, as a symbol. Probably one of +@code{VCALENDAR}, @code{VEVENT}, ... +@end defun + +@defun add-child! parent child +Adds child to the parents child list, but also updates the child to +have parent in its parent slot +@end defun + +@deffn {Prop} prop* vcomponent key +@deffnx {Prop} prop vcomponent key +@var{prop*} return the vline object, while @var{prop} is equivalent to +@lisp +(value (prop* vcomponent key)) +@end lisp +@end deffn + +@defun {(extract field)} vcomponent +@defunx {(extract* field)} vcomponent +Curried version of @var{prop}. +@end defun + +@defun delete-property! component key +@end defun + +@defun properties comopnent +@example +((key . value) ...) +@end example +@end defun + +@end deftp + +@defun copy-vcomponent vcomponent +@end defun + + +@defun x-property? symb +Does symbol start with ``X-''? +@end defun + +@defun internal-field? symb [prefix="-"] +@end defun diff --git a/doc/ref/vulgar.texi b/doc/ref/vulgar.texi index e98daaa0..70101aab 100644 --- a/doc/ref/vulgar.texi +++ b/doc/ref/vulgar.texi @@ -23,239 +23,5 @@ Runs @var{thunk} with The thunk is properly prepared on non-local entrances and exits. @end defun -@node Color -@section Color - -@defvar STR-RESET -ANSI escape sequence for removing all current formatting, as a string. -@end defvar - -@defmac color-if predicate color body ... -@code{(begin body ...)} is run, coloring it's return value using the -ANSI escape sequence @var{color}, if @var{predicate} is true, and -uncolored otherwise. -@end defmac - -@defun color-escape n -Generates an RGB color escape code. @var{n} can either be @code{#f}, -in which case the empty string is returned, or a a 24 bit color code -encoded hexadecimaly as @samp{#RRGGBB}. -@end defun - -@node Termios -@section Termios - -Interface to termios procedures. See termios(3) and @code{termios.h} -for general information. - -@code{(vulgar termios)} - -Refer to termios(3) for deeper information about all these fields. - -@deftp {Record Type} <termios> -See ``The termios structure'' in termios(3). -@defun make-termios -Create a new (empty) termios structure. -@end defun - -@defun cc termios -@defunx cflag termios -@defunx iflag termios -@defunx ispeed termios -@defunx lflag termios -@defunx line termios -@defunx oflag termios -@defunx ospeed termios -Accessors to termios each field. -@end defun -@end deftp - -@defun copy-termios termios -Create a copy of the given termios structure. -@end defun - -@defun tcsetattr! termios [port] [when=TCSANOW] -Updates @var{port} with flags from @var{termios}. -@end defun - -@defun tcgetattr! termios [port=(current-input-port)] -Gets termios information about @var{port}, and stores it in @var{termios}. -@end defun - -@defun cfmakeraw! termios -Calls the termios function @code{cfmakeraw} on @var{termios}, updating -the structure. -@end defun - - -@defvar TOSTOP -@defvarx NLDLY -@defvarx CREAD -@defvarx VSTOP -@defvarx B1500000 -@defvarx B4000000 -@defvarx B150 -@defvarx VEOL -@defvarx VQUIT -@defvarx CSTART -@defvarx CBAUD -@defvarx CR0 -@defvarx OLCUC -@defvarx CSTATUS -@defvarx VSTART -@defvarx IXANY -@defvarx ONOCR -@defvarx VERASE -@defvarx TTYDEF_IFLAG -@defvarx B1000000 -@defvarx NL0 -@defvarx FLUSHO -@defvarx TABDLY -@defvarx CDSUSP -@defvarx CEOL -@defvarx CIBAUD -@defvarx TAB3 -@defvarx CR2 -@defvarx NL1 -@defvarx CS8 -@defvarx CERASE -@defvarx OPOST -@defvarx TTYDEF_SPEED -@defvarx TAB1 -@defvarx EXTA -@defvarx B1200 -@defvarx TAB0 -@defvarx B75 -@defvarx EXTB -@defvarx FF1 -@defvarx CR1 -@defvarx CS5 -@defvarx INPCK -@defvarx B576000 -@defvarx B3000000 -@defvarx OCRNL -@defvarx TCOON -@defvarx CBAUDEX -@defvarx CCEQ -@defvarx IXOFF -@defvarx CREPRINT -@defvarx FF0 -@defvarx ECHONL -@defvarx IXON -@defvarx ISTRIP -@defvarx CSTOP -@defvarx PENDIN -@defvarx BRKINT -@defvarx IEXTEN -@defvarx TCIFLUSH -@defvarx VSUSP -@defvarx B38400 -@defvarx TCION -@defvarx B921600 -@defvarx ECHOPRT -@defvarx CQUIT -@defvarx IMAXBEL -@defvarx CRTSCTS -@defvarx ECHOCTL -@defvarx CEOT -@defvarx VMIN -@defvarx ICANON -@defvarx ONLRET -@defvarx VINTR -@defvarx CSTOPB -@defvarx B3500000 -@defvarx B230400 -@defvarx CS7 -@defvarx TCOFLUSH -@defvarx TIOCSER_TEMT -@defvarx B200 -@defvarx CSUSP -@defvarx BS1 -@defvarx XTABS -@defvarx CLNEXT -@defvarx VT0 -@defvarx NCCS -@defvarx BSDLY -@defvarx B9600 -@defvarx ECHOKE -@defvarx VEOF -@defvarx TTYDEF_OFLAG -@defvarx VTDLY -@defvarx VT1 -@defvarx CTRL -@defvarx NOFLSH -@defvarx VREPRINT -@defvarx ICRNL -@defvarx CINTR -@defvarx ADDRB -@defvarx B2500000 -@defvarx EXTPROC -@defvarx B110 -@defvarx XCASE -@defvarx ECHOE -@defvarx IUTF8 -@defvarx CS6 -@defvarx CFLUSH -@defvarx B500000 -@defvarx CKILL -@defvarx CDISCARD -@defvarx VDISCARD -@defvarx B2400 -@defvarx TTYDEF_CFLAG -@defvarx VWERASE -@defvarx INLCR -@defvarx ONLCR -@defvarx OFDEL -@defvarx B1800 -@defvarx ISIG -@defvarx IGNPAR -@defvarx TAB2 -@defvarx CTIME -@defvarx B1152000 -@defvarx ECHO -@defvarx CR3 -@defvarx CMSPAR -@defvarx PARENB -@defvarx B2000000 -@defvarx VKILL -@defvarx B4800 -@defvarx CLOCAL -@defvarx IGNBRK -@defvarx BS0 -@defvarx TCSAFLUSH -@defvarx B19200 -@defvarx TCSANOW -@defvarx VTIME -@defvarx B0 -@defvarx TCOOFF -@defvarx CEOF -@defvarx B460800 -@defvarx PARMRK -@defvarx VEOL2 -@defvarx FFDLY -@defvarx TCSADRAIN -@defvarx IGNCR -@defvarx CRDLY -@defvarx VLNEXT -@defvarx PARODD -@defvarx CRPRNT -@defvarx B600 -@defvarx VSWTC -@defvarx IUCLC -@defvarx HUPCL -@defvarx B50 -@defvarx TCIOFF -@defvarx TTYDEF_LFLAG -@defvarx CBRK -@defvarx ECHOK -@defvarx B115200 -@defvarx CSIZE -@defvarx B300 -@defvarx OFILL -@defvarx CWERASE -@defvarx B134 -@defvarx B57600 -@defvarx TCIOFLUSH -@defvarx CMIN -Imported from the ``termios.h'' header file. -@end defvar +@include vulgar/color.texi +@include vulgar/termios.texi diff --git a/doc/ref/vulgar/color.texi b/doc/ref/vulgar/color.texi new file mode 100644 index 00000000..611f4c54 --- /dev/null +++ b/doc/ref/vulgar/color.texi @@ -0,0 +1,18 @@ +@node Color +@section Color + +@defvar STR-RESET +ANSI escape sequence for removing all current formatting, as a string. +@end defvar + +@defmac color-if predicate color body ... +@code{(begin body ...)} is run, coloring it's return value using the +ANSI escape sequence @var{color}, if @var{predicate} is true, and +uncolored otherwise. +@end defmac + +@defun color-escape n +Generates an RGB color escape code. @var{n} can either be @code{#f}, +in which case the empty string is returned, or a a 24 bit color code +encoded hexadecimaly as @samp{#RRGGBB}. +@end defun diff --git a/doc/ref/vulgar/termios.texi b/doc/ref/vulgar/termios.texi new file mode 100644 index 00000000..58a83e61 --- /dev/null +++ b/doc/ref/vulgar/termios.texi @@ -0,0 +1,217 @@ +@node Termios +@section Termios + +Interface to termios procedures. See termios(3) and @code{termios.h} +for general information. + +@code{(vulgar termios)} + +Refer to termios(3) for deeper information about all these fields. + +@deftp {Record Type} <termios> +See ``The termios structure'' in termios(3). +@defun make-termios +Create a new (empty) termios structure. +@end defun + +@defun cc termios +@defunx cflag termios +@defunx iflag termios +@defunx ispeed termios +@defunx lflag termios +@defunx line termios +@defunx oflag termios +@defunx ospeed termios +Accessors to termios each field. +@end defun +@end deftp + +@defun copy-termios termios +Create a copy of the given termios structure. +@end defun + +@defun tcsetattr! termios [port] [when=TCSANOW] +Updates @var{port} with flags from @var{termios}. +@end defun + +@defun tcgetattr! termios [port=(current-input-port)] +Gets termios information about @var{port}, and stores it in @var{termios}. +@end defun + +@defun cfmakeraw! termios +Calls the termios function @code{cfmakeraw} on @var{termios}, updating +the structure. +@end defun + + +@defvar TOSTOP +@defvarx NLDLY +@defvarx CREAD +@defvarx VSTOP +@defvarx B1500000 +@defvarx B4000000 +@defvarx B150 +@defvarx VEOL +@defvarx VQUIT +@defvarx CSTART +@defvarx CBAUD +@defvarx CR0 +@defvarx OLCUC +@defvarx CSTATUS +@defvarx VSTART +@defvarx IXANY +@defvarx ONOCR +@defvarx VERASE +@defvarx TTYDEF_IFLAG +@defvarx B1000000 +@defvarx NL0 +@defvarx FLUSHO +@defvarx TABDLY +@defvarx CDSUSP +@defvarx CEOL +@defvarx CIBAUD +@defvarx TAB3 +@defvarx CR2 +@defvarx NL1 +@defvarx CS8 +@defvarx CERASE +@defvarx OPOST +@defvarx TTYDEF_SPEED +@defvarx TAB1 +@defvarx EXTA +@defvarx B1200 +@defvarx TAB0 +@defvarx B75 +@defvarx EXTB +@defvarx FF1 +@defvarx CR1 +@defvarx CS5 +@defvarx INPCK +@defvarx B576000 +@defvarx B3000000 +@defvarx OCRNL +@defvarx TCOON +@defvarx CBAUDEX +@defvarx CCEQ +@defvarx IXOFF +@defvarx CREPRINT +@defvarx FF0 +@defvarx ECHONL +@defvarx IXON +@defvarx ISTRIP +@defvarx CSTOP +@defvarx PENDIN +@defvarx BRKINT +@defvarx IEXTEN +@defvarx TCIFLUSH +@defvarx VSUSP +@defvarx B38400 +@defvarx TCION +@defvarx B921600 +@defvarx ECHOPRT +@defvarx CQUIT +@defvarx IMAXBEL +@defvarx CRTSCTS +@defvarx ECHOCTL +@defvarx CEOT +@defvarx VMIN +@defvarx ICANON +@defvarx ONLRET +@defvarx VINTR +@defvarx CSTOPB +@defvarx B3500000 +@defvarx B230400 +@defvarx CS7 +@defvarx TCOFLUSH +@defvarx TIOCSER_TEMT +@defvarx B200 +@defvarx CSUSP +@defvarx BS1 +@defvarx XTABS +@defvarx CLNEXT +@defvarx VT0 +@defvarx NCCS +@defvarx BSDLY +@defvarx B9600 +@defvarx ECHOKE +@defvarx VEOF +@defvarx TTYDEF_OFLAG +@defvarx VTDLY +@defvarx VT1 +@defvarx CTRL +@defvarx NOFLSH +@defvarx VREPRINT +@defvarx ICRNL +@defvarx CINTR +@defvarx ADDRB +@defvarx B2500000 +@defvarx EXTPROC +@defvarx B110 +@defvarx XCASE +@defvarx ECHOE +@defvarx IUTF8 +@defvarx CS6 +@defvarx CFLUSH +@defvarx B500000 +@defvarx CKILL +@defvarx CDISCARD +@defvarx VDISCARD +@defvarx B2400 +@defvarx TTYDEF_CFLAG +@defvarx VWERASE +@defvarx INLCR +@defvarx ONLCR +@defvarx OFDEL +@defvarx B1800 +@defvarx ISIG +@defvarx IGNPAR +@defvarx TAB2 +@defvarx CTIME +@defvarx B1152000 +@defvarx ECHO +@defvarx CR3 +@defvarx CMSPAR +@defvarx PARENB +@defvarx B2000000 +@defvarx VKILL +@defvarx B4800 +@defvarx CLOCAL +@defvarx IGNBRK +@defvarx BS0 +@defvarx TCSAFLUSH +@defvarx B19200 +@defvarx TCSANOW +@defvarx VTIME +@defvarx B0 +@defvarx TCOOFF +@defvarx CEOF +@defvarx B460800 +@defvarx PARMRK +@defvarx VEOL2 +@defvarx FFDLY +@defvarx TCSADRAIN +@defvarx IGNCR +@defvarx CRDLY +@defvarx VLNEXT +@defvarx PARODD +@defvarx CRPRNT +@defvarx B600 +@defvarx VSWTC +@defvarx IUCLC +@defvarx HUPCL +@defvarx B50 +@defvarx TCIOFF +@defvarx TTYDEF_LFLAG +@defvarx CBRK +@defvarx ECHOK +@defvarx B115200 +@defvarx CSIZE +@defvarx B300 +@defvarx OFILL +@defvarx CWERASE +@defvarx B134 +@defvarx B57600 +@defvarx TCIOFLUSH +@defvarx CMIN +Imported from the ``termios.h'' header file. +@end defvar diff --git a/doc/ref/web.texi b/doc/ref/web.texi index 342b6852..e3c73f44 100644 --- a/doc/ref/web.texi +++ b/doc/ref/web.texi @@ -1,4 +1,4 @@ @node Webservers and -Clients @chapter Webservers and -Clients -@include guile/web.texi +@include web/web.texi diff --git a/doc/ref/guile/web.texi b/doc/ref/web/web.texi index 69ab726f..69ab726f 100644 --- a/doc/ref/guile/web.texi +++ b/doc/ref/web/web.texi |