Motr  M0
buf.h File Reference
#include "lib/types.h"
#include "xcode/xcode_attr.h"
Include dependency graph for buf.h:

Go to the source code of this file.

Data Structures

struct  m0_buf
 
struct  m0_bufs
 

Macros

#define __MOTR_LIB_BUF_H__
 
#define M0_BUF_INIT(size, data)   ((struct m0_buf){ .b_nob = (size), .b_addr = (data) })
 
#define M0_BUF_INIT_CONST(size, data)   (const struct m0_buf) { .b_nob = (size), .b_addr = (void *)(data) }
 
#define M0_BUF_INIT_PTR(p)   M0_BUF_INIT(sizeof *(p), (p))
 
#define M0_BUF_INITS(str)   M0_BUF_INIT(strlen(str), (str))
 
#define M0_BUF_INIT0   M0_BUF_INIT(0, NULL)
 
#define M0_BUF_INIT_PTR_CONST(p)   M0_BUF_INIT_CONST(sizeof *(p), (p))
 
#define BUF_F   "[%p,%llu]"
 
#define BUF_P(p)   (p)->b_addr, (unsigned long long)(p)->b_nob
 

Functions

struct m0_buf M0_XCA_DOMAIN (conf|rpc)
 
M0_INTERNAL void m0_buf_init (struct m0_buf *buf, void *data, uint32_t nob)
 
M0_INTERNAL int m0_buf_alloc (struct m0_buf *buf, size_t size)
 
M0_INTERNAL void m0_buf_free (struct m0_buf *buf)
 
M0_INTERNAL int m0_buf_cmp (const struct m0_buf *x, const struct m0_buf *y)
 
M0_INTERNAL bool m0_buf_eq (const struct m0_buf *x, const struct m0_buf *y)
 
M0_INTERNAL void m0_buf_memcpy (struct m0_buf *dst, const struct m0_buf *src)
 
M0_INTERNAL int m0_buf_copy (struct m0_buf *dest, const struct m0_buf *src)
 
M0_INTERNAL int m0_buf_new_aligned (struct m0_buf *buf, const void *data, uint32_t nob, unsigned shift)
 
M0_INTERNAL int m0_buf_copy_aligned (struct m0_buf *dst, const struct m0_buf *src, unsigned shift)
 
M0_INTERNAL bool m0_buf_is_set (const struct m0_buf *buf)
 
M0_INTERNAL bool m0_buf_streq (const struct m0_buf *buf, const char *str)
 
M0_INTERNAL char * m0_buf_strdup (const struct m0_buf *buf)
 
M0_INTERNAL int m0_bufs_from_strings (struct m0_bufs *dest, const char **src)
 
M0_INTERNAL int m0_bufs_to_strings (const char ***dest, const struct m0_bufs *src)
 
M0_INTERNAL bool m0_bufs_streq (const struct m0_bufs *bufs, const char **strs)
 
M0_INTERNAL void m0_bufs_free (struct m0_bufs *bufs)
 

Variables

m0_bcount_t b_nob
 
void * b_addr
 
uint32_t ab_count
 
struct m0_bufab_elems
 

Macro Definition Documentation

◆ __MOTR_LIB_BUF_H__

#define __MOTR_LIB_BUF_H__

Definition at line 26 of file buf.h.

Variable Documentation

◆ ab_count

uint32_t ab_count

Definition at line 230 of file buf.h.

◆ ab_elems

struct m0_buf* ab_elems

Definition at line 231 of file buf.h.

◆ b_addr

void* b_addr

Definition at line 231 of file buf.h.

◆ b_nob

m0_bcount_t b_nob

Definition at line 230 of file buf.h.