format.h revision 268161
11558Srgrimes/*- 250476Speter * Copyright (c) 2014 Juniper Networks, Inc. 31558Srgrimes * All rights reserved. 412481Speter * 51558Srgrimes * Redistribution and use in source and binary forms, with or without 641061Sbde * modification, are permitted provided that the following conditions 774448Ssos * are met: 841061Sbde * 1. Redistributions of source code must retain the above copyright 939271Sphk * notice, this list of conditions and the following disclaimer. 1039255Sgibbs * 2. Redistributions in binary form must reproduce the above copyright 1138653Sgpalmer * notice, this list of conditions and the following disclaimer in the 1238653Sgpalmer * documentation and/or other materials provided with the distribution. 1355980Speter * 1443859Sobrien * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 1538653Sgpalmer * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1638653Sgpalmer * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1738653Sgpalmer * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 1838653Sgpalmer * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 1938653Sgpalmer * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2069800Stomsoft * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2138653Sgpalmer * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2267105Sadrian * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2366867Sadrian * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2438653Sgpalmer * SUCH DAMAGE. 2538653Sgpalmer * 2669800Stomsoft * $FreeBSD: stable/10/usr.bin/mkimg/format.h 268161 2014-07-02 14:54:41Z marcel $ 2738653Sgpalmer */ 2838653Sgpalmer 2956815Sshin#ifndef _MKIMG_FORMAT_H_ 3053644Sguido#define _MKIMG_FORMAT_H_ 3154225Sguido 3238653Sgpalmer#include <sys/linker_set.h> 3354225Sguido 3454225Sguidostruct mkimg_format { 3578978Sroam const char *name; 3638653Sgpalmer const char *description; 3738653Sgpalmer int (*resize)(lba_t); 3838653Sgpalmer int (*write)(int); 3938843Sjb}; 4038653Sgpalmer 4170450SphkSET_DECLARE(formats, struct mkimg_format); 4278448Sdd#define FORMAT_DEFINE(nm) DATA_SET(formats, nm) 4338653Sgpalmer 4438653Sgpalmerint format_resize(lba_t); 4538653Sgpalmerint format_select(const char *); 4638653Sgpalmerstruct mkimg_format *format_selected(void); 4767105Sadrianint format_write(int); 4877577Sru 4938653Sgpalmer#endif /* _MKIMG_FORMAT_H_ */ 5043557Ssemenu