Wiki
Download
Manual
Eggs
API
Tests
Bugs
show
edit
history
You can edit this page using
wiki syntax
for markup.
Article contents:
[[tags: egg]] == posix-utils [[toc:]] == Documentation Miscellaneous Posix related routines. === terminal-info <procedure>(terminal-info [PORT]) --> alist</procedure> Returns {{alist}} of terminal properties for {{PORT}}. : {{PORT}} ; {{output-port}} ; {{current-output-port}} Known terminal properties: : {{name}} ; {{string}} : {{width}} ; {{fixnum}} : {{height}} ; {{fixnum}} === get-terminal-size <procedure>(get-terminal-size [PORT]) --> (or false (list fixnum fixnum))</procedure> Returns terminal size or {{#f}} when {{PORT}} is not a {{terminal-port}}. : {{PORT}} ; {{output-port}} === get-terminal-name <procedure>(get-terminal-name [PORT]) --> (or false string)</procedure> Returns terminal name or {{#f}} when {{PORT}} is not a {{terminal-port}}. : {{PORT}} ; {{output-port}} === output-port-width <procedure>(output-port-width PORT [DEF]) --> fixnum</procedure> Returns terminal width or {{DEF}} when {{PORT}} is not a {{terminal-port}}. : {{PORT}} ; {{(or false output-port)}} ; {{current-output-port}} === output-port-height <procedure>(output-port-height PORT [DEF]) --> fixnum</procedure> Returns terminal height or {{DEF}} when {{PORT}} is not a {{terminal-port}}. : {{PORT}} ; {{(or false output-port)}} === string-trim-eol <procedure>(string-trim-eol STR) -> string</procedure> Removes last instance of the platform dependent EOL character sequence from the {{string}} {{STR}}. === software-eol-string <constant>software-eol-string</constant> Platform dependent EOL character sequence {{string}}. === environment-string <procedure>(environment-string CELL) -> string</procedure> Returns {{"VAR=VAL"}}, where {{VAR}} is {{(car CELL)}} & {{VAL}} is {{(cdr CELL)}}. === environment-variables->environment-list <procedure>(environment-variables->environment-list EVS) -> (list-of string)</procedure> Returns a list of {{"VAR=VAL"}} from the environment variables association-list {{EVS}}. === qs* <procedure>(qs* STR [DELIM #\"]) -> string</procedure> Result like {{(conc DELIM STR DELIM)}}. === qs-quote <procedure>(qs-quote OBJ) -> string</procedure> Returns {{"'OBJ'"}}. === qs-string <procedure>(qs-string OBJ) -> string</procedure> Returns {{""OBJ""}}. === qs-argument <procedure>(qs-argument OBJ [LITERAL? [DELIM #\"]]) -> string</procedure> Returns a ''quoted'', ''quasiquoted'', or ''evaluated'' shell argument string. An {{OBJ}} is ; '* (quote . *) : ''quoted'' {{*}} unless {{LITERAL?}} ; `* (quasiquote . *) : ''quasiquoted'' {{*}} unless {{LITERAL?}} ; * : ''evaluated'' A ''shell'' quote is ; ''quoted'' : {{' string '}} ; ''quasiquoted'' : {{` ,* (unquote *) | ,@* (unquote-splicing *) | * (quote) `}} ; ''evaluated'' : {{" string "}} A ''quasiquoted'' {{OBJ}} is ; ,* (unquote *) : ''evaluated'' * ; ,@* (unquote-splicing *) : ''evaluated'' * #\space ... ; * (quote) : ''quoted'' * === get-commandline-result <procedure>(get-commandline-result CMND LINE) -> string</procedure> Returns the result of {{''shell'' CMND LINE}}. {{CMND}} is a {{string}}. {{LINE}} is a {{string}}. === get-command-result <procedure>(get-command-result CMND ARG ...) -> string</procedure> Returns the result of {{''shell'' CMND ARG ...}}. {{CMND}} is a {{string}}. {{ARG ...}} are {{string ...}} & processed by {{qs-argument}}. === get-echo-result <procedure>(get-echo-result EXP) -> string</procedure> Returns the result of {{echo "EXP"}}, w/o the ''echo'' eol. {{EXP}} is a {{string}}. === environment-variable-bound? <procedure>(environment-variable-bound? NAME) -> (or false string)</procedure> Does the environment variable {{NAME}} exist with a non-null value? {{NAME}} is a {{string}}. <enscript language=scheme> FOO=1 BAR= csi -q -R posix-utils #;1> (environment-variable-bound? "FOO") #t #;2> (environment-variable-bound? "BAR") #f </enscript> === environment-variable-true? <procedure>(environment-variable-true? NAME [TRUTHS ("y" "yes" "1")]) -> boolean</procedure> Is the environment variable {{NAME}} lowercase value in {{TRUTHS}}? {{NAME}} is a {{string}}. {{TRUTHS}} is a {{(list-of string)}} recognized as true values. <enscript language=scheme> FOO=1 BAR= csi -q -R posix-utils #;1> (environment-variable-true? "FOO") #t #;2> (environment-variable-true? "BAR") #f </enscript> === register-environment-variable-feature! <procedure>(register-environment-variable-feature! NAME) -> (or false symbol)</procedure> Registers an existing {{NAME}} value as a {{feature}}. Returns {{#f}} or the registered feature {{symbol}}. {{NAME}} is a {{string}}. === get-shell-variable <procedure>(get-shell-variable NAME) -> string</procedure> Returns the shell variable {{NAME}} value. {{NAME}} is a {{string}}. === shell-variable-bound? <procedure>(shell-variable-bound? NAME) -> (or false string)</procedure> Does the shell variable {{NAME}} have a non-null value? {{NAME}} is a {{string}}. === shell-variable-true? <procedure>(shell-variable-true? NAME [TRUTHS ("y" "yes" "1")]) -> boolean</procedure> Is the shell variable {{NAME}} lowercase value in {{TRUTHS}}? {{NAME}} is a {{string}}. {{TRUTHS}} is a {{(list-of string)}} recognized as true values. === register-shell-variable-feature! <procedure>(register-shell-variable-feature! NAME) -> (or false symbol)</procedure> Registers an existing {{NAME}} value as a {{feature}}. Returns {{#f}} or the registered feature {{symbol}}. {{NAME}} is a {{string}}. <enscript language=scheme> #;1> (register-shell-variable-feature! "OSTYPE") darwin7 ;ymmv </enscript> == Usage <enscript language=scheme> (import posix-utils) </enscript> == Requirements [[srfi-1]] [[utf8]] [[check-errors]] == Author [[kon lovett]] == Repository This egg is hosted on the CHICKEN Subversion repository: [[https://anonymous@code.call-cc.org/svn/chicken-eggs/release/5/posix-utils|https://anonymous@code.call-cc.org/svn/chicken-eggs/release/5/posix-utils]] If you want to check out the source code repository of this egg and you are not familiar with Subversion, see [[/egg-svn-checkout|this page]]. == Version history ; 2.1.0 : Use {{utf8}}. ; 2.0.1 : Fix dependencies. ; 2.0.0 : C5 release. ; 1.2.2 : Remove {{fx-utils}} dependency. : 1.2.1 : Fix {{output-port-width}} & {{output-port-height}}. Add {{get-terminal-name}}. Change {{terminal-info}} alist. ; 1.2.0 : Added {{terminal-info}}, {{get-terminal-size}}, {{output-port-width}}, & {{output-port-height}}. ; 1.1.0 : Added {{string-trim-eol}} , {{software-eol-string}}, {{environment-variables->environment-list}}, {{register-environment-variable-feature!}}, {{get-shell-variable}}, {{shell-variable-bound?}}, {{shell-variable-true?}}, {{register-shell-variable-feature!}} ; 1.0.0 : Created. == License Copyright (C) 2010-2020 Kon Lovett. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Software), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ASIS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Description of your changes:
I would like to authenticate
Authentication
Username:
Password:
Spam control
What do you get when you subtract 20 from 1?