.\" Automatically generated by Pandoc 2.9.2.1 .\" .TH "" "" "2023-05-31" "PMDK - " "PMDK Programmer's Manual" .hy .\" SPDX-License-Identifier: BSD-3-Clause .\" Copyright 2017-2023, Intel Corporation .SH NAME .PP \f[B]pmemlog_tell\f[R]()(DEPRECATED), \f[B]pmemlog_rewind\f[R]()(DEPRECATED), \f[B]pmemlog_walk\f[R]()(DEPRECATED) - checks current write point for the log or walks through the log .SH SYNOPSIS .IP .nf \f[C] #include long long pmemlog_tell(PMEMlogpool *plp); void pmemlog_rewind(PMEMlogpool *plp); void pmemlog_walk(PMEMlogpool *plp, size_t chunksize, int (*process_chunk)(const void *buf, size_t len, void *arg), void *arg); \f[R] .fi .SH DESCRIPTION .PP The \f[B]pmemlog_tell\f[R]() function returns the current write point for the log, expressed as a byte offset into the usable log space in the memory pool. This offset starts off as zero on a newly-created log, and is incremented by each successful append operation. This function can be used to determine how much data is currently in the log. .PP The \f[B]pmemlog_rewind\f[R]() function resets the current write point for the log to zero. After this call, the next append adds to the beginning of the log. .PP The \f[B]pmemlog_walk\f[R]() function walks through the log \f[I]plp\f[R], from beginning to end, calling the callback function \f[I]process_chunk\f[R] for each \f[I]chunksize\f[R] block of data found. The argument \f[I]arg\f[R] is also passed to the callback to help avoid the need for global state. The \f[I]chunksize\f[R] argument is useful for logs with fixed-length records and may be specified as 0 to cause a single call to the callback with the entire log contents passed as the \f[I]buf\f[R] argument. The \f[I]len\f[R] argument tells the \f[I]process_chunk\f[R] function how much data \f[I]buf\f[R] is holding. The callback function should return 1 if \f[B]pmemlog_walk\f[R]() should continue walking through the log, or 0 to terminate the walk. The callback function is called while holding \f[B]libpmemlog\f[R](7) internal locks that make calls atomic, so the callback function must not try to append to the log itself or deadlock will occur. .SH RETURN VALUE .PP On success, \f[B]pmemlog_tell\f[R]() returns the current write point for the log. On error, it returns -1 and sets \f[I]errno\f[R] appropriately. .PP The \f[B]pmemlog_rewind\f[R]() and \f[B]pmemlog_walk\f[R]() functions return no value. .SH SEE ALSO .PP \f[B]libpmemlog\f[R](7) and \f[B]\f[R]