Path: blob/master/libs/mpg123/src/libmpg123/lfs_wrap.h
4394 views
/*1lfs_wrap: I/O wrapper code23copyright 2010-2023 by the mpg123 project4free software under the terms of the LGPL 2.15see COPYING and AUTHORS files in distribution or http://mpg123.org6initially written by Thomas Orgis (after code from Michael Hipp)78This is the interface to the implementation of internal reading/seeking9as well as wrapping of client callbacks to the one and only 64 bit10callback API on opaque handles.1112Code outside of this shall not be concerned with I/O details, and13code inside of this shall not be concerned with other14libmpg123 internals. Just the public portable API interface.15*/161718// This is to be offered by libmpg123 code that has access to frame struct19// details. It returns the address to load/store the pointer to the20// wrapper handle from/into. A little hack to keep things disentangled.21void ** INT123_wrap_handle(mpg123_handle *mh);22// Set error code in the mpg123 handle and return MPG123_ERR.23int INT123_set_err(mpg123_handle *mh, int err);2425// These are offered by the source associated with this header.2627// This is one open routine for all ways. One of the given resource arguments is active:28// 1. handle: if path == NULL && fd < 029// 2. path: if path != NULL30// 3. fd: if fd >= 031// In case of 64 bit handle setup, this does nothing.32// Return values:33// 0: setup for wrapped I/O successful.34// 1: use user-supplied 64 bit I/O handle directly, no internal wrappery35// <0: error36#define LFS_WRAP_NONE 137int INT123_wrap_open(mpg123_handle *mh, void *handle, const char *path, int fd, long timeout, int quiet);38// Deallocate all associated resources and handle memory itself.39void INT123_wrap_destroy(void * handle);4041// The bulk of functions are implementations of the non-portable42// libmpg123 API declared or implied in the main header.434445