Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the cl-libyaml Reference Manual, version 0.1, generated automatically by Declt version 3.0 "Montgomery Scott" on Thu Mar 11 12:16:37 2021 GMT+0.
• Introduction | What cl-libyaml is all about | |
• Systems | The systems documentation | |
• Modules | The modules documentation | |
• Files | The files documentation | |
• Packages | The packages documentation | |
• Definitions | The symbols documentation | |
• Indexes | Concepts, functions, variables and data types |
A binding to the libyaml library.
This is a home-spun binding to the libyaml library. It's not meant as a full library for YAML, just a bare binding with a couple of utility macros. For a YAML parser and emitter using this, check out cl-yaml.
The naming convention is what you'd expect: Function and type names have dashes
instead of underscoes, the yaml_
prefix on every symbol has been removed, and
instead you have package prefixes, but the trailing _t
after every type
definition has been kept, to make it easier to tell symbols that denote types
from symbols that denote structure fields or functions.
For example, yaml_event_t
is libyaml.event:event-t
, and yaml_parser_parse
is libyaml.parser:parser-parse
.
Enum values like YAML_PARSE_FLOW_NODE_STATE
are keywords with the YAML_
prefix removed, as in :parse-flow-node-state
.
(defpackage yaml-example
(:use :cl)
(:import-from :libyaml.macros
:with-parser
:with-event)
(:import-from :libyaml.event
:event-type))
(in-package :yaml-example)
(defun parse (string)
(with-parser (parser string)
(with-event (event)
(loop do
(when (libyaml.parser:parse parser event)
(let ((type (event-type event)))
(print type)
(when (eql type :stream-end-event)
(return-from parse nil))))))))
YAML-EXAMPLE> (parse "[1,2,3]")
:STREAM-START-EVENT
:DOCUMENT-START-EVENT
:SEQUENCE-START-EVENT
:SCALAR-EVENT
:SCALAR-EVENT
:SCALAR-EVENT
:SEQUENCE-END-EVENT
:DOCUMENT-END-EVENT
:STREAM-END-EVENT
NIL
Copyright (c) 2015–2016 Fernando Borretti
Licensed under the MIT License
Next: Modules, Previous: Introduction, Up: Top [Contents][Index]
The main system appears first, followed by any subsystem dependency.
• The cl-libyaml system |
Fernando Borretti <eudoxiahp@gmail.com>
Fernando Borretti <eudoxiahp@gmail.com>
(:git "git@github.com:eudoxia0/cl-libyaml.git")
MIT
A binding to the libyaml library.
# cl-libyaml
[](https://travis-ci.org/eudoxia0/cl-libyaml)
[](http://quickdocs.org/cl-libyaml/)
A binding to the [libyaml][lyaml] library.
# Overview
This is a home-spun binding to the libyaml library. It’s not meant as a full
library for YAML, just a bare binding with a couple of utility macros. For a
YAML parser and emitter using this, check out [cl-yaml][cl-yaml].
## Naming Convention
The naming convention is what you’d expect: Function and type names have dashes
instead of underscoes, the ‘yaml_‘ prefix on every symbol has been removed, and
instead you have package prefixes, but the trailing ‘_t‘ after every type
definition has been kept, to make it easier to tell symbols that denote types
from symbols that denote structure fields or functions.
For example, ‘yaml_event_t‘ is ‘libyaml.event:event-t‘, and ‘yaml_parser_parse‘
is ‘libyaml.parser:parser-parse‘.
Enum values like ‘YAML_PARSE_FLOW_NODE_STATE‘ are keywords with the ‘YAML_‘
prefix removed, as in ‘:parse-flow-node-state‘.
# Usage
“‘lisp
(defpackage yaml-example
(:use :cl)
(:import-from :libyaml.macros
:with-parser
:with-event)
(:import-from :libyaml.event
:event-type))
(in-package :yaml-example)
(defun parse (string)
(with-parser (parser string)
(with-event (event)
(loop do
(when (libyaml.parser:parse parser event)
(let ((type (event-type event)))
(print type)
(when (eql type :stream-end-event)
(return-from parse nil))))))))
“‘
“‘lisp
YAML-EXAMPLE> (parse "[1,2,3]")
:STREAM-START-EVENT
:DOCUMENT-START-EVENT
:SEQUENCE-START-EVENT
:SCALAR-EVENT
:SCALAR-EVENT
:SCALAR-EVENT
:SEQUENCE-END-EVENT
:DOCUMENT-END-EVENT
:STREAM-END-EVENT
NIL
“‘
[lyaml]: http://pyyaml.org/wiki/LibYAML
[cl-yaml]: https://github.com/eudoxia0/cl-yaml
# License
Copyright (c) 2015–2016 Fernando Borretti
Licensed under the MIT License.
0.1
cffi
cl-libyaml.asd (file)
src (module)
Modules are listed depth-first from the system components tree.
• The cl-libyaml/src module |
cl-libyaml (system)
src/
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files |
Next: The cl-libyaml/src/library․lisp file, Previous: Lisp files, Up: Lisp files [Contents][Index]
cl-libyaml.asd
cl-libyaml (system)
Next: The cl-libyaml/src/version․lisp file, Previous: The cl-libyaml․asd file, Up: Lisp files [Contents][Index]
src (module)
src/library.lisp
Next: The cl-libyaml/src/util․lisp file, Previous: The cl-libyaml/src/library․lisp file, Up: Lisp files [Contents][Index]
library.lisp (file)
src (module)
src/version.lisp
version-directive-t-tclass (class)
Next: The cl-libyaml/src/basic-types․lisp file, Previous: The cl-libyaml/src/version․lisp file, Up: Lisp files [Contents][Index]
version.lisp (file)
src (module)
src/util.lisp
define-size-t (macro)
Next: The cl-libyaml/src/style․lisp file, Previous: The cl-libyaml/src/util․lisp file, Up: Lisp files [Contents][Index]
util.lisp (file)
src (module)
src/basic-types.lisp
Next: The cl-libyaml/src/node․lisp file, Previous: The cl-libyaml/src/basic-types․lisp file, Up: Lisp files [Contents][Index]
basic-types.lisp (file)
src (module)
src/style.lisp
Next: The cl-libyaml/src/token․lisp file, Previous: The cl-libyaml/src/style․lisp file, Up: Lisp files [Contents][Index]
style.lisp (file)
src (module)
src/node.lisp
Next: The cl-libyaml/src/event․lisp file, Previous: The cl-libyaml/src/node․lisp file, Up: Lisp files [Contents][Index]
node.lisp (file)
src (module)
src/token.lisp
Next: The cl-libyaml/src/document․lisp file, Previous: The cl-libyaml/src/token․lisp file, Up: Lisp files [Contents][Index]
token.lisp (file)
src (module)
src/event.lisp
Next: The cl-libyaml/src/parser․lisp file, Previous: The cl-libyaml/src/event․lisp file, Up: Lisp files [Contents][Index]
event.lisp (file)
src (module)
src/document.lisp
Next: The cl-libyaml/src/emitter․lisp file, Previous: The cl-libyaml/src/document․lisp file, Up: Lisp files [Contents][Index]
document.lisp (file)
src (module)
src/parser.lisp
Next: The cl-libyaml/src/write-handler․lisp file, Previous: The cl-libyaml/src/parser․lisp file, Up: Lisp files [Contents][Index]
parser.lisp (file)
src (module)
src/emitter.lisp
Next: The cl-libyaml/src/macros․lisp file, Previous: The cl-libyaml/src/emitter․lisp file, Up: Lisp files [Contents][Index]
emitter.lisp (file)
src (module)
src/write-handler.lisp
strlen (function)
Previous: The cl-libyaml/src/write-handler․lisp file, Up: Lisp files [Contents][Index]
write-handler.lisp (file)
src (module)
src/macros.lisp
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
Next: The libyaml․version package, Previous: Packages, Up: Packages [Contents][Index]
Load the libyaml library.
library.lisp (file)
Next: The libyaml․util package, Previous: The libyaml․lib package, Up: Packages [Contents][Index]
Stuff for dealing with version information.
version.lisp (file)
version-directive-t-tclass (class)
Next: The libyaml․basic package, Previous: The libyaml․version package, Up: Packages [Contents][Index]
FFI utilities.
util.lisp (file)
define-size-t (macro)
Next: The libyaml․style package, Previous: The libyaml․util package, Up: Packages [Contents][Index]
Basic data types used throughout libyaml.
basic-types.lisp (file)
Next: The libyaml․node package, Previous: The libyaml․basic package, Up: Packages [Contents][Index]
Style information for various libyaml structures.
style.lisp (file)
Next: The libyaml․token package, Previous: The libyaml․style package, Up: Packages [Contents][Index]
LibYAML nodes.
node.lisp (file)
Next: The libyaml․event package, Previous: The libyaml․node package, Up: Packages [Contents][Index]
Tokens are produced by parsing.
token.lisp (file)
Next: The libyaml․document package, Previous: The libyaml․token package, Up: Packages [Contents][Index]
Events are produced by parsers, and are an alternative to token-based parsing.
event.lisp (file)
Next: The libyaml․parser package, Previous: The libyaml․event package, Up: Packages [Contents][Index]
Bindings to the document data structure.
document.lisp (file)
Next: The libyaml․emitter package, Previous: The libyaml․document package, Up: Packages [Contents][Index]
The libyaml parser.
parser.lisp (file)
Next: The libyaml․write-handler package, Previous: The libyaml․parser package, Up: Packages [Contents][Index]
The libyaml emitter. This package is incomplete.
emitter.lisp (file)
Next: The libyaml․macros package, Previous: The libyaml․emitter package, Up: Packages [Contents][Index]
write-handler.lisp (file)
common-lisp
strlen (function)
Previous: The libyaml․write-handler package, Up: Packages [Contents][Index]
Some macros to simplify managing foreign objects.
macros.lisp (file)
common-lisp
Definitions are sorted by export status, category, package, and then by lexicographic order.
• Exported definitions | ||
• Internal definitions |
Next: Internal definitions, Previous: Definitions, Up: Definitions [Contents][Index]
• Exported special variables | ||
• Exported macros | ||
• Exported functions |
Next: Exported macros, Previous: Exported definitions, Up: Exported definitions [Contents][Index]
Function pointer to write-handler
write-handler.lisp (file)
Stream that write-handler will output to
write-handler.lisp (file)
Next: Exported functions, Previous: Exported special variables, Up: Exported definitions [Contents][Index]
Allocate event, execute body, then free it.
macros.lisp (file)
Create a parser using input-string as the YAML input, execute body, then free the parser.
macros.lisp (file)
Previous: Exported macros, Up: Exported definitions [Contents][Index]
document.lisp (file)
emitter.lisp (file)
Return a pointer to an event.
event.lisp (file)
parser.lisp (file)
Allocate a token.
token.lisp (file)
version.lisp (file)
Delete a YAML document and all its nodes.
document.lisp (file)
Create the DOCUMENT-END event.
emitter.lisp (file)
Create the DOCUMENT-START event.
emitter.lisp (file)
Emit an event.
emitter.lisp (file)
Finish a YAML stream.
emitter.lisp (file)
Destroy an emitter.
emitter.lisp (file)
Exit a YAML document.
emitter.lisp (file)
Flush the accumulated characters to the output.
emitter.lisp (file)
Initialize an emitter.
emitter.lisp (file)
Start a YAML stream.
emitter.lisp (file)
Return the column where the error happened.
parser.lisp (file)
Return the line where the current error happened.
parser.lisp (file)
Return the current error message.
parser.lisp (file)
event.lisp (file)
Free any memory allocated for an event object.
event.lisp (file)
event.lisp (file)
event.lisp (file)
event.lisp (file)
The event’s type.
event.lisp (file)
Get the library version as a string.
version.lisp (file)
Initialize a parser.
parser.lisp (file)
emitter.lisp (file)
emitter.lisp (file)
The column number of a mark.
basic-types.lisp (file)
The line number of a mark.
basic-types.lisp (file)
Parse the input stream and produce the next parsing event.
parser.lisp (file)
Destroy a parser.
parser.lisp (file)
Return the current error type.
parser.lisp (file)
Parse the input stream and produce the next YAML document.
parser.lisp (file)
emitter.lisp (file)
Scan the input stream and produce the next token.
parser.lisp (file)
emitter.lisp (file)
emitter.lisp (file)
Set the source encoding.
parser.lisp (file)
Set a generic input handler.
parser.lisp (file)
Set a file input.
parser.lisp (file)
Set a string input.
parser.lisp (file)
Set a generic output handler.
emitter.lisp (file)
Set a file output.
emitter.lisp (file)
Set a string output.
emitter.lisp (file)
Create a STREAM-END event.
emitter.lisp (file)
Create a STREAM-START event.
emitter.lisp (file)
Free any memory allocated for a token object.
token.lisp (file)
Return the type of the token.
token.lisp (file)
Previous: Exported definitions, Up: Definitions [Contents][Index]
• Internal macros | ||
• Internal functions | ||
• Internal classes |
Next: Internal functions, Previous: Internal definitions, Up: Internal definitions [Contents][Index]
Define size_t according to the architecture.
util.lisp (file)
Next: Internal classes, Previous: Internal macros, Up: Internal definitions [Contents][Index]
Create an ALIAS event.
emitter.lisp (file)
event.lisp (file)
event.lisp (file)
event.lisp (file)
Calculate the length of a string
write-handler.lisp (file)
event.lisp (file)
Previous: Internal functions, Up: Internal definitions [Contents][Index]
parser.lisp (file)
token.lisp (file)
event.lisp (file)
parser.lisp (file)
emitter.lisp (file)
emitter.lisp (file)
token.lisp (file)
emitter.lisp (file)
event.lisp (file)
event.lisp (file)
document.lisp (file)
emitter.lisp (file)
emitter.lisp (file)
emitter.lisp (file)
event.lisp (file)
parser.lisp (file)
emitter.lisp (file)
node.lisp (file)
event.lisp (file)
node.lisp (file)
basic-types.lisp (file)
node.lisp (file)
document.lisp (file)
emitter.lisp (file)
node.lisp (file)
node.lisp (file)
parser.lisp (file)
parser.lisp (file)
parser.lisp (file)
parser.lisp (file)
parser.lisp (file)
parser.lisp (file)
emitter.lisp (file)
emitter.lisp (file)
node.lisp (file)
token.lisp (file)
event.lisp (file)
event.lisp (file)
node.lisp (file)
parser.lisp (file)
parser.lisp (file)
token.lisp (file)
event.lisp (file)
emitter.lisp (file)
basic-types.lisp (file)
token.lisp (file)
event.lisp (file)
document.lisp (file)
parser.lisp (file)
emitter.lisp (file)
token.lisp (file)
parser.lisp (file)
token.lisp (file)
version.lisp (file)
basic-types.lisp (file)
token.lisp (file)
Previous: Definitions, Up: Top [Contents][Index]
• Concept index | ||
• Function index | ||
• Variable index | ||
• Data type index |
Next: Function index, Previous: Indexes, Up: Indexes [Contents][Index]
Jump to: | C F L M |
---|
Jump to: | C F L M |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
Jump to: | A D E F G I M P S T U W |
---|
Jump to: | A D E F G I M P S T U W |
---|
Next: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Jump to: | *
S |
---|
Jump to: | *
S |
---|
Previous: Variable index, Up: Indexes [Contents][Index]
Jump to: | A B C D E I L M N O P R S T V |
---|
Jump to: | A B C D E I L M N O P R S T V |
---|