A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd
at master 99 lines 2.5 kB view raw
1/*************************************************************************** 2 * __________ __ ___. 3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___ 4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / 5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < 6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ 7 * \/ \/ \/ \/ \/ 8 * $Id$ 9 * 10 * Copyright (C) 2002 Gilles Roux 11 * 2003 Garrett Derner 12 * 2010 Yoshihisa Uchida 13 * 14 * This program is free software; you can redistribute it and/or 15 * modify it under the terms of the GNU General Public License 16 * as published by the Free Software Foundation; either version 2 17 * of the License, or (at your option) any later version. 18 * 19 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 20 * KIND, either express or implied. 21 * 22 ****************************************************************************/ 23#ifndef PLUGIN_TEXT_VIEWER_READER_H 24#define PLUGIN_TEXT_VIEWER_READER_H 25 26/* stuff for the reading file */ 27 28/* 29 * initialize the reader module 30 * 31 * [In/Out] buf 32 * the start pointer of the buffer 33 * 34 * [In/Out] size 35 * enabled buffer size 36 * 37 * return 38 * true initialize success 39 * false initialize failure 40 */ 41bool tv_init_reader(unsigned char **buf, size_t *bufsize); 42 43/* finalize the reader module */ 44void tv_finalize_reader(void); 45 46/* 47 * return the file size 48 * 49 * return 50 * file size 51 * 52 * Note: when the file is UTF-8 file with BOM, if the encoding of the text viewer is UTF-8, 53 * then file size decreases only BOM size. 54 */ 55off_t tv_get_file_size(void); 56 57/* 58 * return the whether is the end of file or not 59 * 60 * return 61 * true EOF 62 * false not EOF 63 */ 64bool tv_is_eof(void); 65 66/* 67 * return the current file position 68 * 69 * return 70 * the current file position 71 */ 72off_t tv_get_current_file_pos(void); 73 74/* 75 * return the bufer which store text data 76 * 77 * [Out] bufsize 78 * buffer size 79 * 80 * return 81 * the pointer of the buffer 82 */ 83const unsigned char *tv_get_buffer(ssize_t *bufsize); 84 85/* 86 * seek to the given offset 87 * 88 * [In] offset 89 * offset size 90 * 91 * [In] whence 92 * SEEK_CUR seek to the current position + offset. 93 * SEEK_SET seek to the offset. 94 * 95 * Note: whence supports SEEK_CUR and SEEK_SET only. 96 */ 97void tv_seek(off_t offset, int whence); 98 99#endif