14fc55e3eSMaxim Sobolev /* 24fc55e3eSMaxim Sobolev * Copyright (c) 2016 Maxim Sobolev <sobomax@FreeBSD.org> 34fc55e3eSMaxim Sobolev * All rights reserved. 44fc55e3eSMaxim Sobolev * 54fc55e3eSMaxim Sobolev * Redistribution and use in source and binary forms, with or without 64fc55e3eSMaxim Sobolev * modification, are permitted provided that the following conditions 74fc55e3eSMaxim Sobolev * are met: 84fc55e3eSMaxim Sobolev * 1. Redistributions of source code must retain the above copyright 94fc55e3eSMaxim Sobolev * notice, this list of conditions and the following disclaimer. 104fc55e3eSMaxim Sobolev * 2. Redistributions in binary form must reproduce the above copyright 114fc55e3eSMaxim Sobolev * notice, this list of conditions and the following disclaimer in the 124fc55e3eSMaxim Sobolev * documentation and/or other materials provided with the distribution. 134fc55e3eSMaxim Sobolev * 144fc55e3eSMaxim Sobolev * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 154fc55e3eSMaxim Sobolev * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 164fc55e3eSMaxim Sobolev * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 174fc55e3eSMaxim Sobolev * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 184fc55e3eSMaxim Sobolev * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 194fc55e3eSMaxim Sobolev * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 204fc55e3eSMaxim Sobolev * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 214fc55e3eSMaxim Sobolev * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 224fc55e3eSMaxim Sobolev * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 234fc55e3eSMaxim Sobolev * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 244fc55e3eSMaxim Sobolev * SUCH DAMAGE. 254fc55e3eSMaxim Sobolev */ 264fc55e3eSMaxim Sobolev 27*eefd8f96SConrad Meyer DEFINE_RAW_METHOD(f_compress_bound, size_t, size_t); 28*eefd8f96SConrad Meyer DEFINE_RAW_METHOD(f_init, void *, int *); 29*eefd8f96SConrad Meyer DEFINE_RAW_METHOD(f_compress, void, void *, const struct mkuz_blk *, struct mkuz_blk *); 304fc55e3eSMaxim Sobolev 314fc55e3eSMaxim Sobolev struct mkuz_format { 32*eefd8f96SConrad Meyer const char *option; 334fc55e3eSMaxim Sobolev const char *magic; 344fc55e3eSMaxim Sobolev const char *default_sufx; 35*eefd8f96SConrad Meyer f_compress_bound_t f_compress_bound; 364fc55e3eSMaxim Sobolev f_init_t f_init; 374fc55e3eSMaxim Sobolev f_compress_t f_compress; 384fc55e3eSMaxim Sobolev }; 39