xref: /freebsd/stand/libsa/nvstore.h (revision d1ea5017141ffecdb7ce97a3d97b27a6aabf8c4a)
1*d1ea5017SWarner Losh /*-
2*d1ea5017SWarner Losh  * Copyright 2020 Toomas Soome <tsoome@me.com>
3*d1ea5017SWarner Losh  *
4*d1ea5017SWarner Losh  * Redistribution and use in source and binary forms, with or without
5*d1ea5017SWarner Losh  * modification, are permitted provided that the following conditions
6*d1ea5017SWarner Losh  * are met:
7*d1ea5017SWarner Losh  * 1. Redistributions of source code must retain the above copyright
8*d1ea5017SWarner Losh  *    notice, this list of conditions and the following disclaimer.
9*d1ea5017SWarner Losh  * 2. Redistributions in binary form must reproduce the above copyright
10*d1ea5017SWarner Losh  *    notice, this list of conditions and the following disclaimer in the
11*d1ea5017SWarner Losh  *    documentation and/or other materials provided with the distribution.
12*d1ea5017SWarner Losh  *
13*d1ea5017SWarner Losh  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14*d1ea5017SWarner Losh  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15*d1ea5017SWarner Losh  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16*d1ea5017SWarner Losh  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17*d1ea5017SWarner Losh  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18*d1ea5017SWarner Losh  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19*d1ea5017SWarner Losh  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20*d1ea5017SWarner Losh  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21*d1ea5017SWarner Losh  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22*d1ea5017SWarner Losh  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23*d1ea5017SWarner Losh  * SUCH DAMAGE.
24*d1ea5017SWarner Losh  */
25*d1ea5017SWarner Losh 
26*d1ea5017SWarner Losh /* Private part of nvstore API, for internal use only */
27*d1ea5017SWarner Losh 
28*d1ea5017SWarner Losh #pragma once
29*d1ea5017SWarner Losh 
30*d1ea5017SWarner Losh typedef struct nvstore {
31*d1ea5017SWarner Losh 	char		*nvs_name;
32*d1ea5017SWarner Losh 	void		*nvs_data;
33*d1ea5017SWarner Losh 	nvs_callbacks_t	*nvs_cb;
34*d1ea5017SWarner Losh 	STAILQ_ENTRY(nvstore) nvs_next;
35*d1ea5017SWarner Losh } nvstore_t;
36*d1ea5017SWarner Losh 
37*d1ea5017SWarner Losh typedef STAILQ_HEAD(store_list, nvstore) nvstore_list_t;
38*d1ea5017SWarner Losh 
39*d1ea5017SWarner Losh extern nvstore_list_t stores;
40