YAML::LibYAML::API(3)

πŸ“¦
version 0.14.0 Β· 3 versions
, in opensuse-leap 16.0

πŸ’– NAME πŸ’–

okay bestie, this is YAML::LibYAML::API(3) β€” yes, the manual page, from the User Contributed Perl Documentation pile πŸ’…. It's a wrapper around the C libyaml library, and we're gonna get you comfy with it.

✨ SYNOPSIS ✨

copy this vibe exactly, no edits, periodt:

use YAML::LibYAML::API::XS;

my $version = YAML::LibYAML::API::XS::libyaml_version();

my $yaml = <<'EOM';
# An example of various kinds of events
---
foo: &ALIAS bar
'alias': *ALIAS
tag: !!int 23
list:
- "doublequoted"
- >
  folded
- |-
  literal
EOM

# parse
my $events = [];
YAML::LibYAML::API::XS::parse_string_events($yaml, $events);
# or:
YAML::LibYAML::API::XS::parse_file_events($filename, $events);
YAML::LibYAML::API::XS::parse_filehandle_events($fh, $events);

# emit
my $yaml = YAML::LibYAML::API::XS::emit_string_events($events, {
    indent => 2,
    width => 80,
    unicode => 1, # emit unicode
});
# or:
my $options = {
    indent => 2,
    width => 80,
};
YAML::LibYAML::API::XS::emit_file_events($filename, $events, $options);
YAML::LibYAML::API::XS::emit_filehandle_events($fh, $events, $options);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so YAML::LibYAML::API is literally a thin wrapper around the C libyaml API. Currently it provides functions for parsing and emitting events β€” that's the whole main-character energy right now ✨.

libyaml also provides a loader/dumper API to load/dump YAML into a list of nodes. There's no wrapper for these functions yet β€” so don't go looking for one, bestie 😭.

⚠️ no cap: this is just one of the first releases. The function names will eventually be changed. Don't get too attached πŸ’€.

The sources of "libyaml-dev" are included in this distribution. You can build this module with the system libyaml instead, if you remove the libyaml sources and call Makefile.PL with WITH_SYSTEM_LIBYAML=1 🫢.

🌈 SEE ALSO 🌈

πŸŽ€ AUTHOR πŸŽ€

Tina MΓΌller <tinita@cpan.org> πŸ’–

okay so here's the legal tea β˜• β€” keeping this exactly as written because license text is not the vibe to paraphrase:

Included libyaml: Copyright (c) 2017-2020 Ingy dΓΆt Net Copyright (c) 2006-2016 Kirill Simonov

Perl/XS binding: Copyright (c) 2022 by Tina MΓΌller.

This is free software, licensed under:

  The MIT (X11) License

The MIT License

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 "AS IS", 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.

xoxo, bestie πŸ’‹ β€” this page is from perl v5.42.0, dated 2024-01-05, and it's the YAML::LibYAML::API(3) manual. mwah 🫢

πŸ“¦ where this page comes from