CX Framework
Cross-platform C utility framework
Loading...
Searching...
No Matches
logwire.h File Reference

Wire codec for log records: records in, framed bytes out, and back again. More...

#include <cx/buffer/buffer.h>
#include <cx/container/sarray.h>
#include <cx/log/log.h>
#include <cx/log/logctx.h>

Go to the source code of this file.

Data Structures

struct  LogWireRecord
 
struct  LogSubSpec
 
struct  LogWireChanInfo
 One channel in a sender's catalog. More...
 
struct  LogWireCatalog
 
struct  LogWireGap
 
struct  LogWireFrame
 

Typedefs

typedef struct LogWireRecord LogWireRecord
 
typedef struct LogSubSpec LogSubSpec
 
typedef struct LogWireChanInfo LogWireChanInfo
 One channel in a sender's catalog.
 
typedef struct LogWireCatalog LogWireCatalog
 
typedef struct LogWireGap LogWireGap
 
typedef struct LogWireFrame LogWireFrame
 
typedef bool(* LogWireFrameCB) (const LogWireFrame *frame, void *ctx)
 
typedef struct LogWireEncoder LogWireEncoder
 Opaque encoder; one per connection.
 
typedef struct LogWireDecoder LogWireDecoder
 Opaque decoder; one per connection.
 

Enumerations

enum  LOG_WIRE_FRAME {
  LOG_WireSegment = 1 , LOG_WireChanDecl , LOG_WireSiteDecl , LOG_WireEntry ,
  LOG_WireGap , LOG_WireSubscribe , LOG_WireCatalog
}
 
enum  LOG_WIRE_FLAGS { LOG_WireOmitCtx = 0x00000001 }
 Encoder options. More...
 

Functions

LogWireEncoderlogWireEncoderCreate (strref origin, flags_t flags)
 
void logWireEncoderDestroy (LogWireEncoder **enc)
 
bool logWireEncode (LogWireEncoder *enc, Buffer *out, const LogRecord *rec)
 
bool logWireEncodeGap (LogWireEncoder *enc, Buffer *out, uint64 n, uint64 firstseq, uint64 lastseq)
 
bool logWireEncodeSub (LogWireEncoder *enc, Buffer *out, const LogSubSpec *spec)
 
bool logWireEncodeCatalog (LogWireEncoder *enc, Buffer *out, _In_reads_(nchans) const LogWireChanInfo *chans, int nchans)
 
void logWireEndSegment (LogWireEncoder *enc)
 
LogWireDecoderlogWireDecoderCreate (void)
 
void logWireDecoderDestroy (LogWireDecoder **dec)
 
bool logWireDecode (LogWireDecoder *dec, const uint8 *buf, size_t len, LogWireFrameCB cb, void *ctx)
 
bool logInject (strref chanpath, const LogWireRecord *rec)
 

Detailed Description

Wire codec for log records: records in, framed bytes out, and back again.

Definition in file logwire.h.