asoma.dev · the C reference for libose
libose
the C library every o.se host is built on
Loading...
Searching...
No Matches
ose_pprint.h File Reference

Rendering a bundle for a human to read. More...

#include "ose.h"
Include dependency graph for ose_pprint.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int32_t ose_pprintPayloadItem_hook (ose_bundle bundle, const char typetag, const int32_t msg_offset, const int32_t item_offset)
int32_t ose_pprintBundleElem_msg (ose_bundle bundle, int32_t offset, char *buf, int32_t buflen, int32_t indent)
int32_t ose_pprintBundle (ose_bundle bundle, char *buf, int32_t buflen)
int32_t ose_pprintFullBundle_impl (ose_bundle bundle, char *buf, int32_t buflen, const char *const name)
void ose_pprintFullBundle (ose_bundle src, ose_bundle dest, const char *const name)
int32_t ose_pprintBytes (const char *const bytes, int32_t n, char *buf, int32_t buflen)
 A packet's bytes as text, a four-byte word to a line: its offset, the bytes in hex, as characters, and as a big-endian int32. Raw bytes, whether or not they are a well-formed packet.

Detailed Description

Rendering a bundle for a human to read.

Nothing in libose calls any of this. Every caller is a host showing a bundle to someone, which is why it is a separate translation unit that a build can leave out. ose_print.h includes this one, so code that has always included ose_print.h to get a pretty printer keeps working.

Function Documentation

◆ ose_pprintBytes()

int32_t ose_pprintBytes ( const char *const bytes,
int32_t n,
char * buf,
int32_t buflen )

A packet's bytes as text, a four-byte word to a line: its offset, the bytes in hex, as characters, and as a big-endian int32. Raw bytes, whether or not they are a well-formed packet.

Parameters
bytesThe bytes.
nHow many.
bufWhere to write, or NULL to measure.
buflenRoom in buf, including the terminator.
Returns
The length the whole text wants, as snprintf() returns it.