1187770Sluigi/*- 2187770Sluigi * Copyright (c) 2014 Juniper Networks, Inc. 3187770Sluigi * All rights reserved. 4187770Sluigi * 5187770Sluigi * Redistribution and use in source and binary forms, with or without 6187770Sluigi * modification, are permitted provided that the following conditions 7187770Sluigi * are met: 8187770Sluigi * 1. Redistributions of source code must retain the above copyright 9187770Sluigi * notice, this list of conditions and the following disclaimer. 10187770Sluigi * 2. Redistributions in binary form must reproduce the above copyright 11187770Sluigi * notice, this list of conditions and the following disclaimer in the 12187770Sluigi * documentation and/or other materials provided with the distribution. 13187770Sluigi * 14187770Sluigi * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15187770Sluigi * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16187770Sluigi * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17187770Sluigi * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18187770Sluigi * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19187770Sluigi * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20187770Sluigi * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21187770Sluigi * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22187770Sluigi * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23187770Sluigi * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24187770Sluigi * SUCH DAMAGE. 25187770Sluigi * 26187770Sluigi * $FreeBSD: releng/11.0/usr.bin/mkimg/format.h 266176 2014-05-15 19:19:57Z marcel $ 27187770Sluigi */ 28187770Sluigi 29187770Sluigi#ifndef _MKIMG_FORMAT_H_ 30187770Sluigi#define _MKIMG_FORMAT_H_ 31187770Sluigi 32187770Sluigi#include <sys/linker_set.h> 33187770Sluigi 34187770Sluigistruct mkimg_format { 35187770Sluigi const char *name; 36187770Sluigi const char *description; 37187770Sluigi int (*resize)(lba_t); 38187770Sluigi int (*write)(int); 39187770Sluigi}; 40187770Sluigi 41187770SluigiSET_DECLARE(formats, struct mkimg_format); 42187770Sluigi#define FORMAT_DEFINE(nm) DATA_SET(formats, nm) 43187770Sluigi 44187770Sluigiint format_resize(lba_t); 45187770Sluigiint format_select(const char *); 46187770Sluigistruct mkimg_format *format_selected(void); 47187770Sluigiint format_write(int); 48187770Sluigi 49187770Sluigi#endif /* _MKIMG_FORMAT_H_ */ 50220802Sglebius